cryptix.asn1.lang
Interface ASNObject
- Node
- ASNAny, ASNBitString, ASNBoolean, ASNInteger, ASNNull, ASNObjectIdentifier, ASNOctetString, ASNPrintableString, ASNSequence, ASNSequenceOf, ASNSet, ASNSetOf, ASNSpecification, ASNTaggedType, ASNTime, ASNType, ASNTypeAlias, SimpleNode
public interface ASNObject
An interface that acts as the visible superclass of all
components in parsed input files written in ASN.1.
This interface extends
cryptix.asn1.lang.node
which is generated by the
JavaCC
tool.
- Raif S. Naffah
cryptix.asn1.lang.Node
Copyright ©1997, 1998, 1999
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.1 $
Object | accept(ParserVisitor visitor, Object data) - Accepts a visitor.
|
void | dump() - Dumps this object's specification to System.out.
|
void | dump(String prefix) - Dumps this object's specification to System.out prefixing
each line with the given string.
|
ASNObject[] | getChildren()
|
ASNObject | getComponent(String aName) - Returns a child component of an ASN.1 construct given its
full name.
|
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()
|
String | getName()
|
ASNObject | getParent()
|
Tag | getTag() - Returns a reference to an instance of this ASN.1 object's
Tag .
|
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(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.
|
void | setTag(Tag tag) - Sets the tag of this ASN.1 object to be the designated
instance.
|
void | setValue(Object value) - Sets the value of this component to a native Java instance.
|
accept
public Object accept(ParserVisitor visitor,
Object data)
throws IOException
Accepts a visitor.
visitor
- An instance that implements the ParserVisitor
interface.
ParserVisitor
dump
public void dump()
Dumps this object's specification to System.out.
dump
public void dump(String prefix)
Dumps this object's specification to System.out prefixing
each line with the given string.
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"
- 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.
getName
public String getName()
- The name associated with this ASN.1 object.
getTag
public Tag getTag()
Returns a reference to an instance of this ASN.1 object's
Tag
.
- 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.
- The value of this component as a native Java object.
setValue(Object)
isOptional
public boolean isOptional()
Returns true if this ASN.1 object is optional, false
otherwise.
- True if this ASN.1 object is optional, false
otherwise.
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.
defaultValue
- The Java object instance representing
the default value of this ASN.1 object.
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.
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
.
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.