org.owasp.orizon.mirage.java.parser
Class BaseNode

java.lang.Object
  extended by org.owasp.orizon.mirage.java.parser.BaseNode
All Implemented Interfaces:
JavaConstants, Node
Direct Known Subclasses:
AllocationExpression, Annotation, AnnotationTypeBody, AnnotationTypeMemberDeclaration, ArrayDimsAndInits, ArrayInitializer, AssertStatement, BreakStatement, CastLookahead, CatchBlock, ClassOrInterfaceBody, ClassOrInterfaceBodyDeclaration, CodeBlock, CompilationUnit, ConstructorDeclaration, ContinueStatement, DefaultValue, DoStatement, EmptyStatement, EnumBody, EnumConstant, ExplicitConstructorInvocation, Expression, ExtendsList, FieldDeclaration, FinallyBlock, ForInit, FormalParameter, FormalParams, ForStatement, ForUpdate, IfStatement, ImplementsList, ImportDeclaration, Initializer, IntegerLiteral, InvocationArgs, LabeledStatement, LocalVariableDeclaration, MemberSelector, MemberValue, MemberValueArrayInitializer, MemberValuePair, MemberValuePairs, MethodDeclaration, Name, ObjectType, PackageDeclaration, PrimaryPrefix, PrimarySuffix, PrimitiveArrayType, ReferenceType, ReturnStatement, ReturnType, StatementExpression, StatementExpressionList, SwitchLabel, SwitchStatement, SynchronizedStatement, ThrowsList, ThrowStatement, TryStatement, Type, TypeArgument, TypeArguments, TypeBound, TypeDeclaration, TypeParameter, TypeParameterList, VariableDeclarator, VariableDeclaratorId, VariableInitializer, WhileStatement, WildcardBounds

public class BaseNode
extends java.lang.Object
implements Node, JavaConstants


Field Summary
protected  java.util.List<Node> children
           
 int id
           
protected  Node parent
           
 
Fields inherited from interface org.owasp.orizon.mirage.java.parser.JavaConstants
_DEFAULT, ABSTRACT, ADDITIVEEXPRESSION, ALLOCATIONEXPRESSION, ANDASSIGN, ANDEXPRESSION, ANNOTATION, ANNOTATIONTYPEBODY, ANNOTATIONTYPEMEMBERDECLARATION, ARRAYDIMSANDINITS, ARRAYINITIALIZER, ASSERT, ASSERTSTATEMENT, ASSIGN, ASSIGNMENTEXPRESSION, BANG, BIT_AND, BIT_OR, BOOLEAN, BREAK, BREAKSTATEMENT, BYTE, CASE, CASTEXPRESSION, CASTLOOKAHEAD, CATCH, CATCHBLOCK, CHAR, CHARACTER_LITERAL, CLASS, CLASSORINTERFACEBODY, CLASSORINTERFACEBODYDECLARATION, CODEBLOCK, COLON, COMMA, COMPILATIONUNIT, CONDITIONALANDEXPRESSION, CONDITIONALOREXPRESSION, CONST, CONSTRUCTORDECLARATION, CONTINUE, CONTINUESTATEMENT, DECIMAL_EXPONENT, DECIMAL_FLOATING_POINT_LITERAL, DECIMAL_LITERAL, DECR, DEFAULT, DEFAULTVALUE, DO, DOSTATEMENT, DOT, DOUBLE, ELSE, EMPTYSTATEMENT, ENUM, ENUMBODY, ENUMCONSTANT, EOF, EQ, EQUALITYEXPRESSION, EXCLUSIVEOREXPRESSION, EXPLICITCONSTRUCTORINVOCATION, EXPRESSION, EXTENDS, EXTENDSLIST, FALSE, FIELDDECLARATION, FINAL, FINALLY, FINALLYBLOCK, FLOAT, FLOATING_POINT_LITERAL, FOR, FORINIT, FORMAL_COMMENT, FORMALPARAMETER, FORMALPARAMS, FORSTATEMENT, FORUPDATE, GE, GOTO, GT, HEX_LITERAL, HEXADECIMAL_EXPONENT, HEXADECIMAL_FLOATING_POINT_LITERAL, HOOK, IDENTIFIER, IF, IFSTATEMENT, IMPLEMENTS, IMPLEMENTSLIST, IMPORT, IMPORTDECLARATION, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCLUSIVEOREXPRESSION, INCR, INITIALIZER, INSTANCEOF, INSTANCEOFEXPRESSION, INT, INTEGER_LITERAL, INTEGERLITERAL, INTERFACE, INVOCATIONARGS, LABELEDSTATEMENT, LBRACE, LBRACKET, LE, LETTER, LOCALVARIABLEDECLARATION, LONG, LPAREN, LSHIFT, LSHIFTASSIGN, LT, MEMBERSELECTOR, MEMBERVALUE, MEMBERVALUEARRAYINITIALIZER, MEMBERVALUEPAIR, MEMBERVALUEPAIRS, METHODDECLARATION, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, MULTIPLICATIVEEXPRESSION, NAME, NATIVE, NE, NEW, nodeNames, NULL, OBJECTTYPE, OCTAL_LITERAL, ORASSIGN, PACKAGE, PACKAGEDECLARATION, PART_LETTER, PLUS, PLUSASSIGN, POSTFIXEXPRESSION, PREDECREMENTEXPRESSION, PREINCREMENTEXPRESSION, PRIMARYEXPRESSION, PRIMARYPREFIX, PRIMARYSUFFIX, PRIMITIVEARRAYTYPE, PRIVATE, PROTECTED, PUBLIC, RBRACE, RBRACKET, REFERENCETYPE, RELATIONALEXPRESSION, REM, REMASSIGN, RETURN, RETURNSTATEMENT, RETURNTYPE, RPAREN, RSIGNEDSHIFT, RSIGNEDSHIFTASSIGN, RUNSIGNEDSHIFT, RUNSIGNEDSHIFTASSIGN, SC_AND, SC_OR, SEMICOLON, SHIFTEXPRESSION, SHORT, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STATEMENTEXPRESSION, STATEMENTEXPRESSIONLIST, STATIC, STRICTFP, STRING_LITERAL, SUPER, SWITCH, SWITCHLABEL, SWITCHSTATEMENT, SYNCHRONIZED, SYNCHRONIZEDSTATEMENT, TERNARYEXPRESSION, THIS, THROW, THROWS, THROWSLIST, THROWSTATEMENT, TILDE, tokenImage, TRANSIENT, TRUE, TRY, TRYSTATEMENT, TYPE, TYPEARGUMENT, TYPEARGUMENTS, TYPEBOUND, TYPEDECLARATION, TYPEPARAMETER, TYPEPARAMETERLIST, UNARYEXPRESSION, UNARYEXPRESSIONNOTPLUSMINUS, VARIABLEDECLARATOR, VARIABLEDECLARATORID, VARIABLEINITIALIZER, VOID, VOLATILE, WHILE, WHILESTATEMENT, WHITESPACE, WILDCARDBOUNDS, XOR, XORASSIGN
 
Constructor Summary
BaseNode(int id)
           
 
Method Summary
 void addChild(int i, Node n)
           
 void addChild(Node n)
           
 void clearChildren()
           
 void close()
          Life-cycle hook method called after all the child nodes have been added.
 java.lang.String getAsString()
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Set<java.lang.String> getAttributeNames()
           
 int getBeginColumn()
           
 int getBeginLine()
           
 Node getChild(int i)
           
 int getChildCount()
           
 int getEndColumn()
           
 int getEndLine()
           
 int getId()
           
protected  java.lang.String getInnerText()
           
 java.lang.String getInputSource()
           
protected  java.lang.String getLiteralText()
           
 Node getParent()
           
 boolean hasAttribute(java.lang.String name)
           
 int indexOf(Node n)
           
 boolean isEmpty()
           
 java.util.ListIterator<Node> iterator()
           
 void open()
          Life-cycle hook method called after the node has been made the current node
 void prepend(Node n)
           
 Node removeChild(int i)
           
 boolean removeChild(Node n)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setBeginColumn(int beginColumn)
           
 void setBeginLine(int beginLine)
           
 void setChild(int i, Node n)
           
 void setEndColumn(int endColumn)
           
 void setEndLine(int endLine)
           
 void setInputSource(java.lang.String inputSource)
           
static void setListClass(java.lang.Class<? extends java.util.List> listClass)
           
 void setParent(Node n)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final int id

parent

protected Node parent

children

protected java.util.List<Node> children
Constructor Detail

BaseNode

public BaseNode(int id)
Method Detail

getId

public int getId()
Specified by:
getId in interface Node

getLiteralText

protected java.lang.String getLiteralText()

getInnerText

protected java.lang.String getInnerText()

iterator

public java.util.ListIterator<Node> iterator()

prepend

public void prepend(Node n)

getAsString

public java.lang.String getAsString()

isEmpty

public boolean isEmpty()

setListClass

public static void setListClass(java.lang.Class<? extends java.util.List> listClass)

open

public void open()
Description copied from interface: Node
Life-cycle hook method called after the node has been made the current node

Specified by:
open in interface Node

close

public void close()
Description copied from interface: Node
Life-cycle hook method called after all the child nodes have been added.

Specified by:
close in interface Node

setParent

public void setParent(Node n)
Specified by:
setParent in interface Node

getParent

public Node getParent()
Specified by:
getParent in interface Node

addChild

public void addChild(Node n)
Specified by:
addChild in interface Node

addChild

public void addChild(int i,
                     Node n)
Specified by:
addChild in interface Node

getChild

public Node getChild(int i)
Specified by:
getChild in interface Node

setChild

public void setChild(int i,
                     Node n)
Specified by:
setChild in interface Node

removeChild

public Node removeChild(int i)
Specified by:
removeChild in interface Node

removeChild

public boolean removeChild(Node n)
Specified by:
removeChild in interface Node

indexOf

public int indexOf(Node n)
Specified by:
indexOf in interface Node

clearChildren

public void clearChildren()
Specified by:
clearChildren in interface Node

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface Node

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface Node

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface Node

hasAttribute

public boolean hasAttribute(java.lang.String name)
Specified by:
hasAttribute in interface Node

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Specified by:
getAttributeNames in interface Node

setInputSource

public void setInputSource(java.lang.String inputSource)
Specified by:
setInputSource in interface Node

getInputSource

public java.lang.String getInputSource()
Specified by:
getInputSource in interface Node
Returns:
A string that says where the input came from. Typically a file name, though it could be a URL or something else, of course.

getBeginLine

public int getBeginLine()
Specified by:
getBeginLine in interface Node

getEndLine

public int getEndLine()
Specified by:
getEndLine in interface Node

getBeginColumn

public int getBeginColumn()
Specified by:
getBeginColumn in interface Node

getEndColumn

public int getEndColumn()
Specified by:
getEndColumn in interface Node

setBeginLine

public void setBeginLine(int beginLine)
Specified by:
setBeginLine in interface Node

setEndLine

public void setEndLine(int endLine)
Specified by:
setEndLine in interface Node

setBeginColumn

public void setBeginColumn(int beginColumn)
Specified by:
setBeginColumn in interface Node

setEndColumn

public void setEndColumn(int endColumn)
Specified by:
setEndColumn in interface Node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object