com.aptana.ide.parsing.nodes
Interface IParseNode

All Superinterfaces:
IRange
All Known Implementing Classes:
CSSCharSetNode, CSSDeclarationNode, CSSExprNode, CSSImportNode, CSSListNode, CSSMediaNode, CSSMediumNode, CSSPageNode, CSSParseNode, CSSRuleSetNode, CSSSelectorNode, CSSSimpleSelectorNode, CSSTermNode, CSSTextNode, DocumentationNode, GenericCommentNode, HTMLDeclarationNode, HTMLDocumentNode, HTMLElementNode, HTMLParseNode, HTMLSpecialNode, JSBinaryOperatorAssignNode, JSBinaryOperatorNode, JSFunctionNode, JSLabelNode, JSLogicalBinaryOperatorNode, JSNaryAndExpressionNode, JSNaryNode, JSNumericalBinaryOperatorNode, JSNumericalUnaryOperatorNode, JSParseNode, JSPrimitiveNode, JSStringNode, JSTextNode, JSUnaryOperatorNode, JSVarNode, ParseFragment, ParseNodeBase, ParseRootNode, ScriptDocAliasNode, ScriptDocAuthorNode, ScriptDocClassDescriptionNode, ScriptDocConstructorNode, ScriptDocDeprecatedNode, ScriptDocDescriptionNode, ScriptDocExceptionNode, ScriptDocIdNode, ScriptDocKindNode, ScriptDocMemberOfNode, ScriptDocMethodNode, ScriptDocParamNode, ScriptDocParseNode, ScriptDocParseNode, ScriptDocProjectDescriptionNode, ScriptDocReturnNode, ScriptDocSdocNode, ScriptDocSeeNode, ScriptDocSinceNode, ScriptDocTypeNode, ScriptDocVersionNode, UserNode, XMLDeclarationNode, XMLDocumentNode, XMLElementNode, XMLParseNode

public interface IParseNode
extends IRange

Author:
Kevin Lindsey

Method Summary
 void appendChild(IParseNode child)
          Adds a child to the node.
 java.lang.String getAttribute(java.lang.String attributeName)
          getAttributeValue
 IParseNodeAttribute getAttributeNode(java.lang.String attributeName)
          getAttributeNode
 IParseNodeAttribute[] getAttributes()
          getAttributes
 IParseNode getChild(int index)
          Gets the child at the specified index
 int getChildCount()
          Gets the number of children the node has.
 int getChildIndex()
          Gets the index of this node in relation to its siblings.
 IParseNode[] getChildren()
          Gets the children of the node.
 Lexeme getEndingLexeme()
          Gets the ending lexeme of the node.
 java.lang.String getLanguage()
          Gets the language of the node.
 java.lang.String getName()
          Gets the name of the node, if any.
 IParseNode getNodeAtOffset(int offset)
          Find the node that contains the given offset.
 IParseNode getParent()
          Gets the parent of the node.
 java.lang.String getSource()
          Gets the source code representation of this node and its descendants
 void getSource(SourceWriter writer)
          getSource
 Lexeme getStartingLexeme()
          Gets the starting lexeme of the node.
 java.lang.String getText()
          Gets this node's text value.
 int getTypeIndex()
          Gets the node index type
 java.lang.String getXML()
          Gets the xml representation of this node and its descendants
 void getXML(SourceWriter writer)
          getXML
 boolean hasAttribute(java.lang.String attributeName)
          hasAttribute
 boolean hasAttributes()
          hasAttributes
 boolean hasChildren()
          Determine if this node has any child nodes
 void setAttribute(java.lang.String name, java.lang.String value)
          setAttributeValue
 void setEndingLexeme(Lexeme endLexeme)
          Sets the ending lexeme of the node.
 void setName(java.lang.String name)
          Sets the name of the node.
 
Methods inherited from interface com.aptana.ide.lexer.IRange
containsOffset, getEndingOffset, getLength, getStartingOffset, isEmpty
 

Method Detail

appendChild

void appendChild(IParseNode child)
Adds a child to the node.

Parameters:
child -

getAttribute

java.lang.String getAttribute(java.lang.String attributeName)
getAttributeValue

Parameters:
attributeName -
Returns:
String

getAttributeNode

IParseNodeAttribute getAttributeNode(java.lang.String attributeName)
getAttributeNode

Parameters:
attributeName -
Returns:
IParseNodeAttribute

getAttributes

IParseNodeAttribute[] getAttributes()
getAttributes

Returns:
IParseNodeAttribute[]

getChild

IParseNode getChild(int index)
Gets the child at the specified index

Parameters:
index - The index of the child to retrieve
Returns:
Returns the child at the specified index

getChildCount

int getChildCount()
Gets the number of children the node has.

Returns:
Returns the number of children the node has.

getChildIndex

int getChildIndex()
Gets the index of this node in relation to its siblings. The first child begins with index zero

Returns:
Returns this nodes child index

getChildren

IParseNode[] getChildren()
Gets the children of the node.

Returns:
Returns the children of the node.

getEndingLexeme

Lexeme getEndingLexeme()
Gets the ending lexeme of the node.

Returns:
Returns the ending lexeme of the node.

getLanguage

java.lang.String getLanguage()
Gets the language of the node.

Returns:
Returns the language of the node.

getName

java.lang.String getName()
Gets the name of the node, if any.

Returns:
Returns the name of the node, if any.

getNodeAtOffset

IParseNode getNodeAtOffset(int offset)
Find the node that contains the given offset. This method will keep descending the tree until it finds the deepest node that contains the offset

Parameters:
offset - The offset within the source files
Returns:
Returns the deepest node that contains the given offset. Returns null if no node contains the offset

getParent

IParseNode getParent()
Gets the parent of the node.

Returns:
Returns the parent of the node.

getSource

java.lang.String getSource()
Gets the source code representation of this node and its descendants

Returns:
Returns a string representation of this node as source code

getSource

void getSource(SourceWriter writer)
getSource

Parameters:
writer -

getStartingLexeme

Lexeme getStartingLexeme()
Gets the starting lexeme of the node.

Returns:
Returns the starting lexeme of the node.

getText

java.lang.String getText()
Gets this node's text value.

Returns:
Returns the text value of this node

getTypeIndex

int getTypeIndex()
Gets the node index type

Returns:
Returns the unique node index types

getXML

java.lang.String getXML()
Gets the xml representation of this node and its descendants

Returns:
Returns a string representation of this node as source code

getXML

void getXML(SourceWriter writer)
getXML

Parameters:
writer -

hasAttribute

boolean hasAttribute(java.lang.String attributeName)
hasAttribute

Parameters:
attributeName -
Returns:
boolean

hasAttributes

boolean hasAttributes()
hasAttributes

Returns:
boolean

hasChildren

boolean hasChildren()
Determine if this node has any child nodes

Returns:
Returns true if this node has one or more children

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.String value)
setAttributeValue

Parameters:
name -
value -

setEndingLexeme

void setEndingLexeme(Lexeme endLexeme)
Sets the ending lexeme of the node.

Parameters:
endLexeme -

setName

void setName(java.lang.String name)
Sets the name of the node.

Parameters:
name -