Package com.nickrobison.tuple.codegen
Class DirectTupleCodeGenerator
- java.lang.Object
-
- org.codehaus.commons.compiler.Cookable
-
- org.codehaus.janino.SimpleCompiler
-
- org.codehaus.janino.ClassBodyEvaluator
-
- com.nickrobison.tuple.codegen.TupleCodeGenerator
-
- com.nickrobison.tuple.codegen.DirectTupleCodeGenerator
-
- All Implemented Interfaces:
org.codehaus.commons.compiler.IClassBodyEvaluator
,org.codehaus.commons.compiler.ICookable
,org.codehaus.commons.compiler.ISimpleCompiler
public class DirectTupleCodeGenerator extends TupleCodeGenerator
Created by cliff on 5/5/14.
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
layout
-
Fields inherited from class com.nickrobison.tuple.codegen.TupleCodeGenerator
className, fieldNames, fieldTypes, iface, INDEX, loc, types, VALUE
-
-
Constructor Summary
Constructors Constructor Description DirectTupleCodeGenerator(java.lang.Class iface, java.lang.String[] fieldNames, java.lang.Class[] fieldTypes, int[] layout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
accessorForType(java.lang.Class type)
protected org.codehaus.janino.Java.FieldDeclaration[]
generateFields()
protected org.codehaus.janino.Java.Rvalue
generateGetInvocation(java.lang.Class type, int index)
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup>
generateIndexedGetterImpl()
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup>
generateIndexedGetterImpl(java.lang.Class type)
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup>
generateIndexedSetterImpl(java.lang.String value)
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup>
generateIndexedSetterImpl(java.lang.String value, java.lang.Class type)
protected org.codehaus.janino.Java.Rvalue
generateSetInvocation(java.lang.Class type, int index, java.lang.String value)
-
Methods inherited from class com.nickrobison.tuple.codegen.TupleCodeGenerator
capitalize, classToRefType, cookToClass, generateDefaultCase, generateGetter, generateIndexedGetter, generateIndexedSetter, generateIndexedTypedGetters, generateIndexedTypedSetters, generateSetter, makeCompilationUnit, primIndex, primToBox
-
Methods inherited from class org.codehaus.janino.ClassBodyEvaluator
addPackageMemberClassDeclaration, compileToClass, cook, createFastClassBodyEvaluator, createFastClassBodyEvaluator, createInstance, getClazz, makeCompilationUnit, setClassName, setDefaultImports, setExtendedClass, setExtendedType, setImplementedInterfaces, setImplementedTypes
-
Methods inherited from class org.codehaus.janino.SimpleCompiler
classesToTypes, classToType, compileToClassLoader, cook, cook, cook, cook, equals, getClassLoader, hashCode, main, optionalClassToType, options, options, setCompileErrorHandler, setDebuggingInformation, setNoPermissions, setParentClassLoader, setPermissions, setWarningHandler
-
Methods inherited from class org.codehaus.commons.compiler.Cookable
cook, cook, cook, cook, cook, cook, cook, cookFile, cookFile, cookFile, cookFile, readString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
generateFields
protected org.codehaus.janino.Java.FieldDeclaration[] generateFields()
- Specified by:
generateFields
in classTupleCodeGenerator
-
generateIndexedGetterImpl
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup> generateIndexedGetterImpl() throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateIndexedGetterImpl
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
generateIndexedGetterImpl
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup> generateIndexedGetterImpl(java.lang.Class type) throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateIndexedGetterImpl
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
generateIndexedSetterImpl
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup> generateIndexedSetterImpl(java.lang.String value) throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateIndexedSetterImpl
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
generateIndexedSetterImpl
protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup> generateIndexedSetterImpl(java.lang.String value, java.lang.Class type) throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateIndexedSetterImpl
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
generateGetInvocation
protected org.codehaus.janino.Java.Rvalue generateGetInvocation(java.lang.Class type, int index) throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateGetInvocation
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
generateSetInvocation
protected org.codehaus.janino.Java.Rvalue generateSetInvocation(java.lang.Class type, int index, java.lang.String value) throws org.codehaus.commons.compiler.CompileException
- Specified by:
generateSetInvocation
in classTupleCodeGenerator
- Throws:
org.codehaus.commons.compiler.CompileException
-
accessorForType
protected java.lang.String accessorForType(java.lang.Class type)
-
-