org.activemath.omdocjdom
Class OJReferenceAttribute

java.lang.Object
  extended by org.jdom.Attribute
      extended by org.activemath.omdocjdom.OJReferenceAttribute
All Implemented Interfaces:
Serializable, Cloneable

public class OJReferenceAttribute
extends org.jdom.Attribute

An attribute meant to contain a pointer value. Such objects contain the necessary tools to take advantage of the ID class from within an attribute. It is used in such attributes as <ref xref= or item for=.

Version:
See Also:
Serialized Form

Field Summary
protected  ID pointerID
          The ID value underneath, may be null until it is computed using computeID().
 
Fields inherited from class org.jdom.Attribute
CDATA_TYPE, ENTITIES_TYPE, ENTITY_TYPE, ENUMERATED_TYPE, ID_TYPE, IDREF_TYPE, IDREFS_TYPE, name, namespace, NMTOKEN_TYPE, NMTOKENS_TYPE, NOTATION_TYPE, parent, type, UNDECLARED_TYPE, value
 
Constructor Summary
OJReferenceAttribute(String attName, ID pointer)
          This constructor creates an attribute within the OJConstants.OMDOC_NAMESPACE.
OJReferenceAttribute(String attName, ID pointer, org.jdom.Namespace ns)
          This constructor keeps the value null computing it only when requested.
OJReferenceAttribute(String attName, String pointerString, org.jdom.Namespace namespace)
          This constructor sets the value and builds the ID only if necessary.
 
Method Summary
protected  void computeID()
          Computes the ID object supposing it is given by the Attribute.value.
protected  void computeValue()
          Computes the value supposing pointerID is not null using ID.expressShortestRef(org.activemath.omdocjdom.OJElement, org.activemath.omdocjdom.OJElement).
 String getValue()
           
 org.jdom.Attribute setValue(String value)
           
 
Methods inherited from class org.jdom.Attribute
clone, detach, equals, getAttributeType, getBooleanValue, getDocument, getDoubleValue, getFloatValue, getIntValue, getLongValue, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getParent, getQualifiedName, hashCode, setAttributeType, setName, setNamespace, setParent, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

pointerID

protected ID pointerID
The ID value underneath, may be null until it is computed using computeID().

Constructor Detail

OJReferenceAttribute

public OJReferenceAttribute(String attName,
                            ID pointer,
                            org.jdom.Namespace ns)
This constructor keeps the value null computing it only when requested.


OJReferenceAttribute

public OJReferenceAttribute(String attName,
                            String pointerString,
                            org.jdom.Namespace namespace)
This constructor sets the value and builds the ID only if necessary.


OJReferenceAttribute

public OJReferenceAttribute(String attName,
                            ID pointer)
This constructor creates an attribute within the OJConstants.OMDOC_NAMESPACE.

Method Detail

computeID

protected void computeID()
Computes the ID object supposing it is given by the Attribute.value.


computeValue

protected void computeValue()
Computes the value supposing pointerID is not null using ID.expressShortestRef(org.activemath.omdocjdom.OJElement, org.activemath.omdocjdom.OJElement).


getValue

public String getValue()
Overrides:
getValue in class org.jdom.Attribute

setValue

public org.jdom.Attribute setValue(String value)
Overrides:
setValue in class org.jdom.Attribute