Top Description Fields Constructors Methods
com.ctc.wstx.util

public final Class ElementId

extends Object
Class Inheritance
Imports
javax.xml.stream.Location, com.ctc.wstx.cfg.ErrorConsts

Simple 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

Modifier and TypeField 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 final String
mIdValue

Actual id value

private 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

Constructor Summary

AccessConstructor and Description
pack-priv
ElementId(String id, Location loc, boolean defined, PrefixedName elemName, PrefixedName attrName)

Method Summary

Modifier and TypeMethod and Description
public PrefixedName
public PrefixedName
public String
public Location
public boolean
idMatches(char[] buf, int start, int len)

public boolean
public boolean
protected void
public void
public ElementId
public ElementId
protected void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

mAttrNameback to summary
private PrefixedName mAttrName

Name of the attribute that contains this id value (often "id", but need not be)

mDefinedback to summary
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.

mElemNameback to summary
private PrefixedName mElemName

Name of element for which this id refers.

mIdValueback to summary
private final String mIdValue

Actual id value

mLocationback to summary
private Location mLocation

Location of either definition (if 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.

mNextCollback to summary
private ElementId mNextColl

Pointer to the next element within collision chain.

mNextUndefinedback to summary
private ElementId mNextUndefined

Constructor Detail

ElementIdback to summary
pack-priv ElementId(String id, Location loc, boolean defined, PrefixedName elemName, PrefixedName attrName)

Method Detail

getAttrNameback to summary
public PrefixedName getAttrName()
getElemNameback to summary
public PrefixedName getElemName()
getIdback to summary
public String getId()
getLocationback to summary
public Location getLocation()
idMatchesback to summary
public boolean idMatches(char[] buf, int start, int len)
idMatchesback to summary
public boolean idMatches(String idStr)
isDefinedback to summary
public boolean isDefined()
linkUndefinedback to summary
protected void linkUndefined(ElementId undefined)
markDefinedback to summary
public void markDefined(Location defLoc)
nextCollidingback to summary
public ElementId nextColliding()
nextUndefinedback to summary
public ElementId nextUndefined()
setNextCollidingback to summary
protected void setNextColliding(ElementId nextColl)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override