|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.descriptors.attributes.AbstractAttribute
This class exists to give a shared base class to Attribute and AttributePrototype.
Constructor Summary | |
AbstractAttribute()
|
Method Summary | |
abstract java.lang.Object |
clone()
Copies the attribute. |
AttributeValue |
getArchetype()
Gets the config value. |
AttributeValue |
getDefault()
A default value is what an attribute is set to when created. |
org.w3c.dom.Element |
getExtraConfigInXML(org.w3c.dom.Document root)
Gets the attribute-type-specific extended information, if it exists. |
java.lang.String |
getExtraConfigString()
Determines how to print it out to the old gtf format |
java.lang.String |
getName()
Returns the Attribute name. eg position, size, readability, etc. |
abstract java.lang.String |
getType()
Returns the Attribute type, eg lvalue or bbox . |
abstract org.w3c.dom.Element |
getXMLFormat(org.w3c.dom.Document root)
Returns an XML formatted version of this data. |
boolean |
isDynamic()
A dynamic attribute can change from frame to frame. |
static Measurable |
loadAttributeType(java.lang.String type)
Makes sure the java class for an attribute is loaded. |
boolean |
named(java.lang.String S)
Returns true if the Attribute is named S. |
boolean |
named(java.lang.String S,
Equivalencies map)
Returns true if the Attribute is named S or mapped to S under map. |
protected static int |
parseAnInt(org.w3c.dom.Element domEl,
java.lang.String name)
Gets the int value of an XML attribute of the given XML element. |
void |
resetDefault(AttributeValue o)
Modifies the attribute's default value. |
void |
setArchetype(AttributeValue archetype)
ExtraConfig information is information concerning the data that is not expressed in the type itself. |
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 abstract void |
setDefaultValue(org.w3c.dom.Element defaultValue)
|
protected abstract void |
setDefaultValue(java.lang.String defaultValue)
Some attributes may have a default value. |
protected void |
setDynamic(boolean dynamic)
Set this to allow the attribute to vary from frame to frame. |
protected void |
setName(java.lang.String name)
Sets the Attribute name. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractAttribute()
Method Detail |
public final java.lang.String getName()
protected void setName(java.lang.String name)
name
- The new name.public final boolean named(java.lang.String S)
S
- The name to test against.
true
if the Attribute is named S.public final boolean named(java.lang.String S, Equivalencies map)
S
- The name to test against.map
- The list of equivalcencies.
true
if the Attribute is named S or in the same
equivalency set.public abstract java.lang.String getType()
lvalue
or bbox
.
protected abstract void setDefaultValue(java.lang.String defaultValue) throws BadDataException, MethodNotSupportedException
Attributes.isGoodValue(viper.descriptors.attributes.Attribute, java.lang.String)
.
defaultValue
- What to set as the default.
BadDataException
- if Attributes.isGoodValue returns false
.
MethodNotSupportedException
protected abstract void setDefaultValue(org.w3c.dom.Element defaultValue) throws BadDataException, MethodNotSupportedException
BadDataException
MethodNotSupportedException
public final void resetDefault(AttributeValue o)
o
- the new default valuepublic final AttributeValue getDefault()
public final boolean isDynamic()
content
or file
Descriptors.protected void setDynamic(boolean dynamic)
dynamic
- The value.public abstract org.w3c.dom.Element getXMLFormat(org.w3c.dom.Document root)
root
- where to print the data.
public void setArchetype(AttributeValue archetype)
lvalue
type has a
list of possible values in its extra config info. It is maintained as a
Map. It is up to the implementation to decide what to do with the Map; it
is mostly used as a map for legacy reasons, and I will probably change it
to an Object soon enough.
archetype
- an example of the data typepublic AttributeValue getArchetype()
public void setArchetype(org.w3c.dom.Element E) throws BadDataException
E
- the description
BadDataException
public void setArchetype(java.lang.String S) throws BadDataException
S
- the description
BadDataException
public final java.lang.String getExtraConfigString()
public final org.w3c.dom.Element getExtraConfigInXML(org.w3c.dom.Document root)
null
, otherwise.
root
- the DOM root
null
public abstract java.lang.Object clone()
protected static int parseAnInt(org.w3c.dom.Element domEl, java.lang.String name) throws BadDataException
domEl
- the element to parse the attribute ofname
- the name of the attribute
BadDataException
public static Measurable loadAttributeType(java.lang.String type) throws java.lang.ClassCastException
type
- the type to load
java.lang.ClassCastException
- if the type is not found
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |