org.jrubyparser.ast
Class ClassNode

java.lang.Object
  extended by org.jrubyparser.ast.Node
      extended by org.jrubyparser.ast.ClassNode
All Implemented Interfaces:
ILocalScope, IModuleScope, IScope, IScopingNode, ISourcePositionHolder

public class ClassNode
extends Node
implements IScopingNode, ILocalScope, IModuleScope

A class statement (name, superClass, body). Classes bodies also define their own scope.


Constructor Summary
ClassNode(SourcePosition position, Colon3Node cpath, StaticScope scope, Node bodyNode, Node superNode)
           
 
Method Summary
 Object accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 Node getBody()
          Gets the body of this class.
 Node getBodyNode()
          Deprecated. 
 Colon3Node getCPath()
          Gets the className.
 List<MethodDefNode> getMethodDefs()
          Returns a list of all Method Nodes included in the module's ast.
 NodeType getNodeType()
           
 StaticScope getScope()
          Get the static scoping information.
 Node getSuper()
          Gets the superNode.
 Node getSuperNode()
          Deprecated. 
 List<ILocalVariable> getVariableReferencesNamed(String name)
           
 boolean isSame(Node node)
          Checks node for 'sameness' for diffing.
 
Methods inherited from class org.jrubyparser.ast.Node
adopt, adopt, adoptUsingNodesPosition, childNodes, comparePositionWith, createList, getClosestIScope, getClosestModule, getGrandParent, getInlineComment, getInnermostIter, getMethodFor, getNodeAt, getNodeName, getOutermostIter, getParent, getPosition, getPositionIncludingComments, getPreviousComments, insertAfter, insertAll, insertBefore, insertNode, isBlockParameter, isDescendentOf, isLeaf, isMethodParameter, setParent, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassNode

public ClassNode(SourcePosition position,
                 Colon3Node cpath,
                 StaticScope scope,
                 Node bodyNode,
                 Node superNode)
Method Detail

isSame

public boolean isSame(Node node)
Checks node for 'sameness' for diffing.

Overrides:
isSame in class Node
Parameters:
node - to be compared to
Returns:
Returns a boolean

getNodeType

public NodeType getNodeType()
Specified by:
getNodeType in class Node
Returns:
the nodeId

accept

public Object accept(NodeVisitor iVisitor)
Accept for the visitor pattern.

Specified by:
accept in class Node
Parameters:
iVisitor - the visitor

getBody

public Node getBody()
Gets the body of this class.

Returns:
the contents

getBodyNode

@Deprecated
public Node getBodyNode()
Deprecated. 


getScope

public StaticScope getScope()
Get the static scoping information.

Returns:
the scoping info

getCPath

public Colon3Node getCPath()
Gets the className.

Specified by:
getCPath in interface IScopingNode
Returns:
Returns representation of class path+name

getSuper

public Node getSuper()
Gets the superNode.

Returns:
Returns a Node

getSuperNode

@Deprecated
public Node getSuperNode()
Deprecated. 


getMethodDefs

public List<MethodDefNode> getMethodDefs()
Returns a list of all Method Nodes included in the module's ast.

Specified by:
getMethodDefs in interface IModuleScope
Returns:
Returns a List of MethodDefNodes

getVariableReferencesNamed

public List<ILocalVariable> getVariableReferencesNamed(String name)
Specified by:
getVariableReferencesNamed in interface IScope


Copyright © 2013. All Rights Reserved.