EncodingAlgorithmAttributes interface.
This class provides a default implementation of the SAX2
EncodingAlgorithmAttributes interface, with the
addition of manipulators so that the list can be modified or
reused.
There are two typical uses of this class:
startElement event; or| Modifier and Type | Field and Description |
|---|---|
| private Object[] | |
| private int[] | |
| private String[] | |
| private String[] | |
| private int | |
| private Map | |
| private boolean[] | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | EncodingAlgorithmAttributesImpl(Attributes
The existing Attributes object. attributes)Copy an existing Attributes object. |
| public | EncodingAlgorithmAttributesImpl(Map<String, EncodingAlgorithm>
The registeredEncodingAlgorithms encoding algorithms. registeredEncodingAlgorithms, Attributes The existing Attributes object. attributes)Use registered encoding algorithms and copy an existing Attributes object. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAttribute(String
The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed. URI, String The local name, or the empty string if
Namespace processing is not being performed. localName, String The qualified (prefixed) name, or the empty string
if qualified names are not available. qName, String The attribute type as a string. type, String The attribute value. value)Add an attribute to the end of the list. |
| public void | addAttribute(String
The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed. URI, String The local name, or the empty string if
Namespace processing is not being performed. localName, String The qualified (prefixed) name, or the empty string
if qualified names are not available. qName, String The attribute type as a string. type, String The attribute value. value, boolean True if attribute should be indexed. index, String The alphabet associated with the attribute value,
may be null if there is no associated alphabet. alphabet)Add an attribute to the end of the list. |
| public void | addAttributeWithAlgorithmData(String
The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed. URI, String The local name, or the empty string if
Namespace processing is not being performed. localName, String The qualified (prefixed) name, or the empty string
if qualified names are not available. qName, String The algorithm URI, or null if a built in algorithm algorithmURI, int The algorithm ID. algorithmID, Object The algorithm data. algorithmData)Add an attribute with algorithm data to the end of the list. |
| public void | addAttributeWithBuiltInAlgorithmData(String
The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed. URI, String The local name, or the empty string if
Namespace processing is not being performed. localName, String The qualified (prefixed) name, or the empty string
if qualified names are not available. qName, int The built in algorithm ID. builtInAlgorithmID, Object The built in algorithm data. algorithmData)Add an attribute with built in algorithm data to the end of the list. |
| public final void | |
| private StringBuilder | |
| public final Object | getAlgorithmData(int index)
Implements org. Return the data of the encoding algorithm. |
| public final int | getAlgorithmIndex(int index)
Implements org. Return the index of the encoding algorithm. |
| public final String | getAlgorithmURI(int index)
Implements org. Return the URI of the encoding algorithm. |
| public final String | getAlpababet(int index)
Implements org. Return the alphabet associated with the attribute value. |
| public final int | getIndex(String qName)
Implements org. Look up the index of an attribute by XML qualified (prefixed) name. |
| public final int | getIndex(String uri, String localName)
Implements org. Look up the index of an attribute by Namespace name. |
| public final int | getLength()
Implements org. Return the number of attributes in the list. |
| public final String | getLocalName(int index)
Implements org. Look up an attribute's local name by index. |
| public final String | getQName(int index)
Implements org. Look up an attribute's XML qualified (prefixed) name by index. |
| public final boolean | getToIndex(int index)
Implements org. Return the whether the attribute value should be indexed or not. |
| public final String | |
| public final String | getType(String qName)
Implements org. Look up an attribute's type by XML qualified (prefixed) name. |
| public final String | getType(String uri, String localName)
Implements org. Look up an attribute's type by Namespace name. |
| public final String | getURI(int index)
Implements org. Look up an attribute's Namespace URI by index. |
| public final String | getValue(int index)
Implements org. Look up an attribute's value by index. |
| public final String | getValue(String qName)
Implements org. Look up an attribute's value by XML qualified (prefixed) name. |
| public final String | getValue(String uri, String localName)
Implements org. Look up an attribute's value by Namespace name. |
| private String | |
| public void | replaceWithAttributeAlgorithmData(int
The index of the attribute whose value is to be replaced index, String The algorithm URI, or null if a built in algorithm algorithmURI, int The algorithm ID. algorithmID, Object The algorithm data. algorithmData)Replace an attribute value with algorithm data. |
| private void | |
| private void | |
| public final void | |
| public final void | setAttributes(EncodingAlgorithmAttributes
The attributes to copy. atts)Copy an entire EncodingAlgorithmAttributes object. |
| _algorithmData | back to summary |
|---|---|
| private Object[] _algorithmData | |
| _algorithmIds | back to summary |
|---|---|
| private int[] _algorithmIds | |
| _alphabets | back to summary |
|---|---|
| private String[] _alphabets | |
| _data | back to summary |
|---|---|
| private String[] _data | |
| _length | back to summary |
|---|---|
| private int _length | |
| _registeredEncodingAlgorithms | back to summary |
|---|---|
| private Map<String, EncodingAlgorithm> _registeredEncodingAlgorithms | |
| _toIndex | back to summary |
|---|---|
| private boolean[] _toIndex | |
| ALGORITHMURI_OFFSET | back to summary |
|---|---|
| private static final int ALGORITHMURI_OFFSET | |
| DEFAULT_CAPACITY | back to summary |
|---|---|
| private static final int DEFAULT_CAPACITY | |
| LOCALNAME_OFFSET | back to summary |
|---|---|
| private static final int LOCALNAME_OFFSET | |
| QNAME_OFFSET | back to summary |
|---|---|
| private static final int QNAME_OFFSET | |
| SIZE | back to summary |
|---|---|
| private static final int SIZE | |
| TYPE_OFFSET | back to summary |
|---|---|
| private static final int TYPE_OFFSET | |
| URI_OFFSET | back to summary |
|---|---|
| private static final int URI_OFFSET | |
| VALUE_OFFSET | back to summary |
|---|---|
| private static final int VALUE_OFFSET | |
| EncodingAlgorithmAttributesImpl | back to summary |
|---|---|
| public EncodingAlgorithmAttributesImpl() Construct a new, empty EncodingAlgorithmAttributesImpl object. | |
| EncodingAlgorithmAttributesImpl | back to summary |
|---|---|
| public EncodingAlgorithmAttributesImpl(Attributes attributes) Copy an existing Attributes object. This constructor is especially useful inside a
| |
| EncodingAlgorithmAttributesImpl | back to summary |
|---|---|
| public EncodingAlgorithmAttributesImpl(Map<String, EncodingAlgorithm> registeredEncodingAlgorithms, Attributes attributes) Use registered encoding algorithms and copy an existing Attributes object. This constructor is especially useful inside a
| |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(String URI, String localName, String qName, String type, String value) Add an attribute to the end of the list. For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| |
| addAttribute | back to summary |
|---|---|
| public void addAttribute(String URI, String localName, String qName, String type, String value, boolean index, String alphabet) Add an attribute to the end of the list. For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| |
| addAttributeWithAlgorithmData | back to summary |
|---|---|
| public void addAttributeWithAlgorithmData(String URI, String localName, String qName, String algorithmURI, int algorithmID, Object algorithmData) Add an attribute with algorithm data to the end of the list. For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| |
| addAttributeWithBuiltInAlgorithmData | back to summary |
|---|---|
| public void addAttributeWithBuiltInAlgorithmData(String URI, String localName, String qName, int builtInAlgorithmID, Object algorithmData) Add an attribute with built in algorithm data to the end of the list. For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application.
| |
| clear | back to summary |
|---|---|
| public final void clear() Clear the attribute list for reuse. | |
| convertEncodingAlgorithmDataToString | back to summary |
|---|---|
| private StringBuilder convertEncodingAlgorithmDataToString(int identifier, String URI, Object data) throws FastInfosetException, IOException | |
| getAlgorithmData | back to summary |
|---|---|
| public final Object getAlgorithmData(int index) Implements org. Doc from org. Return the data of the encoding algorithm. If the algorithm data corresponds to a built-in encoding algorithm then an Object corresponding to the Java primitive type is returned. If the algorithm data corresponds to an application-defined encoding
algorithm then an Object that is an instance of If there no encoding algorithm data associated an attribute then
| |
| getAlgorithmIndex | back to summary |
|---|---|
| public final int getAlgorithmIndex(int index) Implements org. Doc from org. Return the index of the encoding algorithm. If
| |
| getAlgorithmURI | back to summary |
|---|---|
| public final String getAlgorithmURI(int index) Implements org. Doc from org. Return the URI of the encoding algorithm. If the algorithm data corresponds to a built-in encoding algorithm then the null is returned. If the algorithm data corresponds to an application-defined encoding algorithm then the URI of the algorithm is returned. If
| |
| getAlpababet | back to summary |
|---|---|
| public final String getAlpababet(int index) Implements org. Doc from org. Return the alphabet associated with the attribute value.
| |
| getIndex | back to summary |
|---|---|
| public final int getIndex(String qName) Implements org. Doc from org. Look up the index of an attribute by XML qualified (prefixed) name.
| |
| getIndex | back to summary |
|---|---|
| public final int getIndex(String uri, String localName) Implements org. Doc from org. Look up the index of an attribute by Namespace name.
| |
| getLength | back to summary |
|---|---|
| public final int getLength() Implements org. Doc from org. Return the number of attributes in the list. Once you know the number of attributes, you can iterate through the list.
| |
| getLocalName | back to summary |
|---|---|
| public final String getLocalName(int index) Implements org. Doc from org. Look up an attribute's local name by index.
| |
| getQName | back to summary |
|---|---|
| public final String getQName(int index) Implements org. Doc from org. Look up an attribute's XML qualified (prefixed) name by index.
| |
| getToIndex | back to summary |
|---|---|
| public final boolean getToIndex(int index) Implements org. Doc from org. Return the whether the attribute value should be indexed or not.
| |
| getType | back to summary |
|---|---|
| public final String getType(int index) Implements org. Doc from org. 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 Recommendation (clause 3.3.3, "Attribute-Value Normalization"). For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".
| |
| getType | back to summary |
|---|---|
| public final String getType(String qName) Implements org. Doc from org. Look up an attribute's type by XML qualified (prefixed) name. See
| |
| getType | back to summary |
|---|---|
| public final String getType(String uri, String localName) Implements org. Doc from org. Look up an attribute's type by Namespace name. See
| |
| getURI | back to summary |
|---|---|
| public final String getURI(int index) Implements org. Doc from org. Look up an attribute's Namespace URI by index.
| |
| getValue | back to summary |
|---|---|
| public final String getValue(int index) Implements org. Doc from org. 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.
| |
| getValue | back to summary |
|---|---|
| public final String getValue(String qName) Implements org. Doc from org. Look up an attribute's value by XML qualified (prefixed) name. See
| |
| getValue | back to summary |
|---|---|
| public final String getValue(String uri, String localName) Implements org. Doc from org. Look up an attribute's value by Namespace name. See
| |
| replaceNull | back to summary |
|---|---|
| private String replaceNull(String s) | |
| replaceWithAttributeAlgorithmData | back to summary |
|---|---|
| public void replaceWithAttributeAlgorithmData(int index, String algorithmURI, int algorithmID, Object algorithmData) Replace an attribute value with algorithm data. For the sake of speed, this method does no checking to see if the attribute is already in the list: that is the responsibility of the application. | |
| resize | back to summary |
|---|---|
| private void resize() | |
| resizeNoCopy | back to summary |
|---|---|
| private void resizeNoCopy() | |
| setAttributes | back to summary |
|---|---|
| public final void setAttributes(Attributes atts) Copy an entire Attributes object.
| |
| setAttributes | back to summary |
|---|---|
| public final void setAttributes(EncodingAlgorithmAttributes atts) Copy an entire EncodingAlgorithmAttributes object.
| |