cryptix.asn1.lang
Interface ASNObject

All Superinterfaces:
Node
All Known Implementing Classes:
SimpleNode

public interface ASNObject
extends Node


Method Summary
 java.lang.Object accept(ParserVisitor visitor, java.lang.Object data)
          Accepts a visitor.
 void dump()
          Dumps this object's specification to System.out.
 void dump(java.lang.String prefix)
          Dumps this object's specification to System.out prefixing each line with the given string.
 ASNObject[] getChildren()
           
 ASNObject getComponent(java.lang.String aName)
          Returns a child component of an ASN.1 construct given its full name.
 java.lang.Object getDefaultValue()
          Similar to getValue() but operates on the default value of this ASN.1 object if such a value is/was defined in the specifications.
 int getID()
           
 java.lang.String getName()
           
 ASNObject getParent()
           
 Tag getTag()
          Returns a reference to an instance of this ASN.1 object's Tag.
 java.lang.Object getValue()
          Returns the Java Object containing the current value of this ASN.1 object.
 boolean isOptional()
          Returns true if this ASN.1 object is optional, false otherwise.
 void setDefaultValue(java.lang.Object defaultValue)
          Similar to setValue() but operates on the default value of this ASN.1 object if such a value is/was defined in the specifications.
 void setOptional(boolean flag)
          Sets the optional flag for this ASN.1 object to the designated value. param flag The new value of the optional flag.
 void setTag(Tag tag)
          Sets the tag of this ASN.1 object to be the designated instance. param tag A reference to an instance of Tag.
 void setValue(java.lang.Object value)
          Sets the value of this component to a native Java instance. The mapping between ASN.1 types and Java types is given below: BOOLEAN: java.lang.Boolean; INTEGER: java.math.BigInteger; BIT STRING: byte[]; OCTET STRING: byte[]; NULL: null; OID: A java.lang.String containing numeric digits and the character '.'; SEQUENCE, SEQUENCE OF, SET and SET OF: cryptix.asn1.lang.ASNObject[]; PrintableString: java.lang.String.
 
Methods inherited from interface cryptix.asn1.lang.Node
jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent
 

Method Detail

getParent

public ASNObject getParent()

getChildren

public ASNObject[] getChildren()

getID

public int getID()

getName

public java.lang.String getName()
Returns:
The name associated with this ASN.1 object.

getComponent

public ASNObject getComponent(java.lang.String aName)
Returns a child component of an ASN.1 construct given its full name. The name can be a sequence of strings separated by the character '.' to denote their hierarchy within the ASN.1 object; eg: for an X.509 encoded Certificate, one can get to the OID (the "algorithm") of the AlgorithmIdentifier (the "signature") included in the CertificateInfo part (the "certificateInfo") by passing the following as an argument to an X.509 ASNObject instance:
    "certificateInfo.signature.algorithm"
 
Returns:
A child component of this ASN.1 object given its dotted name.

setTag

public void setTag(Tag tag)
Sets the tag of this ASN.1 object to be the designated instance. param tag A reference to an instance of Tag.
See Also:
Tag

getTag

public Tag getTag()
Returns a reference to an instance of this ASN.1 object's Tag.
Returns:
A reference to an instance of this ASN.1 object's Tag.
See Also:
Tag

isOptional

public boolean isOptional()
Returns true if this ASN.1 object is optional, false otherwise.
Returns:
True if this ASN.1 object is optional, false otherwise.

setOptional

public void setOptional(boolean flag)
Sets the optional flag for this ASN.1 object to the designated value. param flag The new value of the optional flag.

setValue

public void setValue(java.lang.Object value)
Sets the value of this component to a native Java instance.

The mapping between ASN.1 types and Java types is given below:

  1. BOOLEAN: java.lang.Boolean;
  2. INTEGER: java.math.BigInteger;
  3. BIT STRING: byte[];
  4. OCTET STRING: byte[];
  5. NULL: null;
  6. OID: A java.lang.String containing numeric digits and the character '.';
  7. SEQUENCE, SEQUENCE OF, SET and SET OF: cryptix.asn1.lang.ASNObject[];
  8. PrintableString: java.lang.String.

getValue

public java.lang.Object getValue()
Returns the Java Object containing the current value of this ASN.1 object. For the mapping between ASN.1 values and Java types, see the setValue() method.
Returns:
The value of this component as a native Java object.
See Also:
setValue(java.lang.Object)

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Similar to setValue() but operates on the default value of this ASN.1 object if such a value is/was defined in the specifications.
Parameters:
defaultValue - The Java object instance representing the default value of this ASN.1 object.

getDefaultValue

public java.lang.Object getDefaultValue()
Similar to getValue() but operates on the default value of this ASN.1 object if such a value is/was defined in the specifications. If no such default value was defnied in the specifications then this method returns a null.

dump

public void dump()
Dumps this object's specification to System.out.

dump

public void dump(java.lang.String prefix)
Dumps this object's specification to System.out prefixing each line with the given string.
Parameters:
prefix - A string that will prefix each new line of the output.

accept

public java.lang.Object accept(ParserVisitor visitor,
                               java.lang.Object data)
                        throws java.io.IOException
Accepts a visitor.
Parameters:
visitor - An instance that implements the ParserVisitor interface.
Throws:
java.io.IOException - If an exception occurs during the application of the Visitor method.
See Also:
ParserVisitor