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 boolean
protected boolean
protected String
protected StringBuffer
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
addException
(String exceptionTypeName) void
void
addToBuffer
(String partOfLine) This method can be used to store a string that will be prepended to the very next line of code enteredprotected void
adjustTypeNames
(Map<String, Set<String>> typeNameMap) int
protected abstract boolean
argumentsEqual
(MethodDefinition methodDefinition) boolean
protected boolean
exceptionsEqual
(MethodDefinition methodDefinition) getArgumentName
(int index) getLines()
int
hashCode()
boolean
boolean
protected void
putTypeNamesInMap
(Map<String, Set<String>> typeNameMap) Used for calculating imports.protected void
replaceException
(String oldExceptionName, String newExceptionName) protected void
replaceLine
(String oldLine, String newLine) void
setIsAbstract
(boolean isAbstract) void
setIsConstructor
(boolean isConstructor) void
setReturnType
(String returnType) protected abstract void
writeArguments
(CodeGenerator generator) void
writeBody
(CodeGenerator generator) Write the code out to the generator's stream.protected void
writeThrowsClause
(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:
writeBody
in classCodeDefinition
-
writeArguments
-
writeThrowsClause
-