|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.descriptors.attributes.AbstractAttribute viper.descriptors.attributes.AttributePrototype
This class is used as a factory for Attribute
data.
Constructor Summary | |
AttributePrototype(AbstractAttribute old)
Default copy constructor. |
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this Attribute. |
Attribute |
create()
Create a new attribute using this Prototype as a template. |
Attribute |
create(Attribute old)
Create a new attribute of the specified type using its constructor that takes an Attribute value (copy-constructor?). |
static AttributePrototype |
createAttributePrototype(java.lang.String type,
java.lang.String name,
boolean dynamic)
Creates a new attribute configuration. |
java.lang.String |
getLocalType()
Gets the local part of the type name. |
java.lang.String |
getType()
Returns the Attribute type, eg lvalue or
bbox . |
org.w3c.dom.Element |
getXMLFormat(org.w3c.dom.Document root)
Returns the format properly for config information. |
static AttributePrototype |
parseAttributeConfig(org.w3c.dom.Element reader,
boolean dynamic)
Reads in the attribute prototype from the XML DOM node. |
static AttributePrototype |
parseAttributeConfig(VReader reader,
boolean mobile)
Parses an Attribute configuration line. |
void |
setArchetype(org.w3c.dom.Element E)
Sets the archetype associated with this descriptor. |
void |
setArchetype(java.lang.String S)
Sets the archetype associated with this descriptor. |
protected void |
setDefaultValue(org.w3c.dom.Element defaultValue)
|
protected void |
setDefaultValue(java.lang.String defaultValue)
Some attributes may have a default value. |
void |
setDynamic(boolean dynamic)
Set this to allow the attribute to vary from frame to frame. |
void |
setName(java.lang.String name)
Sets the Attribute name. |
void |
setType(java.lang.String type)
Sets the attribute type. |
java.lang.String |
toString()
Gets the string representation of static Attribute data or an individual frame of static data. |
java.lang.String |
toString(boolean verbose,
boolean endln)
Gets the string representation of static Attribute data or an individual frame of static data. |
Methods inherited from class viper.descriptors.attributes.AbstractAttribute |
getArchetype, getDefault, getExtraConfigInXML, getExtraConfigString, getName, isDynamic, loadAttributeType, named, named, parseAnInt, resetDefault, setArchetype |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AttributePrototype(AbstractAttribute old)
old
- the value to copyMethod Detail |
public java.lang.String getType()
lvalue
or
bbox
.
getType
in class AbstractAttribute
public java.lang.String getLocalType()
public void setType(java.lang.String type) throws BadDataException
type
- The new type.
BadDataException
- if Attributes.isType returns
false
.public void setName(java.lang.String name)
setName
in class AbstractAttribute
name
- The new name.public void setDynamic(boolean dynamic)
setDynamic
in class AbstractAttribute
dynamic
- The value.public java.lang.Object clone()
clone
in class AbstractAttribute
public org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
getXMLFormat
in class AbstractAttribute
root
- the document to use when creating the element
public java.lang.String toString()
toString( true, true )
.
String
in gtf format for parsingpublic java.lang.String toString(boolean verbose, boolean endln)
verbose
- set to include ending [static] for static
attributesendln
- set to include an endln
public static AttributePrototype createAttributePrototype(java.lang.String type, java.lang.String name, boolean dynamic) throws BadDataException
type
- the data type of the attributename
- the name to give the attributedynamic
- if the attribute may vary with the frame number
BadDataException
public static AttributePrototype parseAttributeConfig(org.w3c.dom.Element reader, boolean dynamic) throws BadDataException
reader
- the element to read indynamic
- if the attribute may be dynamic
BadDataException
public static AttributePrototype parseAttributeConfig(VReader reader, boolean mobile) throws BadDataException
reader
- the VReader pointing at the line to be parsedmobile
- set true if this is an OBJECT Descriptor
BadDataException
public Attribute create()
java.lang.IllegalArgumentException
- if the attribute is not validpublic Attribute create(Attribute old) throws BadDataException
old
- the attribute prototype or another copy of the
same attribute type
BadDataException
protected void setDefaultValue(java.lang.String defaultValue) throws BadDataException
Attributes.isGoodValue(Attribute,String)
.
setDefaultValue
in class AbstractAttribute
defaultValue
- What to set as the default.
BadDataException
- if Attributes.isGoodValue returns
false
.protected void setDefaultValue(org.w3c.dom.Element defaultValue) throws BadDataException
setDefaultValue
in class AbstractAttribute
BadDataException
public void setArchetype(org.w3c.dom.Element E) throws BadDataException
AbstractAttribute
setArchetype
in class AbstractAttribute
E
- the description
BadDataException
public void setArchetype(java.lang.String S) throws BadDataException
AbstractAttribute
setArchetype
in class AbstractAttribute
S
- the description
BadDataException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |