Package com.mchange.v2.codegen.intfc
Class DelegatorGenerator
java.lang.Object
com.mchange.v2.codegen.intfc.DelegatorGenerator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
generateDelegateCode
(Class intfcl, String genclass, Method method, IndentedWriter iw) protected void
generateExtraDeclarations
(Class intfcl, String genclass, IndentedWriter iw) protected void
protected void
generatePostDelegateCode
(Class intfcl, String genclass, Method method, IndentedWriter iw) protected void
generatePreDelegateCode
(Class intfcl, String genclass, Method method, IndentedWriter iw) protected void
generateReflectiveDelegateCode
(Class intfcl, String genclass, Method method, IndentedWriter iw) int
Class[]
int
int
Method[]
int
boolean
boolean
boolean
boolean
void
setClassModifiers
(int modifiers) void
setExtraInterfaces
(Class[] extraInterfaces) void
setGenerateInnerGetter
(boolean b) void
setGenerateInnerSetter
(boolean b) void
setGenerateNoArgConstructor
(boolean b) void
setGenerateWrappingConstructor
(boolean b) void
setMethodModifiers
(int modifiers) void
setNoArgConstructorModifiers
(int modifiers) void
setReflectiveDelegateMethods
(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.void
setReflectiveDelegationPolicy
(ReflectiveDelegationPolicy reflectiveDelegationPolicy) If ReflectiveDelegationPolicy.USE_MAIN_DELEGATE_INTERFACE, delegate via the same interface we are generating methods against.void
setSuperclass
(Class superclass) void
setWrappingConstructorModifiers
(int modifiers) void
writeDelegator
(Class intfcl, String genclass, Writer w)
-
Constructor Details
-
DelegatorGenerator
public DelegatorGenerator()
-
-
Method Details
-
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
-
getSuperclass
-
setExtraInterfaces
-
getExtraInterfaces
-
getReflectiveDelegateMethods
-
setReflectiveDelegateMethods
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. -
getReflectiveDelegationPolicy
-
setReflectiveDelegationPolicy
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
- Throws:
IOException
-
generateDelegateCode
protected void generateDelegateCode(Class intfcl, String genclass, Method method, IndentedWriter iw) throws IOException - Throws:
IOException
-
generateReflectiveDelegateCode
protected void generateReflectiveDelegateCode(Class intfcl, String genclass, Method method, IndentedWriter iw) throws IOException - Throws:
IOException
-
generateBannerComment
- Throws:
IOException
-
generateClassJavaDocComment
- Throws:
IOException
-
generateExtraImports
- Throws:
IOException
-
generatePreDelegateCode
protected void generatePreDelegateCode(Class intfcl, String genclass, Method method, IndentedWriter iw) throws IOException - Throws:
IOException
-
generatePostDelegateCode
protected void generatePostDelegateCode(Class intfcl, String genclass, Method method, IndentedWriter iw) throws IOException - Throws:
IOException
-
generateExtraDeclarations
protected void generateExtraDeclarations(Class intfcl, String genclass, IndentedWriter iw) throws IOException - Throws:
IOException
-