koala.dynamicjava.tree
Class AnonymousAllocation

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Expression
          extended by koala.dynamicjava.tree.PrimaryExpression
              extended by koala.dynamicjava.tree.SimpleAllocation
                  extended by koala.dynamicjava.tree.AnonymousAllocation
All Implemented Interfaces:
SourceInfo.Wrapper, StatementExpression

public class AnonymousAllocation
extends SimpleAllocation
implements StatementExpression

This class represents the anonymous class allocation nodes of the syntax tree. Nodes are derived from syntax like "new Foo(x, y+3, z.method()) { void bar() {} }"

Version:
1.0 - 1999/04/25
Author:
Stephane Hillion

Constructor Summary
AnonymousAllocation(Option<java.util.List<TypeName>> targs, ReferenceTypeName tp, java.util.List<? extends Expression> args, java.util.List<Node> memb)
          Initializes the expression
AnonymousAllocation(Option<java.util.List<TypeName>> targs, ReferenceTypeName tp, java.util.List<? extends Expression> args, java.util.List<Node> memb, SourceInfo si)
          Initializes the expression
AnonymousAllocation(ReferenceTypeName tp, java.util.List<? extends Expression> args, java.util.List<Node> memb)
          Initializes the expression
AnonymousAllocation(ReferenceTypeName tp, java.util.List<? extends Expression> args, java.util.List<Node> memb, SourceInfo si)
          Initializes the expression
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 java.util.List<Node> getMembers()
          Returns the members of the anonymous class
 void setMembers(java.util.List<Node> l)
          Sets the members of the anonymous class
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.SimpleAllocation
getArguments, getCreationType, getTypeArgs, setArguments, setCreationType, setTypeArgs, setTypeArgs
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnonymousAllocation

public AnonymousAllocation(ReferenceTypeName tp,
                           java.util.List<? extends Expression> args,
                           java.util.List<Node> memb)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor. Can be null.
memb - the members of the class
Throws:
java.lang.IllegalArgumentException - if tp is null or memb is null

AnonymousAllocation

public AnonymousAllocation(Option<java.util.List<TypeName>> targs,
                           ReferenceTypeName tp,
                           java.util.List<? extends Expression> args,
                           java.util.List<Node> memb)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor. Can be null.
memb - the members of the class
Throws:
java.lang.IllegalArgumentException - if tp is null or memb is null

AnonymousAllocation

public AnonymousAllocation(ReferenceTypeName tp,
                           java.util.List<? extends Expression> args,
                           java.util.List<Node> memb,
                           SourceInfo si)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor. null if no arguments.
memb - the members of the class
Throws:
java.lang.IllegalArgumentException - if tp is null or memb is null

AnonymousAllocation

public AnonymousAllocation(Option<java.util.List<TypeName>> targs,
                           ReferenceTypeName tp,
                           java.util.List<? extends Expression> args,
                           java.util.List<Node> memb,
                           SourceInfo si)
Initializes the expression

Parameters:
tp - the type prefix
args - the arguments of the constructor. null if no arguments.
memb - the members of the class
Throws:
java.lang.IllegalArgumentException - if tp is null or memb is null
Method Detail

getMembers

public java.util.List<Node> getMembers()
Returns the members of the anonymous class


setMembers

public void setMembers(java.util.List<Node> l)
Sets the members of the anonymous class

Throws:
java.lang.IllegalArgumentException - if t is null

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Overrides:
acceptVisitor in class SimpleAllocation
Parameters:
visitor - the visitor to accept

toString

public java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class SimpleAllocation