jp.bitmeister.asn1.codec.xer
Class XerDecoder

java.lang.Object
  extended by jp.bitmeister.asn1.codec.xer.XerDecoder
All Implemented Interfaces:
ASN1Decoder, ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>

public class XerDecoder
extends java.lang.Object
implements ASN1Decoder, ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>

XER (XML Encoding Rules) decoder.

XerDecoder is an implementation of ASN1Decoder. It reads a number of bytes from an InputStream that is specified when a decoder is instantiated, and decodes them to an ASN.1 data with XML Encoding Rules (XER).

Author:
WATANABE, Jun.
See Also:
ASN1Decoder, XerEncoder

Constructor Summary
XerDecoder(java.lang.Class<? extends ASN1Module> module, java.io.InputStream in)
          Instantiates a XerDecoder.
XerDecoder(java.io.InputStream in)
          Instantiates a XerDecoder.
 
Method Summary
 ASN1Type decode()
          Decodes source data to an ASN.1 data.
<T extends ASN1Type>
T
decode(java.lang.Class<T> type)
          Decodes source data and sets these decoded values to an instance of the ASN.1 type.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(ANY data)
          Visits the ANY data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(BIT_STRING data)
          Visits the BIT_STRING data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(BOOLEAN data)
          Visits the BOOLEAN data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(CHOICE data)
          Visits the CHOICE data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(ENUMERATED data)
          Visits the ENUMERATED data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(INTEGER data)
          Visits the INTEGER data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(NULL data)
          Visits the NULL data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(OBJECT_IDENTIFIER data)
          Visits the OBJECT_IDENTIFIER data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(OCTET_STRING data)
          Visits the OCTET_STRING data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(REAL data)
          Visits the REAL data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(RELATIVE_OID data)
          Visits the RELATIVE_OID data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SEQUENCE_OF<? extends ASN1Type> data)
          Visits the SEQUENCE_OF data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SEQUENCE data)
          Visits the SEQUENCE data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SET_OF<? extends ASN1Type> data)
          Visits the SET_OF data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SET data)
          Visits the SET data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(StringType data)
          Visits the StringType data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(TimeType data)
          Visits the TimeType data.
 jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(UnknownType data)
          Visits the UnknownType data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XerDecoder

public XerDecoder(java.io.InputStream in)
Instantiates a XerDecoder.

Parameters:
in - The InputStream to be read.

XerDecoder

public XerDecoder(java.lang.Class<? extends ASN1Module> module,
                  java.io.InputStream in)
Instantiates a XerDecoder.

Parameters:
in - The InputStream to be read.
Method Detail

decode

public <T extends ASN1Type> T decode(java.lang.Class<T> type)
                          throws ASN1DecodingException
Description copied from interface: ASN1Decoder
Decodes source data and sets these decoded values to an instance of the ASN.1 type.

Specified by:
decode in interface ASN1Decoder
Type Parameters:
T - Indicates the ASN.1 type.
Parameters:
type - The class object of the ASN.1 type.
Returns:
An instance of the ASN.1 type.
Throws:
ASN1DecodingException - Thrown when an error occurred while the decoding process.

decode

public ASN1Type decode()
                throws ASN1DecodingException
Description copied from interface: ASN1Decoder
Decodes source data to an ASN.1 data. The type of the data will be specified by type indicator (for example ASN.1 tag) included in the source data.

Specified by:
decode in interface ASN1Decoder
Returns:
Decoded ASN.1 data.
Throws:
ASN1DecodingException - Thrown when an error occurred while the decoding process.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(BOOLEAN data)
Description copied from interface: ASN1Visitor
Visits the BOOLEAN data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(INTEGER data)
Description copied from interface: ASN1Visitor
Visits the INTEGER data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(BIT_STRING data)
Description copied from interface: ASN1Visitor
Visits the BIT_STRING data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(OCTET_STRING data)
Description copied from interface: ASN1Visitor
Visits the OCTET_STRING data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(NULL data)
Description copied from interface: ASN1Visitor
Visits the NULL data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(OBJECT_IDENTIFIER data)
Description copied from interface: ASN1Visitor
Visits the OBJECT_IDENTIFIER data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(REAL data)
Description copied from interface: ASN1Visitor
Visits the REAL data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(ENUMERATED data)
Description copied from interface: ASN1Visitor
Visits the ENUMERATED data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(RELATIVE_OID data)
Description copied from interface: ASN1Visitor
Visits the RELATIVE_OID data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(ANY data)
Description copied from interface: ASN1Visitor
Visits the ANY data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(CHOICE data)
Description copied from interface: ASN1Visitor
Visits the CHOICE data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SEQUENCE_OF<? extends ASN1Type> data)
Description copied from interface: ASN1Visitor
Visits the SEQUENCE_OF data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SEQUENCE data)
Description copied from interface: ASN1Visitor
Visits the SEQUENCE data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SET_OF<? extends ASN1Type> data)
Description copied from interface: ASN1Visitor
Visits the SET_OF data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(SET data)
Description copied from interface: ASN1Visitor
Visits the SET data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(StringType data)
Description copied from interface: ASN1Visitor
Visits the StringType data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(TimeType data)
Description copied from interface: ASN1Visitor
Visits the TimeType data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.

visit

public jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder visit(UnknownType data)
                                                          throws org.xml.sax.SAXException
Description copied from interface: ASN1Visitor
Visits the UnknownType data.

Specified by:
visit in interface ASN1Visitor<jp.bitmeister.asn1.codec.xer.XerDecoder.DataDecoder,org.xml.sax.SAXException>
Parameters:
data - The data to be visited.
Returns:
Result.
Throws:
org.xml.sax.SAXException