Class MethodDefinition
- java.lang.Object
-
- org.eclipse.persistence.internal.codegen.CodeDefinition
-
- org.eclipse.persistence.internal.codegen.MethodDefinition
-
- Direct Known Subclasses:
NonreflectiveMethodDefinition,ReflectiveMethodDefinition
public abstract class MethodDefinition extends CodeDefinition
INTERNAL:Purpose: Model a method for code generation purposes.
- Since:
- TopLink 3.0
- Author:
- James Sutherland
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.VectorargumentNamesprotected java.util.Vectorexceptionsprotected booleanisAbstractprotected booleanisConstructorprotected java.util.Vectorlinesprotected java.lang.StringreturnTypeprotected java.lang.StringBufferstoredBuffer-
Fields inherited from class org.eclipse.persistence.internal.codegen.CodeDefinition
accessLevel, comment, JAVA_LANG_PACKAGE_NAME, JAVA_UTIL_PACKAGE_NAME, name, TOPLINK_INDIRECTION_PACKAGE_NAME
-
-
Constructor Summary
Constructors Constructor Description MethodDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddException(java.lang.String exceptionTypeName)voidaddLine(java.lang.String line)voidaddToBuffer(java.lang.String partOfLine)This method can be used to store a string that will be prepended to the very next line of code enteredprotected voidadjustTypeNames(java.util.Map typeNameMap)java.util.IteratorargumentNames()intargumentNamesSize()protected abstract booleanargumentsEqual(MethodDefinition methodDefinition)booleanequals(java.lang.Object object)protected booleanexceptionsEqual(MethodDefinition methodDefinition)java.lang.StringgetArgumentName(int index)protected java.util.VectorgetArgumentNames()protected abstract java.util.VectorgetArgumentTypeNames()protected abstract java.util.VectorgetArgumentTypes()protected java.util.VectorgetExceptions()java.util.VectorgetLines()java.lang.StringgetReturnType()inthashCode()booleanisAbstract()booleanisConstructor()protected voidputTypeNamesInMap(java.util.Map typeNameMap)Used for calculating imports.protected voidreplaceException(java.lang.String oldExceptionName, java.lang.String newExceptionName)protected voidreplaceLine(java.lang.String oldLine, java.lang.String newLine)voidsetIsAbstract(boolean isAbstract)voidsetIsConstructor(boolean isConstructor)voidsetReturnType(java.lang.String returnType)protected abstract voidwriteArguments(CodeGenerator generator)voidwriteBody(CodeGenerator generator)Write the code out to the generator's stream.protected voidwriteThrowsClause(CodeGenerator generator)-
Methods inherited from class org.eclipse.persistence.internal.codegen.CodeDefinition
adjustTypeName, getAccessLevel, getComment, getName, parseForTypeNames, putTypeNameInMap, setAccessLevel, setComment, setName, toString, write
-
-
-
-
Field Detail
-
isAbstract
protected boolean isAbstract
-
isConstructor
protected boolean isConstructor
-
returnType
protected java.lang.String returnType
-
argumentNames
protected java.util.Vector argumentNames
-
lines
protected java.util.Vector lines
-
exceptions
protected java.util.Vector exceptions
-
storedBuffer
protected java.lang.StringBuffer storedBuffer
-
-
Method Detail
-
addException
public void addException(java.lang.String exceptionTypeName)
-
addLine
public void addLine(java.lang.String line)
-
addToBuffer
public void addToBuffer(java.lang.String partOfLine)
This method can be used to store a string that will be prepended to the very next line of code entered
-
adjustTypeNames
protected void adjustTypeNames(java.util.Map typeNameMap)
-
argumentsEqual
protected abstract boolean argumentsEqual(MethodDefinition methodDefinition)
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
exceptionsEqual
protected boolean exceptionsEqual(MethodDefinition methodDefinition)
-
getArgumentNames
protected java.util.Vector getArgumentNames()
-
getArgumentName
public java.lang.String getArgumentName(int index)
-
argumentNames
public java.util.Iterator argumentNames()
-
argumentNamesSize
public int argumentNamesSize()
-
getArgumentTypeNames
protected abstract java.util.Vector getArgumentTypeNames()
-
getArgumentTypes
protected abstract java.util.Vector getArgumentTypes()
-
getLines
public java.util.Vector getLines()
-
getExceptions
protected java.util.Vector getExceptions()
-
getReturnType
public java.lang.String getReturnType()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isAbstract
public boolean isAbstract()
-
isConstructor
public boolean isConstructor()
-
putTypeNamesInMap
protected void putTypeNamesInMap(java.util.Map typeNameMap)
Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports()
-
replaceException
protected void replaceException(java.lang.String oldExceptionName, java.lang.String newExceptionName)
-
replaceLine
protected void replaceLine(java.lang.String oldLine, java.lang.String newLine)
-
setIsAbstract
public void setIsAbstract(boolean isAbstract)
-
setIsConstructor
public void setIsConstructor(boolean isConstructor)
-
setReturnType
public void setReturnType(java.lang.String returnType)
-
writeBody
public void writeBody(CodeGenerator generator)
Write the code out to the generator's stream.- Specified by:
writeBodyin classCodeDefinition
-
writeArguments
protected abstract void writeArguments(CodeGenerator generator)
-
writeThrowsClause
protected void writeThrowsClause(CodeGenerator generator)
-
-