|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--step.typedef.TypeDef
A definition for a STEP type.
Types have a default definition, however some fields may choose to use an alternate, context-sensitive version of the definition.
FieldDef.getAltTypeDef()
Constructor Summary | |
TypeDef(String name,
Package pkg,
List fieldDefs,
List modifiers)
|
Method Summary | |
protected void |
applyModifiers()
Apply the list of modifiers to the various fields of this definition. |
Object |
clone()
Get a copy (clone) of this definition. |
void |
dump(int level)
|
static TypeDef |
getDefault(StepObject o)
Get the default (prototype) definition for the type of the given object. |
static TypeDef |
getDefault(String typeName)
Get the default (prototype) definition for the given type name. |
static TypeDef |
getDefault(Type type)
Get the default (prototype) definition for the given type. |
FieldDef |
getField(String fieldName)
Get the field definition for the field with the given name. |
List |
getFields()
Get the list of field definitions associated with this definition. |
String |
getFullName()
Get the fully-qualified name for the type represented by this definition. |
List |
getModifiers()
Get the list of field modifiers associated with this definition. |
String |
getName()
Get the short name for the type represented by this definition. |
Package |
getPackage()
Get the package that contains the type represented by this definition. |
Type |
getType()
Get the type that this definition is associated with. |
static boolean |
isDefined(StepObject o)
Does the given type have a default definition set? |
static boolean |
isDefined(String typeName)
Does the given type have a default definition set? |
static boolean |
isDefined(Type type)
Does the given type have a default definition set? |
boolean |
isResolved()
Is this definition complete? |
boolean |
isTypeResolved()
Is the type information for this definition complete? |
static TypeDef |
merge(TypeDef lowDef,
TypeDef highDef)
Combine two definitions into one. |
void |
resolve()
Execute all operations needed to complete this definition. |
protected void |
resolveType()
Complete the type information for this definition. |
void |
setAsDefault()
Set this definition as the default (prototype) definition for all objects of this type. |
protected void |
setFields(List fieldDefs)
Replace the current list of field definitions. |
protected void |
setModifiers(List modifiers)
Replace the current list of field modifiers. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TypeDef(String name, Package pkg, List fieldDefs, List modifiers)
ClassCastException
- if
FieldDef
element
FieldModifier
element
Method Detail |
public static boolean isDefined(StepObject o)
setAsDefault()
public static TypeDef getDefault(StepObject o)
getDefault(Type)
public static boolean isDefined(String typeName)
setAsDefault()
public static TypeDef getDefault(String typeName)
getDefault(Type)
public static boolean isDefined(Type type)
setAsDefault()
public static TypeDef getDefault(Type type)
null
if no default exists for the type.
RecordDefNotFoundException
- if the type does not have a default
definition and one cannot be loaded from the current environment.setAsDefault()
public void setAsDefault()
public String getName()
getFullName()
public String getFullName()
getName()
,
Package.qualify(String)
public Package getPackage()
public Type getType()
Type.v(String,Package)
public List getFields()
The list returned is unmodifiable.
protected void setFields(List fieldDefs)
ClassCastException
- if an element of the list is not a FieldDef
.public FieldDef getField(String fieldName)
null
if no field is defined with the given name.public List getModifiers()
The list returned is unmodifiable.
protected void setModifiers(List modifiers)
ClassCastException
- if an element of the list is not a FieldModifier
.public boolean isTypeResolved()
resolveType()
,
isResolved()
protected void resolveType()
NOTE: Clients of this object can invoke this method indirectly via
resolve()
.
ResolveException
- if a field has an undefined type.public boolean isResolved()
In general, a type definition is complete (resolved) when all inherited information has been incorporated, the existence of field types have been verified, and the field modifiers have been applied.
resolve()
public void resolve()
By default, a type definition is completed when the type information is resolved and the field modifiers have been applied.
resolveType()
,
applyModifiers()
protected void applyModifiers()
NOTE: Clients of this object can invoke this method indirectly via
resolve()
.
ResolveException
- if
public static TypeDef merge(TypeDef lowDef, TypeDef highDef)
RecordEncoder
s to handle the
encoding of sub-types.
FieldDef.merge(FieldDef,FieldDef)
public Object clone()
clone
in class Object
public void dump(int level)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |