jedi.annotation.writer.method
Class AbstractFactoryMethodWriter

java.lang.Object
  extended by jedi.annotation.writer.method.AbstractFactoryMethodWriter
All Implemented Interfaces:
ClosureFragmentWriter, FactoryMethodWriter
Direct Known Subclasses:
AbstractBasicFactoryMethodWriter, AbstractProxyFactoryMethodWriter

public abstract class AbstractFactoryMethodWriter
extends Object
implements ClosureFragmentWriter, FactoryMethodWriter


Field Summary
protected  ProcessorOptions options
           
static String RECEIVER_PARAMETER_NAME
           
 
Constructor Summary
AbstractFactoryMethodWriter(ProcessorOptions options)
           
 
Method Summary
 boolean canHandle(Annotateable method)
           
protected  void checkPrecondition(boolean precondition, String message)
           
 void execute(Annotateable method)
           
protected  String getCorrespondingFieldName(String parameterName)
           
protected  String getDelegateMethodDeclaringTypeWithoutBounds()
           
protected  String getDelegateMethodReturnType()
           
protected  List<Attribute> getExecuteMethodParameters()
           
protected abstract  List<Attribute> getExecuteMethodParameters(Annotateable method)
           
protected  String getExecuteMethodReturnType()
           
protected abstract  Collection<Attribute> getFactoryMethodAdditionalFormalParameters()
           
protected abstract  Collection<Attribute> getFactoryMethodBasicParameters()
           
 String getFactoryMethodName()
           
protected  String getFactoryMethodNameRequiredSuffix()
           
protected  String getFactoryMethodNameReturnTypeSuffix()
           
protected  List<Attribute> getFactoryMethodParameters()
           
protected  Annotateable getMethod()
           
protected abstract  Class<?> getOneParameterClosureClass()
           
protected  JavaWriter getWriter()
           
protected abstract  boolean hasCorrectReturnType(Annotateable method)
           
 void initialise(JavaWriter writer, FactoryType factoryType)
           
protected  boolean isReturnRequired()
           
protected  void setReceiverInvocationWriter(ReceiverInvocationWriter receiverInvocationWriter)
           
 void writeClosureDeclaration()
           
protected  void writeClosureTypes()
           
 void writeFactoryMethodActualParameters()
           
 void writeGenericTypeParameters()
           
 void writeLocalClass(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RECEIVER_PARAMETER_NAME

public static final String RECEIVER_PARAMETER_NAME
See Also:
Constant Field Values

options

protected final ProcessorOptions options
Constructor Detail

AbstractFactoryMethodWriter

public AbstractFactoryMethodWriter(ProcessorOptions options)
Method Detail

canHandle

public final boolean canHandle(Annotateable method)
Specified by:
canHandle in interface FactoryMethodWriter

checkPrecondition

protected final void checkPrecondition(boolean precondition,
                                       String message)

execute

public final void execute(Annotateable method)
Specified by:
execute in interface FactoryMethodWriter

getCorrespondingFieldName

protected String getCorrespondingFieldName(String parameterName)

getDelegateMethodDeclaringTypeWithoutBounds

protected final String getDelegateMethodDeclaringTypeWithoutBounds()

getDelegateMethodReturnType

protected final String getDelegateMethodReturnType()

getExecuteMethodParameters

protected final List<Attribute> getExecuteMethodParameters()

getExecuteMethodParameters

protected abstract List<Attribute> getExecuteMethodParameters(Annotateable method)

getExecuteMethodReturnType

protected String getExecuteMethodReturnType()

getFactoryMethodAdditionalFormalParameters

protected abstract Collection<Attribute> getFactoryMethodAdditionalFormalParameters()

getFactoryMethodBasicParameters

protected abstract Collection<Attribute> getFactoryMethodBasicParameters()

getFactoryMethodName

public final String getFactoryMethodName()
Specified by:
getFactoryMethodName in interface ClosureFragmentWriter

getFactoryMethodNameRequiredSuffix

protected String getFactoryMethodNameRequiredSuffix()

getFactoryMethodNameReturnTypeSuffix

protected String getFactoryMethodNameReturnTypeSuffix()

getFactoryMethodParameters

protected List<Attribute> getFactoryMethodParameters()

getMethod

protected Annotateable getMethod()

getOneParameterClosureClass

protected abstract Class<?> getOneParameterClosureClass()

getWriter

protected JavaWriter getWriter()

hasCorrectReturnType

protected abstract boolean hasCorrectReturnType(Annotateable method)

initialise

public final void initialise(JavaWriter writer,
                             FactoryType factoryType)
Specified by:
initialise in interface FactoryMethodWriter

isReturnRequired

protected boolean isReturnRequired()

setReceiverInvocationWriter

protected final void setReceiverInvocationWriter(ReceiverInvocationWriter receiverInvocationWriter)

writeClosureDeclaration

public final void writeClosureDeclaration()
Specified by:
writeClosureDeclaration in interface ClosureFragmentWriter

writeClosureTypes

protected void writeClosureTypes()

writeFactoryMethodActualParameters

public final void writeFactoryMethodActualParameters()
Specified by:
writeFactoryMethodActualParameters in interface ClosureFragmentWriter

writeGenericTypeParameters

public void writeGenericTypeParameters()

writeLocalClass

public final void writeLocalClass(String name)
Specified by:
writeLocalClass in interface ClosureFragmentWriter


Copyright © 2011. All Rights Reserved.