public class SimpleNode extends java.lang.Object implements ASNObject
| Modifier and Type | Field and Description |
|---|---|
protected ASNObject[] |
children |
protected java.lang.Object |
defaultValue
The Java object representing the default value for this
ASN.1 object if such value is defined in the specification.
|
protected int |
id |
protected java.lang.String |
name
Name associated with this ASN.1 object.
|
protected boolean |
optional
True if the ASN.1 object is optional, false otherwise.
|
protected ASNObject |
parent |
protected Parser |
parser |
protected Tag |
tag
Tag associated with this ASN.1 object.
|
protected java.lang.Object |
value
Java object representing the current value of this ASN.1 object
when applicable.
|
| Constructor and Description |
|---|
SimpleNode(int i) |
SimpleNode(Parser p,
int i) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
accept(ParserVisitor visitor,
java.lang.Object data)
Accepts a visitor.
|
java.lang.Object |
childrenAccept(ParserVisitor visitor,
java.lang.Object data)
Accepts the 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 |
getChild(int i) |
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() |
static SimpleNode |
getInstance(Parser p,
Tag tag)
Returns a new instance given a UNIVERSAL ASN.1 tag instance;
null otherwise.
|
java.lang.String |
getName() |
ASNObject |
getParent() |
Parser |
getParser() |
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.
|
java.lang.Object |
jjtAccept(ParserVisitor visitor,
java.lang.Object data)
Accepts the visitor.
|
void |
jjtAddChild(Node n,
int i)
This method tells the node to add its argument to the node's
list of children.
|
void |
jjtClose()
This method is called after all the child nodes have been
added.
|
Node |
jjtGetChild(int i)
This method returns a child node.
|
int |
jjtGetNumChildren()
Return the number of children the node has.
|
Node |
jjtGetParent() |
void |
jjtOpen()
This method is called after the node has been made the current
node.
|
void |
jjtSetParent(Node n)
This pair of methods are used to inform the node of its
parent.
|
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 |
setName(java.lang.String name)
Sets the name of this instance.
|
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
|
void |
setValue(java.lang.Object value)
Sets the value of this component to a native Java instance.
|
java.lang.String |
toString()
You can override these two methods in subclasses of SimpleNode
to customize the way the node appears when the tree is dumped.
|
java.lang.String |
toString(java.lang.String prefix) |
protected ASNObject parent
protected ASNObject[] children
protected int id
protected Parser parser
protected java.lang.String name
protected Tag tag
protected boolean optional
protected java.lang.Object value
cryptix.asn1.lang.ASNObject.ASNObject.setValue(java.lang.Object)protected java.lang.Object defaultValue
public SimpleNode(int i)
public SimpleNode(Parser p, int i)
public static final SimpleNode getInstance(Parser p, Tag tag)
public void jjtOpen()
Nodepublic void jjtClose()
Nodepublic void jjtSetParent(Node n)
NodejjtSetParent in interface Nodepublic Node jjtGetParent()
jjtGetParent in interface Nodepublic void jjtAddChild(Node n, int i)
NodejjtAddChild in interface Nodepublic Node jjtGetChild(int i)
NodejjtGetChild in interface Nodepublic ASNObject getChild(int i)
public ASNObject[] getChildren()
getChildren in interface ASNObjectpublic int jjtGetNumChildren()
NodejjtGetNumChildren in interface Nodepublic java.lang.Object jjtAccept(ParserVisitor visitor, java.lang.Object data) throws java.io.IOException
public java.lang.Object childrenAccept(ParserVisitor visitor, java.lang.Object data) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String prefix)
public Parser getParser()
cryptix.asn1.lang.Parser handling
this ASN.1 object.public int getID()
public void setName(java.lang.String name)
public java.lang.String getName()
public ASNObject getComponent(java.lang.String aName)
ASNObjectASNObject instance:
"certificateInfo.signature.algorithm"
getComponent in interface ASNObjectpublic void setTag(Tag tag)
ASNObjectTag.public Tag getTag()
ASNObjectTag.public boolean isOptional()
ASNObjectisOptional in interface ASNObjectpublic void setOptional(boolean flag)
ASNObjectsetOptional in interface ASNObjectpublic void setValue(java.lang.Object value)
ASNObjectThe mapping between ASN.1 types and Java types is given below:
public java.lang.Object getValue()
ASNObjectsetValue() method.getValue in interface ASNObjectASNObject.setValue(java.lang.Object)public void setDefaultValue(java.lang.Object defaultValue)
ASNObjectsetDefaultValue in interface ASNObjectdefaultValue - The Java object instance representing
the default value of this ASN.1 object.public java.lang.Object getDefaultValue()
ASNObjectgetDefaultValue in interface ASNObjectpublic void dump()
ASNObjectpublic void dump(java.lang.String prefix)
ASNObjectpublic java.lang.Object accept(ParserVisitor visitor, java.lang.Object data) throws java.io.IOException
ASNObjectaccept in interface ASNObjectvisitor - An instance that implements the ParserVisitor
interface.java.io.IOException - If an exception occurs during
the application of the Visitor method.ParserVisitor