java.lang.Object
org.eclipse.persistence.internal.codegen.CodeDefinition
Direct Known Subclasses:
AttributeDefinition, ClassDefinition, MethodDefinition

public abstract class CodeDefinition extends Object
INTERNAL:

Purpose: Model a element of code generation purposes.

Since:
TopLink 3.0
  • Field Details

  • Constructor Details

    • CodeDefinition

      protected CodeDefinition()
  • Method Details

    • adjustTypeName

      protected static String adjustTypeName(String typeName, Map<String,Set<String>> typeNameMap)
      Compares the typeName to those stored in the typeNameMap. If the short name of the typeName is unambiguous (only one package for that short name in the Map), removes the package name and returns the short name, else returns the whole thing. Assumes that typeName contains only a package name (optional) and a short name, potentially with subtended brackets. (e.g. int -> int, java.util.Vector -> Vector, java.lang.Boolean[] -> Boolean[], etc.)
    • parseForTypeNames

      protected static Set<String> parseForTypeNames(String longString)
      Returns a set of java.lang.String type names included in longString. Will only look for ValueHolder, java.util collection types, and TopLink indirect collection types. All other searches too intractable at this point.
    • putTypeNameInMap

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

      public AccessLevel getAccessLevel()
    • getComment

      public String getComment()
    • getName

      public String getName()
    • setAccessLevel

      public void setAccessLevel(AccessLevel accessLevel)
    • setComment

      public void setComment(String comment)
    • setName

      public void setName(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • write

      public void write(CodeGenerator generator)
      Write the code out to the generator's stream.
    • writeBody

      public abstract void writeBody(CodeGenerator generator)
      Write the code out to the generator's stream.