Class GeneratedClass

java.lang.Object
edu.nps.moves.dis7.source.generator.pdus.GeneratedClass

public class GeneratedClass extends Object
Used as part of the code generator to represent one generated class, facilitating creation of APIs for different languages. Regardless of target language, a generated class has a series of attributes, the order of which is significant. These attributes are used to create instance variables, getters and setters, and serialization code. Syntax of autogenerated output varies according to each programming language API of interest.
Author:
DMcG
  • Field Details

    • classAttributes

      protected List<GeneratedClassAttribute> classAttributes
      A list of all the attributes (ivars) of one class
    • initialValues

      protected List<GeneratedInitialValue> initialValues
      A list of attribute names and initial values for those attributes.
    • name

      protected String name
      Name of generated class
    • parentClass

      protected String parentClass
      parent class
    • aliasFor

      protected String aliasFor
      alias for class
    • interfaces

      protected String interfaces
      interfaces
    • xmlRootElement

      protected boolean xmlRootElement
      Whether this is an XmlRootElement; used only with XML marshalling
    • specialCase

      protected String specialCase
      Special case for, e.g., enum collection/subclass
    • abstractClass

      protected boolean abstractClass
      whether this class should be abstract
  • Constructor Details

    • GeneratedClass

      public GeneratedClass()
      Constructor creates and configures a new instance object
  • Method Details

    • setParentClass

      public void setParentClass(String pParentClass)
      setter for parent class
      Parameters:
      pParentClass - parent class
    • getParentClass

      public String getParentClass()
      get parent class
      Returns:
      parent class
    • getInterfaces

      public String getInterfaces()
      get interfaces
      Returns:
      interfaces
    • setInterfaces

      public void setInterfaces(String pInterfaces)
      set interfaces
      Parameters:
      pInterfaces - interfaces
    • getName

      public String getName()
      get name
      Returns:
      name
    • setName

      public void setName(String pName)
      set name
      Parameters:
      pName - new name
    • addClassAttribute

      public void addClassAttribute(GeneratedClassAttribute anAttribute)
      Add one ivar/attribute to the class
      Parameters:
      anAttribute - of interest
    • getClassAttributes

      public List<GeneratedClassAttribute> getClassAttributes()
      Return a list of all the attributes of the class
      Returns:
      list of GeneratedClassAttribute values
    • addInitialValue

      public void addInitialValue(GeneratedInitialValue anInitialValue)
      Add one initial value to the class
      Parameters:
      anInitialValue - of interest
    • getInitialValues

      public List<GeneratedInitialValue> getInitialValues()
      Return a list of all the initial values of the class
      Returns:
      list of GeneratedInitialValue settings
    • setComment

      public void setComment(String comments)
      Set the comments associated with this class
      Parameters:
      comments - of interest
    • getClassComments

      public String getClassComments()
      get the comments associated with this class
      Returns:
      comments associated with this class
    • toString

      public String toString()
      String representation for this object
      Overrides:
      toString in class Object
      Returns:
      representation for this object
    • isXmlRootElement

      public boolean isXmlRootElement()
      whether class is XML root element
      Returns:
      whether class is XML root element
    • setXmlRootElement

      public void setXmlRootElement(boolean isXmlRootElement)
      set whether class is XML root element
      Parameters:
      isXmlRootElement - whether class is XML root element
    • setSpecialCase

      public void setSpecialCase(String flag)
      whether object is special case
      Parameters:
      flag - whether object is special case
    • getSpecialCase

      public String getSpecialCase()
      whether object is special case
      Returns:
      whether object is special case
    • setAbstract

      public void setAbstract(String flag)
      set whether object is abstract
      Parameters:
      flag - true or false
    • isAbstract

      public boolean isAbstract()
      whether object is abstract
      Returns:
      whether object is abstract
    • setAliasFor

      public void setAliasFor(String aliasFor)
      set alias name
      Parameters:
      aliasFor - alias name for this class
    • getAliasFor

      public String getAliasFor()
      get alias name
      Returns:
      alias name