Class DelegatorGenerator


  • public class DelegatorGenerator
    extends java.lang.Object
    • Constructor Detail

      • DelegatorGenerator

        public DelegatorGenerator()
    • Method Detail

      • setGenerateInnerSetter

        public void setGenerateInnerSetter​(boolean b)
      • isGenerateInnerSetter

        public boolean isGenerateInnerSetter()
      • setGenerateInnerGetter

        public void setGenerateInnerGetter​(boolean b)
      • isGenerateInnerGetter

        public boolean isGenerateInnerGetter()
      • setGenerateNoArgConstructor

        public void setGenerateNoArgConstructor​(boolean b)
      • isGenerateNoArgConstructor

        public boolean isGenerateNoArgConstructor()
      • setGenerateWrappingConstructor

        public void setGenerateWrappingConstructor​(boolean b)
      • isGenerateWrappingConstructor

        public boolean isGenerateWrappingConstructor()
      • setWrappingConstructorModifiers

        public void setWrappingConstructorModifiers​(int modifiers)
      • getWrappingConstructorModifiers

        public int getWrappingConstructorModifiers()
      • setNoArgConstructorModifiers

        public void setNoArgConstructorModifiers​(int modifiers)
      • getNoArgConstructorModifiers

        public int getNoArgConstructorModifiers()
      • setMethodModifiers

        public void setMethodModifiers​(int modifiers)
      • getMethodModifiers

        public int getMethodModifiers()
      • setClassModifiers

        public void setClassModifiers​(int modifiers)
      • getClassModifiers

        public int getClassModifiers()
      • setSuperclass

        public void setSuperclass​(java.lang.Class superclass)
      • getSuperclass

        public java.lang.Class getSuperclass()
      • setExtraInterfaces

        public void setExtraInterfaces​(java.lang.Class[] extraInterfaces)
      • getExtraInterfaces

        public java.lang.Class[] getExtraInterfaces()
      • getReflectiveDelegateMethods

        public java.lang.reflect.Method[] getReflectiveDelegateMethods()
      • setReflectiveDelegateMethods

        public void setReflectiveDelegateMethods​(java.lang.reflect.Method[] reflectiveDelegateMethods)
        Reflectively delegated methods are methods that are not declared in the interface at build time, but that should reflectively be forwarded at runtime to the inner delegate. This permits support of public methods not exposed via the interface, or support of methods added to versions of the interface newer than the build version. Note that the declaring class of these methods is simply ignored. Methods will ve delegated solely by name and parameter.
      • setReflectiveDelegationPolicy

        public void setReflectiveDelegationPolicy​(ReflectiveDelegationPolicy reflectiveDelegationPolicy)
        If ReflectiveDelegationPolicy.USE_MAIN_DELEGATE_INTERFACE, delegate via the same interface we are generating methods against. (This is useful for supporting methods in versions of the interface with methods that don't appear in the version we are generating against.) If ReflectiveDelegationPolicy.USE_RUNTIME_CLASS, delegate via the runtime class of the delegate. (This is useful if the methods come from multiple interfaces, or we want to be able to forward to methods of the delegate class not captured by an interface. Otherwise, use the delegateClass set in the constructor of ReflectiveDelegationPolicy. Note that if the delegate class is not public or otherwise accessible to the generated proxy, IllegalAccessExceptions may ensue.
      • writeDelegator

        public void writeDelegator​(java.lang.Class intfcl,
                                   java.lang.String genclass,
                                   java.io.Writer w)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • generateDelegateCode

        protected void generateDelegateCode​(java.lang.Class intfcl,
                                            java.lang.String genclass,
                                            java.lang.reflect.Method method,
                                            IndentedWriter iw)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • generateReflectiveDelegateCode

        protected void generateReflectiveDelegateCode​(java.lang.Class intfcl,
                                                      java.lang.String genclass,
                                                      java.lang.reflect.Method method,
                                                      IndentedWriter iw)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • generateBannerComment

        protected void generateBannerComment​(IndentedWriter iw)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • generateClassJavaDocComment

        protected void generateClassJavaDocComment​(IndentedWriter iw)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • generateExtraImports

        protected void generateExtraImports​(IndentedWriter iw)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • generatePreDelegateCode

        protected void generatePreDelegateCode​(java.lang.Class intfcl,
                                               java.lang.String genclass,
                                               java.lang.reflect.Method method,
                                               IndentedWriter iw)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • generatePostDelegateCode

        protected void generatePostDelegateCode​(java.lang.Class intfcl,
                                                java.lang.String genclass,
                                                java.lang.reflect.Method method,
                                                IndentedWriter iw)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • generateExtraDeclarations

        protected void generateExtraDeclarations​(java.lang.Class intfcl,
                                                 java.lang.String genclass,
                                                 IndentedWriter iw)
                                          throws java.io.IOException
        Throws:
        java.io.IOException