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
  • Field Details

    • isAbstract

      protected boolean isAbstract
    • isConstructor

      protected boolean isConstructor
    • returnType

      protected String returnType
    • argumentNames

      protected Vector<String> argumentNames
    • lines

      protected Vector<String> lines
    • exceptions

      protected Vector<String> exceptions
    • storedBuffer

      protected StringBuffer storedBuffer
  • Constructor Details

    • MethodDefinition

      protected MethodDefinition()
  • Method Details

    • addException

      public void addException(String exceptionTypeName)
    • addLine

      public void addLine(String line)
    • addToBuffer

      public void addToBuffer(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(Map<String,Set<String>> typeNameMap)
    • argumentsEqual

      protected abstract boolean argumentsEqual(MethodDefinition methodDefinition)
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • exceptionsEqual

      protected boolean exceptionsEqual(MethodDefinition methodDefinition)
    • getArgumentNames

      protected Vector<String> getArgumentNames()
    • getArgumentName

      public String getArgumentName(int index)
    • argumentNames

      public Iterator<String> argumentNames()
    • argumentNamesSize

      public int argumentNamesSize()
    • getArgumentTypeNames

      protected abstract Vector<String> getArgumentTypeNames()
    • getArgumentTypes

      protected abstract Vector<String> getArgumentTypes()
    • getLines

      public Vector<String> getLines()
    • getExceptions

      protected Vector<String> getExceptions()
    • getReturnType

      public String getReturnType()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isAbstract

      public boolean isAbstract()
    • isConstructor

      public boolean isConstructor()
    • putTypeNamesInMap

      protected void putTypeNamesInMap(Map<String,Set<String>> typeNameMap)
      Used for calculating imports. @see org.eclipse.persistence.internal.codegen.ClassDefinition#calculateImports()
    • replaceException

      protected void replaceException(String oldExceptionName, String newExceptionName)
    • replaceLine

      protected void replaceLine(String oldLine, String newLine)
    • setIsAbstract

      public void setIsAbstract(boolean isAbstract)
    • setIsConstructor

      public void setIsConstructor(boolean isConstructor)
    • setReturnType

      public void setReturnType(String returnType)
    • writeBody

      public void writeBody(CodeGenerator generator)
      Write the code out to the generator's stream.
      Specified by:
      writeBody in class CodeDefinition
    • writeArguments

      protected abstract void writeArguments(CodeGenerator generator)
    • writeThrowsClause

      protected void writeThrowsClause(CodeGenerator generator)