cryptix.asn1.lang

Class SimpleNode

public class SimpleNode extends Object implements ASNObject

Originally generated by jjTree (part of the JavaCC tool), this Class acts as the concrete implementation of a cryptix.asn1.lang.Node or an cryptix.asn1.lang.ASNObject in a jjtree output structure.

Copyright ©1997, 1998, 1999 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1 $

Author: Raif S. Naffah

Field Summary
protected ASNObject[]children
protected ObjectdefaultValue
The Java object representing the default value for this ASN.1 object if such value is defined in the specification.
protected intid
protected Stringname
Name associated with this ASN.1 object.
protected booleanoptional
True if the ASN.1 object is optional, false otherwise.
protected ASNObjectparent
protected Parserparser
protected Tagtag
Tag associated with this ASN.1 object.
protected Objectvalue
Java object representing the current value of this ASN.1 object when applicable.
Constructor Summary
SimpleNode(int i)
SimpleNode(Parser p, int i)
Method Summary
Objectaccept(ParserVisitor visitor, Object data)
ObjectchildrenAccept(ParserVisitor visitor, Object data)
Accepts the visitor.
voiddump()
voiddump(String prefix)
ASNObjectgetChild(int i)
ASNObject[]getChildren()
ASNObjectgetComponent(String aName)
ObjectgetDefaultValue()
intgetID()
static SimpleNodegetInstance(Parser p, Tag tag)
Returns a new instance given a UNIVERSAL ASN.1 tag instance; null otherwise.
StringgetName()
ASNObjectgetParent()
ParsergetParser()
TaggetTag()
ObjectgetValue()
booleanisOptional()
ObjectjjtAccept(ParserVisitor visitor, Object data)
Accepts the visitor.
voidjjtAddChild(Node n, int i)
voidjjtClose()
NodejjtGetChild(int i)
intjjtGetNumChildren()
NodejjtGetParent()
voidjjtOpen()
voidjjtSetParent(Node n)
voidsetDefaultValue(Object defaultValue)
voidsetName(String name)
Sets the name of this instance.
voidsetOptional(boolean flag)
voidsetTag(Tag tag)
voidsetValue(Object value)
StringtoString()
You can override these two methods in subclasses of SimpleNode to customize the way the node appears when the tree is dumped.
StringtoString(String prefix)

Field Detail

children

protected ASNObject[] children

defaultValue

protected Object defaultValue
The Java object representing the default value for this ASN.1 object if such value is defined in the specification.

id

protected int id

name

protected String name
Name associated with this ASN.1 object.

optional

protected boolean optional
True if the ASN.1 object is optional, false otherwise.

parent

protected ASNObject parent

parser

protected Parser parser

tag

protected Tag tag
Tag associated with this ASN.1 object.

value

protected Object value
Java object representing the current value of this ASN.1 object when applicable. For the Java types used to represent these values see cryptix.asn1.lang.ASNObject.

See Also: ASNObject

Constructor Detail

SimpleNode

public SimpleNode(int i)

SimpleNode

public SimpleNode(Parser p, int i)

Method Detail

accept

public Object accept(ParserVisitor visitor, Object data)

childrenAccept

public Object childrenAccept(ParserVisitor visitor, Object data)
Accepts the visitor.

dump

public void dump()

dump

public void dump(String prefix)

getChild

public ASNObject getChild(int i)

getChildren

public ASNObject[] getChildren()

getComponent

public ASNObject getComponent(String aName)

getDefaultValue

public Object getDefaultValue()

getID

public int getID()

Returns: 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()

Returns: The name associated with this ASN.1 object.

getParent

public ASNObject getParent()

getParser

public Parser getParser()

Returns: The cryptix.asn1.lang.Parser handling this ASN.1 object.

getTag

public Tag getTag()

getValue

public Object getValue()

isOptional

public boolean isOptional()

jjtAccept

public Object jjtAccept(ParserVisitor visitor, Object data)
Accepts the visitor.

jjtAddChild

public void jjtAddChild(Node n, int i)

jjtClose

public void jjtClose()

jjtGetChild

public Node jjtGetChild(int i)

jjtGetNumChildren

public int jjtGetNumChildren()

jjtGetParent

public Node jjtGetParent()

jjtOpen

public void jjtOpen()

jjtSetParent

public void jjtSetParent(Node n)

setDefaultValue

public void setDefaultValue(Object defaultValue)

setName

public void setName(String name)
Sets the name of this instance.

setOptional

public void setOptional(boolean flag)

setTag

public void setTag(Tag tag)

setValue

public void setValue(Object value)

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)