Module org.eclipse.persistence.core
Class MethodDefinition
java.lang.Object
org.eclipse.persistence.internal.codegen.CodeDefinition
org.eclipse.persistence.internal.codegen.MethodDefinition
- Direct Known Subclasses:
NonreflectiveMethodDefinition,ReflectiveMethodDefinition
INTERNAL:
Purpose: Model a method for code generation purposes.
- Since:
- TopLink 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected Stringprotected StringBufferFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(String exceptionTypeName) voidvoidaddToBuffer(String partOfLine) This method can be used to store a string that will be prepended to the very next line of code enteredprotected voidadjustTypeNames(Map<String, Set<String>> typeNameMap) intprotected abstract booleanargumentsEqual(MethodDefinition methodDefinition) booleanprotected booleanexceptionsEqual(MethodDefinition methodDefinition) getArgumentName(int index) getLines()inthashCode()booleanbooleanprotected voidputTypeNamesInMap(Map<String, Set<String>> typeNameMap) Used for calculating imports.protected voidreplaceException(String oldExceptionName, String newExceptionName) protected voidreplaceLine(String oldLine, String newLine) voidsetIsAbstract(boolean isAbstract) voidsetIsConstructor(boolean isConstructor) voidsetReturnType(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 Details
-
isAbstract
protected boolean isAbstract -
isConstructor
protected boolean isConstructor -
returnType
-
argumentNames
-
lines
-
exceptions
-
storedBuffer
-
-
Constructor Details
-
MethodDefinition
protected MethodDefinition()
-
-
Method Details
-
addException
-
addLine
-
addToBuffer
This method can be used to store a string that will be prepended to the very next line of code entered -
adjustTypeNames
-
argumentsEqual
-
equals
-
exceptionsEqual
-
getArgumentNames
-
getArgumentName
-
argumentNames
-
argumentNamesSize
public int argumentNamesSize() -
getArgumentTypeNames
-
getArgumentTypes
-
getLines
-
getExceptions
-
getReturnType
-
hashCode
public int hashCode() -
isAbstract
public boolean isAbstract() -
isConstructor
public boolean isConstructor() -
putTypeNamesInMap
Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports() -
replaceException
-
replaceLine
-
setIsAbstract
public void setIsAbstract(boolean isAbstract) -
setIsConstructor
public void setIsConstructor(boolean isConstructor) -
setReturnType
-
writeBody
Write the code out to the generator's stream.- Specified by:
writeBodyin classCodeDefinition
-
writeArguments
-
writeThrowsClause
-