|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcwi.GraphXML.Elements.AttributeProperties
public class AttributeProperties
This class contains all the properties which are defined for a specific node as attributes and which are not explicitly used elsewhere. Examples are isDirected, preferredLayout, etc.
Which attributes are allowed and which are not is defined in the DTD, and the core parser should control that. This class simply collects all those properties and stores them in hash tables, so that the semantic part of the parser could use them.
There is a naming convention here: if an attribute is of the form "isXYZ", where "X" is a capital letter, then the value should be "true" or "false" and the value is stored as a Boolean. All other properties values are stored as strings.
Some attributes, defined in the DTD, have a semantic value which influences the way the parser works. Example is the "isMetanode" attribute for a node. These attributes are handled separately by the parser. This class includes a static array of strings which lists those attributes which are not handled by this class.
Field Summary | |
---|---|
static java.lang.String[] |
notHandledAttributes
|
Constructor Summary | |
---|---|
AttributeProperties()
|
Method Summary | |
---|---|
static AttributeProperties |
create(org.w3c.dom.Node node)
Create a new instance of attribute properties, extracting the attributes from the node. |
java.lang.Boolean |
deleteBooleanAttribute(java.lang.String key)
Delete a boolean attribute, if defined |
java.lang.String |
deleteStringAttribute(java.lang.String key)
Delete a String attribute, if defined |
java.lang.Boolean |
getBooleanAttribute(java.lang.String key)
Get a boolean attribute, if defined. |
java.util.Iterator |
getBooleanKeys()
Return an iterator for the boolean attributes |
java.lang.String |
getStringAttribute(java.lang.String key)
Get a string attribute, if defined. |
java.util.Iterator |
getStringKeys()
Return an iterator for the string attributes |
boolean |
isBooleanAttributeDefined(java.lang.String key)
|
boolean |
isEmpty()
Just a shorthand to see if there are attributes at all... |
boolean |
isStringAttributeDefined(java.lang.String key)
|
java.lang.String |
toString()
Overrides inherited method, good for debug... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] notHandledAttributes
Constructor Detail |
---|
public AttributeProperties()
Method Detail |
---|
public java.lang.Boolean getBooleanAttribute(java.lang.String key)
key
- attribute key
public java.lang.Boolean deleteBooleanAttribute(java.lang.String key)
key
- attribute key
public java.util.Iterator getBooleanKeys()
public boolean isBooleanAttributeDefined(java.lang.String key)
public java.lang.String getStringAttribute(java.lang.String key)
key
- attribute key
public java.lang.String deleteStringAttribute(java.lang.String key)
key
- attribute key
public java.util.Iterator getStringKeys()
public boolean isStringAttributeDefined(java.lang.String key)
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public static AttributeProperties create(org.w3c.dom.Node node)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |