Class 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 interface org.codehaus.commons.compiler.IClassBodyEvaluator

        DEFAULT_CLASS_NAME
      • Fields inherited from interface org.codehaus.commons.compiler.ICookable

        BOOT_CLASS_LOADER
    • 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 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
      • Methods inherited from interface org.codehaus.commons.compiler.ICookable

        cook, cook, cook, cook, cook, cook, cook, cook, cookFile, cookFile, cookFile, cookFile, setCompileErrorHandler, setDebuggingInformation, setParentClassLoader, setWarningHandler
      • Methods inherited from interface org.codehaus.commons.compiler.ISimpleCompiler

        getClassLoader, setNoPermissions, setPermissions
    • Field Detail

      • layout

        protected int[] layout
    • Constructor Detail

      • DirectTupleCodeGenerator

        public DirectTupleCodeGenerator​(java.lang.Class iface,
                                        java.lang.String[] fieldNames,
                                        java.lang.Class[] fieldTypes,
                                        int[] layout)
    • Method Detail

      • generateIndexedGetterImpl

        protected java.util.List<org.codehaus.janino.Java.SwitchStatement.SwitchBlockStatementGroup> generateIndexedGetterImpl()
                                                                                                                        throws org.codehaus.commons.compiler.CompileException
        Specified by:
        generateIndexedGetterImpl in class TupleCodeGenerator
        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 class TupleCodeGenerator
        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 class TupleCodeGenerator
        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 class TupleCodeGenerator
        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 class TupleCodeGenerator
        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 class TupleCodeGenerator
        Throws:
        org.codehaus.commons.compiler.CompileException
      • accessorForType

        protected java.lang.String accessorForType​(java.lang.Class type)