org.xbrlapi.xlink
Class ElementState
java.lang.Object
org.xbrlapi.xlink.ElementState
public class ElementState
- extends Object
Assists in the tracking of document state information
during SAX parsing, retaining the necessary information
to construct all element scheme XPointer expressions
that can be used to identify each element in a document.
The state is started again when a new document is started.
As each new element is parsed in, a new element state is created,
wrapping the parent element's state as a property.
The state keeps track of ancestor element states, the id of the current
element, if any, and the order which is set equal to the number of children
so far for the parent element state.
- Author:
- Geoff Shuetrim (geoff@galexy.net)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementState
public ElementState(ElementState parent,
Attributes attrs)
- Parameters:
parent - The state of the parent elementattrs - The attributes of the element (make sure that these are a clone of the
originals received by the SAX parser or the state will get really messed up
and confusing.
Use the org.xml.sax.helpers.AttributesImpl(Attributes) constructor to clone the
originals.
getAttributes
public Attributes getAttributes()
- Returns:
- the attributes of the element.
hasParent
public boolean hasParent()
getParent
public ElementState getParent()
addChild
public void addChild()
getChildrenSoFar
public long getChildrenSoFar()
getId
public String getId()
setId
public void setId(String id)
hasId
public boolean hasId()
getElementSchemePointers
public Vector<String> getElementSchemePointers()
getLanguageCode
public String getLanguageCode()
throws XBRLException
- Returns:
- the inherited XML lang attribute value based upon the
current element state or returns null if there is no inherited XML lang
attribute value.
- Throws:
XBRLException