Class GeneratedClass
java.lang.Object
edu.nps.moves.dis7.source.generator.pdus.GeneratedClass
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 Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
whether this class should be abstractprotected String
alias for classprotected List
<GeneratedClassAttribute> A list of all the attributes (ivars) of one classprotected List
<GeneratedInitialValue> A list of attribute names and initial values for those attributes.protected String
interfacesprotected String
Name of generated classprotected String
parent classprotected String
Special case for, e.g., enum collection/subclassprotected boolean
Whether this is an XmlRootElement; used only with XML marshalling -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassAttribute
(GeneratedClassAttribute anAttribute) Add one ivar/attribute to the classvoid
addInitialValue
(GeneratedInitialValue anInitialValue) Add one initial value to the classget alias nameReturn a list of all the attributes of the classget the comments associated with this classReturn a list of all the initial values of the classget interfacesgetName()
get nameget parent classwhether object is special caseboolean
whether object is abstractboolean
whether class is XML root elementvoid
setAbstract
(String flag) set whether object is abstractvoid
setAliasFor
(String aliasFor) set alias namevoid
setComment
(String comments) Set the comments associated with this classvoid
setInterfaces
(String pInterfaces) set interfacesvoid
set namevoid
setParentClass
(String pParentClass) setter for parent classvoid
setSpecialCase
(String flag) whether object is special casevoid
setXmlRootElement
(boolean isXmlRootElement) set whether class is XML root elementtoString()
String representation for this object
-
Field Details
-
classAttributes
A list of all the attributes (ivars) of one class -
initialValues
A list of attribute names and initial values for those attributes. -
name
Name of generated class -
parentClass
parent class -
aliasFor
alias for class -
interfaces
interfaces -
xmlRootElement
protected boolean xmlRootElementWhether this is an XmlRootElement; used only with XML marshalling -
specialCase
Special case for, e.g., enum collection/subclass -
abstractClass
protected boolean abstractClasswhether this class should be abstract
-
-
Constructor Details
-
GeneratedClass
public GeneratedClass()Constructor creates and configures a new instance object
-
-
Method Details
-
setParentClass
setter for parent class- Parameters:
pParentClass
- parent class
-
getParentClass
-
getInterfaces
-
setInterfaces
-
getName
-
setName
-
addClassAttribute
Add one ivar/attribute to the class- Parameters:
anAttribute
- of interest
-
getClassAttributes
Return a list of all the attributes of the class- Returns:
- list of
GeneratedClassAttribute
values
-
addInitialValue
Add one initial value to the class- Parameters:
anInitialValue
- of interest
-
getInitialValues
Return a list of all the initial values of the class- Returns:
- list of
GeneratedInitialValue
settings
-
setComment
Set the comments associated with this class- Parameters:
comments
- of interest
-
getClassComments
get the comments associated with this class- Returns:
- comments associated with this class
-
toString
-
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
whether object is special case- Parameters:
flag
- whether object is special case
-
getSpecialCase
whether object is special case- Returns:
- whether object is special case
-
setAbstract
set whether object is abstract- Parameters:
flag
- true or false
-
isAbstract
public boolean isAbstract()whether object is abstract- Returns:
- whether object is abstract
-
setAliasFor
set alias name- Parameters:
aliasFor
- alias name for this class
-
getAliasFor
-