|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--step.typedef.RecordDef.Builder
Create record definitions with the Builder pattern.
Method Summary | |
RecordDef.Builder |
addAttribute(Attribute attribute)
Add a record attribute to the definition. |
RecordDef.Builder |
addField(FieldDef fieldDef)
Add a field to the definition. |
void |
clear()
Clear the current build context. |
List |
getAttributes()
Get the list of record attributes for the definition. |
String |
getDescription()
Get the description for the definition. |
RecordFactory |
getFactory()
Get the factory for the definition. |
List |
getFields()
Get the list of fields for the definition. |
String |
getLabel()
Get the label for the definition. |
List |
getModifiers()
Get the list of field modifiers for the definition. |
Type |
getParent()
Get the parent for the current definition. |
RecordDef |
makeRecordDef()
Obtain the completed record definition. |
RecordDef.Builder |
modifyField(FieldModifier modifier)
Add a field modifier to the definition. |
RecordDef.Builder |
newRecordDef(String name)
Start building a new record definition with the given name in the ROOT package. |
RecordDef.Builder |
newRecordDef(String name,
Package pkg)
Start building a new record definition with the given name in the given package. |
RecordDef.Builder |
newRecordDef(String name,
String pkgName)
Start building a new record definition with the given name in the given package name. |
RecordDef.Builder |
setDescription(String description)
Set the description for the definition. |
RecordDef.Builder |
setFactory(RecordFactory factory)
Set the factory object for the definition. |
RecordDef.Builder |
setLabel(String label)
Set the label for the definition. |
RecordDef.Builder |
setParent(String parentName)
Make the definition inherit from another. |
RecordDef.Builder |
setParent(String parentName,
boolean cleanInherit)
Make the definition inherit from another. |
RecordDef.Builder |
setParent(Type parent)
Make the definition inherit from another. |
RecordDef.Builder |
setParent(Type parent,
boolean cleanInherit)
Make the definition inherit from another. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public RecordDef.Builder newRecordDef(String name)
ROOT
package.
newRecordDef(String,Package)
public RecordDef.Builder newRecordDef(String name, String pkgName)
newRecordDef(String,Package)
public RecordDef.Builder newRecordDef(String name, Package pkg)
The default record label is the record's name. The default record description is the empty string ("").
name
- the brief name of the record type.pkg
- the package containing the record.
IllegalStateException
- if already building a definition.
IllegalArgumentException
- if name
or pkg
are null
.public RecordDef.Builder setParent(String parentName)
setParent(Type,boolean)
public RecordDef.Builder setParent(String parentName, boolean cleanInherit)
setParent(Type,boolean)
public RecordDef.Builder setParent(Type parent)
setParent(Type,boolean)
public RecordDef.Builder setParent(Type parent, boolean cleanInherit)
parent
- the type to inherit fromcleanInherit
- if true
,
do not inherit the parent's record attributes
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if parent
is null
.DerivedRecordDef
public Type getParent()
null
if no parent is currently defined.public RecordDef.Builder setLabel(String label)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if label
is null
.public String getLabel()
null
if no label is currently defined.public RecordDef.Builder setDescription(String description)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if description
is null
.public String getDescription()
null
if no description is currently defined.public RecordDef.Builder addAttribute(Attribute attribute)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if attribute
is null
.public List getAttributes()
public RecordDef.Builder addField(FieldDef fieldDef)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if fieldDef
is null
.public List getFields()
public RecordDef.Builder modifyField(FieldModifier modifier)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if modifier
is null
.public List getModifiers()
public RecordDef.Builder setFactory(RecordFactory factory)
IllegalStateException
- if not building a definition.
IllegalArgumentException
- if factory
is null
.public RecordFactory getFactory()
null
if no factory is currently defined.public RecordDef makeRecordDef()
NOTE: This definition will be set as the default for the type. Also, if the type is derived its parent is set as the parent in the definition.
IllegalStateException
- if not building a definition.TypeDef.getDefault(Type)
,
Type.getParent()
public void clear()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |