Package com.oss.metadata
Class TagDecoder
java.lang.Object
com.oss.metadata.TagDecoder
The TagDecoder class represents an array of tags which
is used for SEQUENCE, SET, and CHOICE types which have multiple
fields, each field containing its own tag. The TagDecoder contains
an array of tags, each element of the array represents a tag for one field.
- Since:
- ASN.1/Java 2.1
-
Method Summary
Modifier and TypeMethodDescriptionint
count()
Returns the number of tag decoder elements in the array, or zero (0) if there is no array.com.oss.metadata.TagDecoderElement
getElement
(int index) Returns the TagDecoderElement which corresponds to the parameter index.int
getFieldIndex
(short tag) Returns the index where the ASN.1 tag can be found in the field array.int
getFieldIndex
(com.oss.metadata.XNamespace ns, String name, Fields fields) Returns the index of the field where the EXER tag can be found.int
getFieldIndex
(String tag, Fields fields) Returns the index of the field where the XML tag can be found.
-
Method Details
-
getFieldIndex
public int getFieldIndex(short tag) Returns the index where the ASN.1 tag can be found in the field array.- Parameters:
tag
- an ASN.1 tag- Returns:
- index of a field which corresponds to the parameter tag in the array of fields or -1 if tag was not found
-
getFieldIndex
Returns the index of the field where the XML tag can be found.- Parameters:
tag
- an XML tag (field name)fields
- array of fields which has the tag.- Returns:
- index of a field which corresponds to the parameter tag in the array of fields or -1 if the tag was not found
- Throws:
MetadataException
- if an error occurs when the metadata is accessed
-
getFieldIndex
public int getFieldIndex(com.oss.metadata.XNamespace ns, String name, Fields fields) throws MetadataException Returns the index of the field where the EXER tag can be found. The following encoding instructions are considered: NAME, NAMESPACE, ATTRIBUTE, ANY-ATTRIBUTE- Parameters:
ns
- specifies the namespace.name
- specifies the tag name.fields
- array of fields which has the tag.- Returns:
- index of a field which corresponds to the parameter tag in the array of fields or -1 if the tag was not found
- Throws:
MetadataException
- if an error occurs when the metadata is accessed
-
count
public int count()Returns the number of tag decoder elements in the array, or zero (0) if there is no array.- Returns:
- number of tag decoder elements
-
getElement
public com.oss.metadata.TagDecoderElement getElement(int index) Returns the TagDecoderElement which corresponds to the parameter index.- Parameters:
index
- an index of the tag in an array of tags- Returns:
- TagDecoderElement which corresponds to the parameter index in the mElements or null if index is more than length of mElements
-