Package com.ctc.wstx.util
Class ElementId
- java.lang.Object
-
- com.ctc.wstx.util.ElementId
-
public final class ElementId extends java.lang.ObjectSimple container Object used to store information about id attribute values, and references to such (as of yet undefined) values.Instances can be in one of 2 modes: either in fully defined mode, in which case information refers to location where value was defined (ie. we had id as a value of ID type attribute); or in undefined mode, in which case information refers to the first reference.
Note: this class is designed to be used with
ElementIdMap, and as a result has some information specifically needed by the map implementation (such as collision links).
-
-
Field Summary
Fields Modifier and Type Field Description private PrefixedNamemAttrNameName of the attribute that contains this id value (often "id", but need not be)private booleanmDefinedFlag that indicates whether this Object presents a defined id value (value of an ID attribute) or just a reference to one.private PrefixedNamemElemNameName of element for which this id refers.private java.lang.StringmIdValueActual id valueprivate javax.xml.stream.LocationmLocationLocation of either definition (ifmDefinedis true; or first reference (otherwise).private ElementIdmNextCollPointer to the next element within collision chain.private ElementIdmNextUndefined
-
Constructor Summary
Constructors Constructor Description ElementId(java.lang.String id, javax.xml.stream.Location loc, boolean defined, PrefixedName elemName, PrefixedName attrName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrefixedNamegetAttrName()PrefixedNamegetElemName()java.lang.StringgetId()javax.xml.stream.LocationgetLocation()booleanidMatches(char[] buf, int start, int len)booleanidMatches(java.lang.String idStr)booleanisDefined()protected voidlinkUndefined(ElementId undefined)voidmarkDefined(javax.xml.stream.Location defLoc)ElementIdnextColliding()ElementIdnextUndefined()protected voidsetNextColliding(ElementId nextColl)java.lang.StringtoString()
-
-
-
Field Detail
-
mDefined
private boolean mDefined
Flag that indicates whether this Object presents a defined id value (value of an ID attribute) or just a reference to one.
-
mIdValue
private final java.lang.String mIdValue
Actual id value
-
mLocation
private javax.xml.stream.Location mLocation
Location of either definition (ifmDefinedis true; or first reference (otherwise). Used when reporting errors; either a referenced id has not been defined, or there are multiple definitions of same id.
-
mElemName
private PrefixedName mElemName
Name of element for which this id refers.
-
mAttrName
private PrefixedName mAttrName
Name of the attribute that contains this id value (often "id", but need not be)
-
mNextUndefined
private ElementId mNextUndefined
-
mNextColl
private ElementId mNextColl
Pointer to the next element within collision chain.
-
-
Constructor Detail
-
ElementId
ElementId(java.lang.String id, javax.xml.stream.Location loc, boolean defined, PrefixedName elemName, PrefixedName attrName)
-
-
Method Detail
-
linkUndefined
protected void linkUndefined(ElementId undefined)
-
setNextColliding
protected void setNextColliding(ElementId nextColl)
-
getId
public java.lang.String getId()
-
getLocation
public javax.xml.stream.Location getLocation()
-
getElemName
public PrefixedName getElemName()
-
getAttrName
public PrefixedName getAttrName()
-
isDefined
public boolean isDefined()
-
idMatches
public boolean idMatches(char[] buf, int start, int len)
-
idMatches
public boolean idMatches(java.lang.String idStr)
-
nextUndefined
public ElementId nextUndefined()
-
nextColliding
public ElementId nextColliding()
-
markDefined
public void markDefined(javax.xml.stream.Location defLoc)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-