|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.fastinfoset.sax.helpers.EncodingAlgorithmAttributesImpl
public class EncodingAlgorithmAttributesImpl
Default implementation of the 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
| Constructor Summary | |
|---|---|
EncodingAlgorithmAttributesImpl()
Construct a new, empty EncodingAlgorithmAttributesImpl object. |
|
EncodingAlgorithmAttributesImpl(Attributes attributes)
Copy an existing Attributes object. |
|
EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
Attributes attributes)
Use registered encoding algorithms and copy an existing Attributes object. |
|
| Method Summary | |
|---|---|
void |
addAttribute(String URI,
String localName,
String qName,
String type,
String value)
Add an attribute to the end of the list. |
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. |
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. |
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. |
void |
clear()
Clear the attribute list for reuse. |
Object |
getAlgorithmData(int index)
Return the data of the encoding algorithm. |
int |
getAlgorithmIndex(int index)
Return the index of the encoding algorithm. |
String |
getAlgorithmURI(int index)
Return the URI of the encoding algorithm. |
String |
getAlpababet(int index)
Return the alphabet associated with the attribute value. |
int |
getIndex(String qName)
|
int |
getIndex(String uri,
String localName)
|
int |
getLength()
|
String |
getLocalName(int index)
|
String |
getQName(int index)
|
boolean |
getToIndex(int index)
Return the whether the attribute value should be indexed or not. |
String |
getType(int index)
|
String |
getType(String qName)
|
String |
getType(String uri,
String localName)
|
String |
getURI(int index)
|
String |
getValue(int index)
|
String |
getValue(String qName)
|
String |
getValue(String uri,
String localName)
|
void |
replaceWithAttributeAlgorithmData(int index,
String algorithmURI,
int algorithmID,
Object algorithmData)
Replace an attribute value with algorithm data. |
void |
setAttributes(Attributes atts)
Copy an entire Attributes object. |
void |
setAttributes(EncodingAlgorithmAttributes atts)
Copy an entire EncodingAlgorithmAttributes object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncodingAlgorithmAttributesImpl()
public EncodingAlgorithmAttributesImpl(Attributes attributes)
This constructor is especially useful inside a
startElement event.
attributes - The existing Attributes object.
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
Attributes attributes)
This constructor is especially useful inside a
startElement event.
registeredEncodingAlgorithms - The registeredEncodingAlgorithms encoding algorithms.attributes - The existing Attributes object.| Method Detail |
|---|
public final void clear()
public void addAttribute(String URI,
String localName,
String qName,
String type,
String value)
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.
URI - The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed.localName - The local name, or the empty string if
Namespace processing is not being performed.qName - The qualified (prefixed) name, or the empty string
if qualified names are not available.type - The attribute type as a string.value - The attribute value.
public void addAttribute(String URI,
String localName,
String qName,
String type,
String value,
boolean index,
String alphabet)
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.
URI - The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed.localName - The local name, or the empty string if
Namespace processing is not being performed.qName - The qualified (prefixed) name, or the empty string
if qualified names are not available.type - The attribute type as a string.value - The attribute value.index - True if attribute should be indexed.alphabet - The alphabet associated with the attribute value,
may be null if there is no associated alphabet.
public void addAttributeWithBuiltInAlgorithmData(String URI,
String localName,
String qName,
int builtInAlgorithmID,
Object algorithmData)
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.
URI - The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed.localName - The local name, or the empty string if
Namespace processing is not being performed.qName - The qualified (prefixed) name, or the empty string
if qualified names are not available.builtInAlgorithmID - The built in algorithm ID.algorithmData - The built in algorithm data.
public void addAttributeWithAlgorithmData(String URI,
String localName,
String qName,
String algorithmURI,
int algorithmID,
Object algorithmData)
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.
URI - The Namespace URI, or the empty string if
none is available or Namespace processing is not
being performed.localName - The local name, or the empty string if
Namespace processing is not being performed.qName - The qualified (prefixed) name, or the empty string
if qualified names are not available.algorithmURI - The algorithm URI, or null if a built in algorithmalgorithmID - The algorithm ID.algorithmData - The algorithm data.
public void replaceWithAttributeAlgorithmData(int index,
String algorithmURI,
int algorithmID,
Object algorithmData)
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.
index - The index of the attribute whose value is to be replacedalgorithmURI - The algorithm URI, or null if a built in algorithmalgorithmID - The algorithm ID.algorithmData - The algorithm data.public void setAttributes(Attributes atts)
atts - The attributes to copy.public void setAttributes(EncodingAlgorithmAttributes atts)
atts - The attributes to copy.public final int getLength()
getLength in interface Attributespublic final String getLocalName(int index)
getLocalName in interface Attributespublic final String getQName(int index)
getQName in interface Attributespublic final String getType(int index)
getType in interface Attributespublic final String getURI(int index)
getURI in interface Attributespublic final String getValue(int index)
getValue in interface Attributespublic final int getIndex(String qName)
getIndex in interface Attributespublic final String getType(String qName)
getType in interface Attributespublic final String getValue(String qName)
getValue in interface Attributes
public final int getIndex(String uri,
String localName)
getIndex in interface Attributes
public final String getType(String uri,
String localName)
getType in interface Attributes
public final String getValue(String uri,
String localName)
getValue in interface Attributespublic final String getAlgorithmURI(int index)
EncodingAlgorithmAttributesIf 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 EncodingAlgorithmAttributes.getAlgorithmData(int) returns null then the result of
this method is undefined.
getAlgorithmURI in interface EncodingAlgorithmAttributesindex - The attribute index (zero-based).
public final int getAlgorithmIndex(int index)
EncodingAlgorithmAttributesIf EncodingAlgorithmAttributes.getAlgorithmData(int) returns null then the result of
this method is undefined.
getAlgorithmIndex in interface EncodingAlgorithmAttributesindex - The attribute index (zero-based).
EncodingAlgorithmIndexespublic final Object getAlgorithmData(int index)
EncodingAlgorithmAttributesIf 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 byte[]
is returned if there is no EncodingAlgorithm registered for the
application-defined encoding algorithm URI. Otherwise, an Object produced
from the registeredEncodingAlgorithm is returned.
If there no encoding algorithm data associated an attribute then
null is returned.
getAlgorithmData in interface EncodingAlgorithmAttributesindex - The attribute index (zero-based).
public final String getAlpababet(int index)
EncodingAlgorithmAttributes
getAlpababet in interface EncodingAlgorithmAttributesindex - The attribute index (zero-based).
public final boolean getToIndex(int index)
EncodingAlgorithmAttributes
getToIndex in interface EncodingAlgorithmAttributesindex - The attribute index (zero-based).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||