- All Implemented Interfaces:
EncodingAlgorithmAttributes
,Attributes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object[]
private int[]
private String[]
private int
private QualifiedName[]
private Map
<String, EncodingAlgorithm> private String[]
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionAttributesHolder
(Map<String, EncodingAlgorithm> registeredEncodingAlgorithms) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAttribute
(QualifiedName name, String value) final void
addAttributeWithAlgorithmData
(QualifiedName name, String URI, int id, Object data) final void
clear()
private StringBuilder
convertEncodingAlgorithmDataToString
(int identifier, String URI, Object data) final Object
getAlgorithmData
(int index) Return the data of the encoding algorithm.final int
getAlgorithmIndex
(int index) Return the index of the encoding algorithm.final String
getAlgorithmURI
(int index) Return the URI of the encoding algorithm.getAlpababet
(int index) Return the alphabet associated with the attribute value.final int
final int
final int
final String
getLocalName
(int index) final String
getPrefix
(int index) final String
getQName
(int index) final QualifiedName
getQualifiedName
(int index) boolean
getToIndex
(int index) Return the whether the attribute value should be indexed or not.final String
getType
(int index) final String
final String
final String
getURI
(int index) final String
getValue
(int index) final String
final String
private void
resize()
-
Field Details
-
DEFAULT_CAPACITY
private static final int DEFAULT_CAPACITY- See Also:
-
_registeredEncodingAlgorithms
-
_attributeCount
private int _attributeCount -
_names
-
_values
-
_algorithmURIs
-
_algorithmIds
private int[] _algorithmIds -
_algorithmData
-
-
Constructor Details
-
AttributesHolder
public AttributesHolder() -
AttributesHolder
-
-
Method Details
-
getLength
public final int getLength()- Specified by:
getLength
in interfaceAttributes
-
getLocalName
- Specified by:
getLocalName
in interfaceAttributes
-
getQName
- Specified by:
getQName
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getURI
- Specified by:
getURI
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
getIndex
- Specified by:
getIndex
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
getIndex
- Specified by:
getIndex
in interfaceAttributes
-
getType
- Specified by:
getType
in interfaceAttributes
-
getValue
- Specified by:
getValue
in interfaceAttributes
-
clear
public final void clear() -
getAlgorithmURI
Description copied from interface:EncodingAlgorithmAttributes
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
EncodingAlgorithmAttributes.getAlgorithmData(int)
returns null then the result of this method is undefined.- Specified by:
getAlgorithmURI
in interfaceEncodingAlgorithmAttributes
- Parameters:
index
- The attribute index (zero-based).- Returns:
- The URI. If the index is out of range then null is returned.
-
getAlgorithmIndex
public final int getAlgorithmIndex(int index) Description copied from interface:EncodingAlgorithmAttributes
Return the index of the encoding algorithm.If
EncodingAlgorithmAttributes.getAlgorithmData(int)
returns null then the result of this method is undefined.- Specified by:
getAlgorithmIndex
in interfaceEncodingAlgorithmAttributes
- Parameters:
index
- The attribute index (zero-based).- Returns:
- The algorithm index. If index is out of range then -1 is returned.
- See Also:
-
getAlgorithmData
Description copied from interface:EncodingAlgorithmAttributes
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
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.- Specified by:
getAlgorithmData
in interfaceEncodingAlgorithmAttributes
- Parameters:
index
- The attribute index (zero-based).- Returns:
- The data. If the index is out of range then null is returned.
-
getAlpababet
Description copied from interface:EncodingAlgorithmAttributes
Return the alphabet associated with the attribute value.- Specified by:
getAlpababet
in interfaceEncodingAlgorithmAttributes
- Parameters:
index
- The attribute index (zero-based).- Returns:
- The alphabet. If the index is out of range then null is returned. If there is is no alphabet then null is returned.
-
getToIndex
public boolean getToIndex(int index) Description copied from interface:EncodingAlgorithmAttributes
Return the whether the attribute value should be indexed or not.- Specified by:
getToIndex
in interfaceEncodingAlgorithmAttributes
- Parameters:
index
- The attribute index (zero-based).- Returns:
- True if attribute value should be indexed, otherwise false.
-
addAttribute
-
addAttributeWithAlgorithmData
public final void addAttributeWithAlgorithmData(QualifiedName name, String URI, int id, Object data) -
getQualifiedName
-
getPrefix
-
resize
private void resize() -
convertEncodingAlgorithmDataToString
private StringBuilder convertEncodingAlgorithmDataToString(int identifier, String URI, Object data) throws FastInfosetException, IOException - Throws:
FastInfosetException
IOException
-