Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.util

public Class XMLAttributesImpl

extends Object
implements XMLAttributes, XMLBufferListener
Class Inheritance
All Implemented Interfaces
com.sun.xml.internal.stream.XMLBufferListener, com.sun.org.apache.xerces.internal.xni.XMLAttributes
Known Direct Subclasses
com.sun.org.apache.xerces.internal.util.XMLAttributesIteratorImpl
Imports
com.sun.xml.internal.stream.XMLBufferListener, com.sun.org.apache.xerces.internal.xni.Augmentations, .QName, .XMLAttributes, .XMLString

The XMLAttributesImpl class is an implementation of the XMLAttributes interface which defines a collection of attributes for an element. In the parser, the document source would scan the entire start element and collect the attributes. The attributes are communicated to the document handler in the startElement method.

The attributes are read-write so that subsequent stages in the document pipeline can modify the values or change the attributes that are propogated to the next stage.

Authors
Andy Clark, IBM, Elena Litani, IBM, Michael Glavassevich, IBM
See Also
com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler#startElement

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
XMLAttributesImpl.Attribute

Attribute information.

Field Summary

Modifier and TypeField and Description
protected XMLAttributesImpl.Attribute[]
fAttributes

Attribute information.

protected XMLAttributesImpl.Attribute[]
fAttributeTableView

Provides an alternate view of the attribute specification.

protected int[]
fAttributeTableViewChainState

Tracks whether each chain in the hash table is stale with respect to the current state of this object.

protected int[]
fHashMultipliers

Array of randomly selected hash function multipliers or null if the default String.hashCode() function should be used.

protected boolean
fIsTableViewConsistent

Indicates whether the table view contains consistent data.

protected int
fLargeCount

Usage count for the attribute table view.

protected int
fLength

Attribute count.

protected boolean
fNamespaces

Namespaces.

protected int
fTableViewBuckets

Actual number of buckets in the table view.

protected static final int
MAX_HASH_COLLISIONS

Maximum hash collisions per bucket.

protected static final int
protected static final int
protected static final int
SIZE_LIMIT

Threshold at which an instance is treated as a large attribute list.

protected static final int
TABLE_SIZE

Default table size.

Constructor Summary

AccessConstructor and Description
public
XMLAttributesImpl()

Default constructor.

public
XMLAttributesImpl(int
initial size of table view
tableSize
)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Returns the attribute index.
addAttribute
(QName
The attribute name.
name
,
String
The attribute type. The type name is determined by the type specified for this attribute in the DTD. For example: "CDATA", "ID", "NMTOKEN", etc. However, attributes of type enumeration will have the type value specified as the pipe ('|') separated list of the enumeration values prefixed by an open parenthesis and suffixed by a close parenthesis. For example: "(true|false)".
type
,
String
The attribute value.
value
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.addAttribute.

Adds an attribute.
public int
addAttribute(QName name, String type, String value, XMLString valueCache)

public void
addAttributeNS(QName
the attribute name
name
,
String
the attribute type
type
,
String
the attribute value
value
)

Adds an attribute.

public QName

Returns:

the name of a duplicate attribute found in the search, otherwise null.
checkDuplicatesNS
()

Checks for duplicate expanded names (local part and namespace name pairs) in the attribute specification.

private QName
protected void
cleanTableView()

Purges all elements from the table view.

public Augmentations

Returns:

Augmentations
getAugmentations
(String
The Namespace URI, or null if the
uri
,
String
The local name of the attribute.
localName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentations by Namespace name.
public Augmentations

Returns:

Augmentations
getAugmentations
(String
The XML 1.0 qualified name.
qName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentation by XML 1.0 qualified name.
public Augmentations

Returns:

Augmentations
getAugmentations
(int
The attribute index.
attributeIndex
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentations by attributes index.
public int

Returns:

The index of the attribute, or -1 if it does not appear in the list.
getIndex
(String
The qualified (prefixed) name.
qName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getIndex.

Look up the index of an attribute by XML 1.0 qualified name.
public int

Returns:

The index of the attribute, or -1 if it does not appear in the list.
getIndex
(String
The Namespace URI, or null if the name has no Namespace URI.
uri
,
String
The attribute's local name.
localPart
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getIndex.

Look up the index of an attribute by Namespace name.
public int

Returns:

The index of the attribute, or -1 if it does not appear in the list.
getIndexByLocalName
(String
The attribute's local name.
localPart
)

Look up the index of an attribute by local name only, ignoring its namespace.

public int

Returns:

The index of the attribute, or -1 if it does not appear in the list.
getIndexFast
(String
The qualified (prefixed) name.
qName
)

Look up the index of an attribute by XML 1.0 qualified name.

public int

Returns:

The index of the attribute, or -1 if it does not appear in the list.
getIndexFast
(String
The Namespace URI, or null if the name has no Namespace URI.
uri
,
String
The attribute's local name.
localPart
)

Look up the index of an attribute by Namespace name.

public int

Returns:

The number of attributes in the list.
getLength
()

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getLength.

Return the number of attributes in the list.
public String

Returns:

The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.
getLocalName
(int
The attribute index (zero-based).
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getLocalName.

Look up an attribute's local name by index.
public void
getName(int
The attribute index.
attrIndex
,
QName
The attribute name structure to fill in.
attrName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getName.

Sets the fields in the given QName structure with the values of the attribute name at the specified index.
public String

Returns:

The name of the indexed attribute, or null if the index is out of range.
getName
(int
The index of the attribute in the list (starting at 0).
index
)

Return the name of an attribute in this list (by position).

public String
getNonNormalizedValue(int
The attribute index.
attrIndex
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getNonNormalizedValue.

Returns the non-normalized value of the attribute at the specified index.
public String
getPrefix(int
The index of the attribute.
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getPrefix.

Returns the prefix of the attribute at the specified index.
public String

Returns:

The XML 1.0 qualified name, or the empty string if none is available, or null if the index is out of range.
getQName
(int
The attribute index (zero-based).
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getQName.

Look up an attribute's XML 1.0 qualified name by index.
public QName
private String

Returns:

the value passed in or NMTOKEN if it's an enumerated type.
getReportableType
(String
attribute type
type
)

Returns the value passed in or NMTOKEN if it's an enumerated type.

protected int

Returns:

the position in the table view where the given attribute would be hashed
getTableViewBucket
(String
the attribute name
qname
)

Returns the position in the table view where the given attribute name would be hashed.

protected int

Returns:

the position in the table view where the given attribute would be hashed
getTableViewBucket
(String
the local part of the attribute
localpart
,
String
the namespace name of the attribute
uri
)

Returns the position in the table view where the given attribute name would be hashed.

public String

Returns:

The attribute's type as a string, or null if the index is out of range.
getType
(int
The attribute index (zero-based).
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by index.
public String

Returns:

The attribute type as a string, or null if the attribute is not in the list or if qualified names are not available.
getType
(String
The XML 1.0 qualified name.
qname
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by XML 1.0 qualified name.
public String

Returns:

The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed.
getType
(String
The Namespace URI, or null if the name has no Namespace URI.
uri
,
String
The local name of the attribute.
localName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by Namespace name.
public String

Returns:

The Namespace URI
getURI
(int
The attribute index (zero-based).
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getURI.

Look up an attribute's Namespace URI by index.
public String

Returns:

The attribute's value as a string, or null if the index is out of range.
getValue
(int
The attribute index (zero-based).
index
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by index.
public String

Returns:

The attribute value as a string, or null if the attribute is not in the list or if qualified names are not available.
getValue
(String
The XML 1.0 qualified name.
qname
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by XML 1.0 qualified name.
public String

Returns:

The attribute value as a string, or null if the attribute is not in the list.
getValue
(String
The Namespace URI, or null namespaces are ignored.
uri
,
String
The local name of the attribute.
localName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by Namespace name and Local name.
private void
growTableView()

Increases the capacity of the table view.

private int
hash(String localpart)

private int
hash(String localpart, String uri)

private int
hash0(String symbol)

public boolean
isSpecified(int
The attribute index.
attrIndex
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.isSpecified.

Returns true if the attribute is specified in the instance document.
protected void
prepareAndPopulateTableView()

Prepares the table view of the attributes list for use, and populates it with the attributes which have been previously read.

private void
prepareAndPopulateTableView(final int count)

private void
protected void
prepareTableView()

Prepares the table view of the attributes list for use.

private void
rebalanceTableView(final int count)

Randomly selects a new hash function and reorganizes the table view in order to more evenly distribute its entries.

private void
rebalanceTableViewNS(final int count)

Randomly selects a new hash function and reorganizes the table view in order to more evenly distribute its entries.

public void
refresh()

Implements com.sun.xml.internal.stream.XMLBufferListener.refresh.

This method will be invoked by XMLEntityReader before ScannedEntities buffer is reloaded.
public void
refresh(int pos)

Implements com.sun.xml.internal.stream.XMLBufferListener.refresh.

receives callbacks from XMLEntityReader when buffer is being changed.
public void
public void
removeAttributeAt(int
The attribute index.
attrIndex
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.removeAttributeAt.

Removes the attribute at the specified index.
public void
setAugmentations(int
The attribute index.
attrIndex
,
Augmentations
The augmentations.
augs
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setAugmentations.

Sets the augmentations of the attribute at the specified index.
public void
setName(int
The attribute index.
attrIndex
,
QName
The new attribute name.
attrName
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setName.

Sets the name of the attribute at the specified index.
public void
setNamespaces(boolean
True if namespace processing is turned on.
namespaces
)

Sets whether namespace processing is being performed.

public void
setNonNormalizedValue(int
The attribute index.
attrIndex
,
String
The new non-normalized attribute value.
attrValue
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setNonNormalizedValue.

Sets the non-normalized value of the attribute at the specified index.
public void
setSpecified(int
The attribute index.
attrIndex
,
boolean
True if the attribute is specified in the instance document.
specified
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setSpecified.

Sets whether an attribute is specified in the instance document or not.
public void
setType(int
The attribute index.
attrIndex
,
String
The attribute type. The type name is determined by the type specified for this attribute in the DTD. For example: "CDATA", "ID", "NMTOKEN", etc. However, attributes of type enumeration will have the type value specified as the pipe ('|') separated list of the enumeration values prefixed by an open parenthesis and suffixed by a close parenthesis. For example: "(true|false)".
attrType
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setType.

Sets the type of the attribute at the specified index.
public void
setURI(int
The attribute index.
attrIndex
,
String
Namespace uri
uri
)

Sets the uri of the attribute at the specified index.

public void
setValue(int
The attribute index.
attrIndex
,
String
The new attribute value.
attrValue
)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setValue.

Sets the value of the attribute at the specified index.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fAttributesback to summary
protected XMLAttributesImpl.Attribute[] fAttributes

Attribute information.

fAttributeTableViewback to summary
protected XMLAttributesImpl.Attribute[] fAttributeTableView

Provides an alternate view of the attribute specification.

fAttributeTableViewChainStateback to summary
protected int[] fAttributeTableViewChainState

Tracks whether each chain in the hash table is stale with respect to the current state of this object. A chain is stale if its state is not the same as the number of times the attribute table view has been used.

fHashMultipliersback to summary
protected int[] fHashMultipliers

Array of randomly selected hash function multipliers or null if the default String.hashCode() function should be used.

fIsTableViewConsistentback to summary
protected boolean fIsTableViewConsistent

Indicates whether the table view contains consistent data.

fLargeCountback to summary
protected int fLargeCount

Usage count for the attribute table view. Incremented each time all attributes are removed when the attribute table view is in use.

fLengthback to summary
protected int fLength

Attribute count.

fNamespacesback to summary
protected boolean fNamespaces

Namespaces.

fTableViewBucketsback to summary
protected int fTableViewBuckets

Actual number of buckets in the table view.

MAX_HASH_COLLISIONSback to summary
protected static final int MAX_HASH_COLLISIONS

Maximum hash collisions per bucket.

MULTIPLIERS_MASKback to summary
protected static final int MULTIPLIERS_MASK
MULTIPLIERS_SIZEback to summary
protected static final int MULTIPLIERS_SIZE
SIZE_LIMITback to summary
protected static final int SIZE_LIMIT

Threshold at which an instance is treated as a large attribute list.

TABLE_SIZEback to summary
protected static final int TABLE_SIZE

Default table size.

Constructor Detail

XMLAttributesImplback to summary
public XMLAttributesImpl()

Default constructor.

XMLAttributesImplback to summary
public XMLAttributesImpl(int tableSize)
Parameters
tableSize:int

initial size of table view

Method Detail

addAttributeback to summary
public int addAttribute(QName name, String type, String value)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.addAttribute.

Adds an attribute. The attribute's non-normalized value of the attribute will have the same value as the attribute value until set using the setNonNormalizedValue method. Also, the added attribute will be marked as specified in the XML instance document unless set otherwise using the setSpecified method.

Note

If an attribute of the same name already exists, the old values for the attribute are replaced by the new values.

Parameters
name:QName

The attribute name.

type:String

The attribute type. The type name is determined by the type specified for this attribute in the DTD. For example: "CDATA", "ID", "NMTOKEN", etc. However, attributes of type enumeration will have the type value specified as the pipe ('|') separated list of the enumeration values prefixed by an open parenthesis and suffixed by a close parenthesis. For example: "(true|false)".

value:String

The attribute value.

Returns:int

Returns the attribute index.

See Also
setNonNormalizedValue, setSpecified
addAttributeback to summary
public int addAttribute(QName name, String type, String value, XMLString valueCache)
addAttributeNSback to summary
public void addAttributeNS(QName name, String type, String value)

Adds an attribute. The attribute's non-normalized value of the attribute will have the same value as the attribute value until set using the setNonNormalizedValue method. Also, the added attribute will be marked as specified in the XML instance document unless set otherwise using the setSpecified method.

This method differs from addAttribute in that it does not check if an attribute of the same name already exists in the list before adding it. In order to improve performance of namespace processing, this method allows uniqueness checks to be deferred until all the namespace information is available after the entire attribute specification has been read.

Caution

If this method is called it should not be mixed with calls to addAttribute unless it has been determined that all the attribute names are unique.

Parameters
name:QName

the attribute name

type:String

the attribute type

value:String

the attribute value

See Also
setNonNormalizedValue, setSpecified, checkDuplicatesNS
checkDuplicatesNSback to summary
public QName checkDuplicatesNS()

Checks for duplicate expanded names (local part and namespace name pairs) in the attribute specification. If a duplicate is found its name is returned.

This should be called once all the in-scope namespaces for the element enclosing these attributes is known, and after all the attributes have gone through namespace binding.

Returns:QName

the name of a duplicate attribute found in the search, otherwise null.

checkManyDuplicatesNSback to summary
private QName checkManyDuplicatesNS()
cleanTableViewback to summary
protected void cleanTableView()

Purges all elements from the table view.

getAugmentationsback to summary
public Augmentations getAugmentations(String uri, String localName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentations by Namespace name.

Parameters
uri:String

The Namespace URI, or null if the

localName:String

The local name of the attribute.

Returns:Augmentations

Augmentations

getAugmentationsback to summary
public Augmentations getAugmentations(String qName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentation by XML 1.0 qualified name.

Parameters
qName:String

The XML 1.0 qualified name.

Returns:Augmentations

Augmentations

getAugmentationsback to summary
public Augmentations getAugmentations(int attributeIndex)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getAugmentations.

Look up an augmentations by attributes index.

Parameters
attributeIndex:int

The attribute index.

Returns:Augmentations

Augmentations

getIndexback to summary
public int getIndex(String qName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getIndex.

Look up the index of an attribute by XML 1.0 qualified name.

Parameters
qName:String

The qualified (prefixed) name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getIndexback to summary
public int getIndex(String uri, String localPart)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getIndex.

Look up the index of an attribute by Namespace name.

Parameters
uri:String

The Namespace URI, or null if the name has no Namespace URI.

localPart:String

The attribute's local name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getIndexByLocalNameback to summary
public int getIndexByLocalName(String localPart)

Look up the index of an attribute by local name only, ignoring its namespace.

Parameters
localPart:String

The attribute's local name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getIndexFastback to summary
public int getIndexFast(String qName)

Look up the index of an attribute by XML 1.0 qualified name.

Note

This method uses reference comparison, and thus should only be used internally. We cannot use this method in any code exposed to users as they may not pass in unique strings.

Parameters
qName:String

The qualified (prefixed) name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getIndexFastback to summary
public int getIndexFast(String uri, String localPart)

Look up the index of an attribute by Namespace name.

Note

This method uses reference comparison, and thus should only be used internally. We cannot use this method in any code exposed to users as they may not pass in unique strings.

Parameters
uri:String

The Namespace URI, or null if the name has no Namespace URI.

localPart:String

The attribute's local name.

Returns:int

The index of the attribute, or -1 if it does not appear in the list.

getLengthback to summary
public int getLength()

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getLength.

Return the number of attributes in the list.

Once you know the number of attributes, you can iterate through the list.

Returns:int

The number of attributes in the list.

getLocalNameback to summary
public String getLocalName(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getLocalName.

Look up an attribute's local name by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.

See Also
getLength
getNameback to summary
public void getName(int attrIndex, QName attrName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getName.

Sets the fields in the given QName structure with the values of the attribute name at the specified index.

Parameters
attrIndex:int

The attribute index.

attrName:QName

The attribute name structure to fill in.

getNameback to summary
public String getName(int index)

Return the name of an attribute in this list (by position).

The names must be unique: the SAX parser shall not include the same attribute twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.

If the attribute name has a namespace prefix, the prefix will still be attached.

Parameters
index:int

The index of the attribute in the list (starting at 0).

Returns:String

The name of the indexed attribute, or null if the index is out of range.

See Also
getLength
getNonNormalizedValueback to summary
public String getNonNormalizedValue(int attrIndex)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getNonNormalizedValue.

Returns the non-normalized value of the attribute at the specified index. If no non-normalized value is set, this method will return the same value as the getValue(int) method.

Parameters
attrIndex:int

The attribute index.

getPrefixback to summary
public String getPrefix(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getPrefix.

Returns the prefix of the attribute at the specified index.

Parameters
index:int

The index of the attribute.

getQNameback to summary
public String getQName(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getQName.

Look up an attribute's XML 1.0 qualified name by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The XML 1.0 qualified name, or the empty string if none is available, or null if the index is out of range.

See Also
getLength
getQualifiedNameback to summary
public QName getQualifiedName(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getQualifiedName.

getReportableTypeback to summary
private String getReportableType(String type)

Returns the value passed in or NMTOKEN if it's an enumerated type.

Parameters
type:String

attribute type

Returns:String

the value passed in or NMTOKEN if it's an enumerated type.

getTableViewBucketback to summary
protected int getTableViewBucket(String qname)

Returns the position in the table view where the given attribute name would be hashed.

Parameters
qname:String

the attribute name

Returns:int

the position in the table view where the given attribute would be hashed

getTableViewBucketback to summary
protected int getTableViewBucket(String localpart, String uri)

Returns the position in the table view where the given attribute name would be hashed.

Parameters
localpart:String

the local part of the attribute

uri:String

the namespace name of the attribute

Returns:int

the position in the table view where the given attribute would be hashed

getTypeback to summary
public String getType(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by index.

The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).

If the parser has not read a declaration for the attribute, or if the parser does not report attribute types, then it must return the value "CDATA" as stated in the XML 1.0 Recommentation (clause 3.3.3, "Attribute-Value Normalization").

For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".

Parameters
index:int

The attribute index (zero-based).

Returns:String

The attribute's type as a string, or null if the index is out of range.

See Also
getLength
getTypeback to summary
public String getType(String qname)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by XML 1.0 qualified name.

See getType(int) for a description of the possible types.

Parameters
qname:String

The XML 1.0 qualified name.

Returns:String

The attribute type as a string, or null if the attribute is not in the list or if qualified names are not available.

getTypeback to summary
public String getType(String uri, String localName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getType.

Look up an attribute's type by Namespace name.

See getType(int) for a description of the possible types.

Parameters
uri:String

The Namespace URI, or null if the name has no Namespace URI.

localName:String

The local name of the attribute.

Returns:String

The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed.

getURIback to summary
public String getURI(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getURI.

Look up an attribute's Namespace URI by index.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The Namespace URI

See Also
getLength
getValueback to summary
public String getValue(int index)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by index.

If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string with each token separated by a single space.

Parameters
index:int

The attribute index (zero-based).

Returns:String

The attribute's value as a string, or null if the index is out of range.

See Also
getLength
getValueback to summary
public String getValue(String qname)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by XML 1.0 qualified name.

See getValue(int) for a description of the possible values.

Parameters
qname:String

The XML 1.0 qualified name.

Returns:String

The attribute value as a string, or null if the attribute is not in the list or if qualified names are not available.

getValueback to summary
public String getValue(String uri, String localName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.getValue.

Look up an attribute's value by Namespace name and Local name. If Namespace is null, ignore namespace comparison. If Namespace is "", treat the name as having no Namespace URI.

See getValue(int) for a description of the possible values.

Parameters
uri:String

The Namespace URI, or null namespaces are ignored.

localName:String

The local name of the attribute.

Returns:String

The attribute value as a string, or null if the attribute is not in the list.

growTableViewback to summary
private void growTableView()

Increases the capacity of the table view.

hashback to summary
private int hash(String localpart)
hashback to summary
private int hash(String localpart, String uri)
hash0back to summary
private int hash0(String symbol)
isSpecifiedback to summary
public boolean isSpecified(int attrIndex)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.isSpecified.

Returns true if the attribute is specified in the instance document.

Parameters
attrIndex:int

The attribute index.

prepareAndPopulateTableViewback to summary
protected void prepareAndPopulateTableView()

Prepares the table view of the attributes list for use, and populates it with the attributes which have been previously read.

prepareAndPopulateTableViewback to summary
private void prepareAndPopulateTableView(final int count)
prepareAndPopulateTableViewNSback to summary
private void prepareAndPopulateTableViewNS(final int count)
prepareTableViewback to summary
protected void prepareTableView()

Prepares the table view of the attributes list for use.

rebalanceTableViewback to summary
private void rebalanceTableView(final int count)

Randomly selects a new hash function and reorganizes the table view in order to more evenly distribute its entries. This method is called automatically when the number of attributes in one bucket exceeds MAX_HASH_COLLISIONS.

rebalanceTableViewNSback to summary
private void rebalanceTableViewNS(final int count)

Randomly selects a new hash function and reorganizes the table view in order to more evenly distribute its entries. This method is called automatically when the number of attributes in one bucket exceeds MAX_HASH_COLLISIONS.

refreshback to summary
public void refresh()

Implements com.sun.xml.internal.stream.XMLBufferListener.refresh.

This method will be invoked by XMLEntityReader before ScannedEntities buffer is reloaded.

refreshback to summary
public void refresh(int pos)

Implements com.sun.xml.internal.stream.XMLBufferListener.refresh.

Doc from com.sun.xml.internal.stream.XMLBufferListener.refresh.

receives callbacks from XMLEntityReader when buffer is being changed.

removeAllAttributesback to summary
public void removeAllAttributes()

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.removeAllAttributes.

Removes all of the attributes. This method will also remove all entities associated to the attributes.

removeAttributeAtback to summary
public void removeAttributeAt(int attrIndex)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.removeAttributeAt.

Removes the attribute at the specified index.

Note

This operation changes the indexes of all attributes following the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

setAugmentationsback to summary
public void setAugmentations(int attrIndex, Augmentations augs)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setAugmentations.

Sets the augmentations of the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

augs:Augmentations

The augmentations.

setNameback to summary
public void setName(int attrIndex, QName attrName)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setName.

Sets the name of the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

attrName:QName

The new attribute name.

setNamespacesback to summary
public void setNamespaces(boolean namespaces)

Sets whether namespace processing is being performed. This state is needed to return the correct value from the getLocalName method.

Parameters
namespaces:boolean

True if namespace processing is turned on.

See Also
getLocalName
setNonNormalizedValueback to summary
public void setNonNormalizedValue(int attrIndex, String attrValue)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setNonNormalizedValue.

Sets the non-normalized value of the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

attrValue:String

The new non-normalized attribute value.

setSpecifiedback to summary
public void setSpecified(int attrIndex, boolean specified)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setSpecified.

Sets whether an attribute is specified in the instance document or not.

Parameters
attrIndex:int

The attribute index.

specified:boolean

True if the attribute is specified in the instance document.

setTypeback to summary
public void setType(int attrIndex, String attrType)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setType.

Sets the type of the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

attrType:String

The attribute type. The type name is determined by the type specified for this attribute in the DTD. For example: "CDATA", "ID", "NMTOKEN", etc. However, attributes of type enumeration will have the type value specified as the pipe ('|') separated list of the enumeration values prefixed by an open parenthesis and suffixed by a close parenthesis. For example: "(true|false)".

setURIback to summary
public void setURI(int attrIndex, String uri)

Sets the uri of the attribute at the specified index.

Parameters
attrIndex:int

The attribute index.

uri:String

Namespace uri

setValueback to summary
public void setValue(int attrIndex, String attrValue)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setValue.

Sets the value of the attribute at the specified index. This method will overwrite the non-normalized value of the attribute.

Parameters
attrIndex:int

The attribute index.

attrValue:String

The new attribute value.

See Also
setNonNormalizedValue
setValueback to summary
public void setValue(int attrIndex, String attrValue, XMLString value)

Implements com.sun.org.apache.xerces.internal.xni.XMLAttributes.setValue.

com.sun.org.apache.xerces.internal.util back to summary

pack-priv Class XMLAttributesImpl.Attribute

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.Attribute

Attribute information.
Author
Andy Clark, IBM

Field Summary

Modifier and TypeField and Description
public Augmentations
augs

Augmentations information for this attribute.

public final QName
name

Name.

public XMLAttributesImpl.Attribute
next

Pointer to the next attribute in the chain.

public String
nonNormalizedValue

Non-normalized value.

public boolean
specified

Specified.

public String
type

Type.

public String
value

Value.

public XMLString
xmlValue

This will point to the ScannedEntities buffer.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

augsback to summary
public Augmentations augs

Augmentations information for this attribute. XMLAttributes has no knowledge if any augmentations were attached to Augmentations.

nameback to summary
public final QName name

Name.

nextback to summary
public XMLAttributesImpl.Attribute next

Pointer to the next attribute in the chain.

nonNormalizedValueback to summary
public String nonNormalizedValue

Non-normalized value.

specifiedback to summary
public boolean specified

Specified.

typeback to summary
public String type

Type.

valueback to summary
public String value

Value.

xmlValueback to summary
public XMLString xmlValue

This will point to the ScannedEntities buffer.

Constructor Detail

Attributeback to summary
pack-priv Attribute()