Interface IClassHolder

All Known Implementing Classes:
ClassHolder, EnumerationClassHolder, StructureClassHolder

public interface IClassHolder
Interface for working with classes during code generation.
Author:
Dennis M. Sosnoski
  • Method Details

    • getName

      String getName()
      Get simple name.
      Returns:
      name
    • getFullName

      String getFullName()
      Get fully-qualified name.
      Returns:
      name
    • getOuterClass

      IClassHolder getOuterClass()
      Get containing class of inner class.
      Returns:
      outer containing class, or null if not an inner class
    • isSuperClassForced

      boolean isSuperClassForced()
      Check if superclass is forced by schema model.
      Returns:
      true if superclass forced, false if not
    • getSuperClassName

      String getSuperClassName()
      Get name of base class to be extended.
      Returns:
      base (null if none)
    • setSuperClassName

      void setSuperClassName(String base)
      Set name of base class to be extended. This method can only be used if isSuperClassForced() returns false.
      Parameters:
      base - fully-qualified class name of base class (null if none)
    • setListImplementation

      void setListImplementation(String list)
      Set name of list implementation class to be used for initializing instances.
      Parameters:
      list - fully-qualified class name of list implementation (non-null)
    • addImport

      boolean addImport(String type)
      Add import for class. If the requested import doesn't conflict with the current set it's added, otherwise it's ignored.
      Parameters:
      type - fully qualified class name
      Returns:
      true if added as import
    • getTypeName

      String getTypeName(String type)
      Get the name to be used for a type. If the type has been imported this returns the short form of the name; otherwise it just returns the fully-qualified name.
      Parameters:
      type - fully-qualified type name
      Returns:
      name
    • getInterfaces

      String[] getInterfaces()
      Get the interfaces implemented by this class.
      Returns:
      interface names
    • getFields

      FieldDeclaration[] getFields()
      Get the fields defined in this class.
      Returns:
      fields
    • getMethods

      MethodDeclaration[] getMethods()
      Get the methods defined in this class.
      Returns:
      methods
    • addInterface

      void addInterface(String interf)
      Add an interface to this class definition.
      Parameters:
      interf - interface type
    • addField

      void addField(FieldDeclaration field)
      Add field declaration to class.
      Parameters:
      field -
    • addMethod

      void addMethod(MethodDeclaration method)
      Add method declaration to class.
      Parameters:
      method -
    • addType

      void addType(TypeDeclaration type)
      Add inner type declaration to class.
      Parameters:
      type -