public final class ElementId
extends java.lang.Object
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).
Modifier and Type | Field and Description |
---|---|
private PrefixedName |
mAttrName
Name of the attribute that contains this id value (often "id",
but need not be)
|
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.
|
private PrefixedName |
mElemName
Name of element for which this id refers.
|
private java.lang.String |
mIdValue
Actual id value
|
private javax.xml.stream.Location |
mLocation
Location of either definition (if
mDefined is true; or
first reference (otherwise). |
private ElementId |
mNextColl
Pointer to the next element within collision chain.
|
private ElementId |
mNextUndefined |
Constructor and Description |
---|
ElementId(java.lang.String id,
javax.xml.stream.Location loc,
boolean defined,
PrefixedName elemName,
PrefixedName attrName) |
Modifier and Type | Method and Description |
---|---|
PrefixedName |
getAttrName() |
PrefixedName |
getElemName() |
java.lang.String |
getId() |
javax.xml.stream.Location |
getLocation() |
boolean |
idMatches(char[] buf,
int start,
int len) |
boolean |
idMatches(java.lang.String idStr) |
boolean |
isDefined() |
protected void |
linkUndefined(ElementId undefined) |
void |
markDefined(javax.xml.stream.Location defLoc) |
ElementId |
nextColliding() |
ElementId |
nextUndefined() |
protected void |
setNextColliding(ElementId nextColl) |
java.lang.String |
toString() |
private boolean mDefined
private final java.lang.String mIdValue
private javax.xml.stream.Location mLocation
mDefined
is 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.private PrefixedName mElemName
private PrefixedName mAttrName
private ElementId mNextUndefined
private ElementId mNextColl
ElementId(java.lang.String id, javax.xml.stream.Location loc, boolean defined, PrefixedName elemName, PrefixedName attrName)
protected void linkUndefined(ElementId undefined)
protected void setNextColliding(ElementId nextColl)
public java.lang.String getId()
public javax.xml.stream.Location getLocation()
public PrefixedName getElemName()
public PrefixedName getAttrName()
public boolean isDefined()
public boolean idMatches(char[] buf, int start, int len)
public boolean idMatches(java.lang.String idStr)
public ElementId nextUndefined()
public ElementId nextColliding()
public void markDefined(javax.xml.stream.Location defLoc)
public java.lang.String toString()
toString
in class java.lang.Object