accept
public Object accept(ParserVisitor visitor,
Object data)
throws java.io.IOException
Accepts a visitor.
- accept in interface ASNObject
visitor
- An instance that implements the ParserVisitor
interface.
ParserVisitor
childrenAccept
public Object childrenAccept(ParserVisitor visitor,
Object data)
throws java.io.IOException
Accepts the visitor.
dump
public void dump()
Dumps this object's specification to System.out.
- dump in interface ASNObject
dump
public void dump(String prefix)
Dumps this object's specification to System.out prefixing
each line with the given string.
- dump in interface ASNObject
prefix
- A string that will prefix each new line
of the output.
getComponent
public ASNObject getComponent(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"
- getComponent in interface ASNObject
- A child component of this ASN.1 object given its
dotted name.
getDefaultValue
public 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.
- getDefaultValue in interface ASNObject
getID
public int getID()
- getID in interface ASNObject
- The ID assigned to this ASN.1 Object by the Parser.
getInstance
public static final SimpleNode getInstance(Parser p,
Tag tag)
Returns a new instance given a UNIVERSAL ASN.1 tag instance;
null otherwise.
getName
public String getName()
- getName in interface ASNObject
- The name associated with this ASN.1 object.
getParser
public Parser getParser()
- The
cryptix.asn1.lang.Parser
handling
this ASN.1 object.
getTag
public Tag getTag()
Returns a reference to an instance of this ASN.1 object's
Tag
.
- getTag in interface ASNObject
- A reference to an instance of this ASN.1 object's
Tag
.
Tag
getValue
public 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.
- getValue in interface ASNObject
- The value of this component as a native Java object.
ASNObject.setValue(Object)
isOptional
public boolean isOptional()
Returns true if this ASN.1 object is optional, false
otherwise.
- isOptional in interface ASNObject
- True if this ASN.1 object is optional, false
otherwise.
jjtAccept
public Object jjtAccept(ParserVisitor visitor,
Object data)
throws java.io.IOException
Accepts the visitor.
- jjtAccept in interface Node
jjtAddChild
public void jjtAddChild(Node n,
int i)
This method tells the node to add its argument to the node's
list of children.
- jjtAddChild in interface Node
jjtClose
public void jjtClose()
This method is called after all the child nodes have been
added.
- jjtClose in interface Node
jjtGetChild
public Node jjtGetChild(int i)
This method returns a child node. The children are numbered
from zero, left to right.
- jjtGetChild in interface Node
jjtGetNumChildren
public int jjtGetNumChildren()
Return the number of children the node has.
- jjtGetNumChildren in interface Node
jjtOpen
public void jjtOpen()
This method is called after the node has been made the current
node. It indicates that child nodes can now be added to it.
- jjtOpen in interface Node
jjtSetParent
public void jjtSetParent(Node n)
This pair of methods are used to inform the node of its
parent.
- jjtSetParent in interface Node
setDefaultValue
public void setDefaultValue(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.
- setDefaultValue in interface ASNObject
defaultValue
- The Java object instance representing
the default value of this ASN.1 object.
setName
public void setName(String name)
Sets the name of this instance.
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.
- setOptional in interface ASNObject
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
.
- setTag in interface ASNObject
Tag
setValue
public void setValue(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.
- setValue in interface ASNObject
toString
public String toString()
You can override these two methods in subclasses of SimpleNode
to customize the way the node appears when the tree is dumped.
If your output uses more than one line you should override
toString(String), otherwise overriding toString() is probably
all you need to do.
toString
public String toString(String prefix)