org.zkoss.zuss.metainfo
Class FunctionDefinition

java.lang.Object
  extended by org.zkoss.zuss.metainfo.FunctionDefinition
All Implemented Interfaces:
java.io.Serializable, NodeInfo

public class FunctionDefinition
extends java.lang.Object

Represents a function definition.

Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
FunctionDefinition(NodeInfo parent, java.lang.String name, ArgumentDefinition[] args, Expression expr, int lineno)
           
FunctionDefinition(NodeInfo parent, java.lang.String name, ArgumentDefinition[] args, java.lang.reflect.Method mtd, int lineno)
           
 
Method Summary
 void appendChild(NodeInfo child)
          Append a child
 ArgumentDefinition[] getArgumentDefinitions()
          Returns the argument definitions.
 java.util.List<NodeInfo> getChildren()
          Returns a readonly list of children.
 Expression getExpression()
          Returns the expression, or null if this is a method (getMethod()).
 int getLine()
          Returns the line number of this info.
 java.lang.reflect.Method getMethod()
          Returns the method, or null if this is an expression (getExpression()).
 java.lang.String getName()
          Returns the name of this function definition.
 NodeInfo getParent()
          Returns the parent, or null if it is the root.
 boolean removeChild(NodeInfo child)
          Removes a child.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionDefinition

public FunctionDefinition(NodeInfo parent,
                          java.lang.String name,
                          ArgumentDefinition[] args,
                          Expression expr,
                          int lineno)

FunctionDefinition

public FunctionDefinition(NodeInfo parent,
                          java.lang.String name,
                          ArgumentDefinition[] args,
                          java.lang.reflect.Method mtd,
                          int lineno)
Method Detail

getName

public java.lang.String getName()
Returns the name of this function definition.


getExpression

public Expression getExpression()
Returns the expression, or null if this is a method (getMethod()).


getMethod

public java.lang.reflect.Method getMethod()
Returns the method, or null if this is an expression (getExpression()).


getArgumentDefinitions

public ArgumentDefinition[] getArgumentDefinitions()
Returns the argument definitions.


toString

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

getLine

public int getLine()
Description copied from interface: NodeInfo
Returns the line number of this info.

Specified by:
getLine in interface NodeInfo

getParent

public NodeInfo getParent()
Description copied from interface: NodeInfo
Returns the parent, or null if it is the root.

Specified by:
getParent in interface NodeInfo

getChildren

public java.util.List<NodeInfo> getChildren()
Description copied from interface: NodeInfo
Returns a readonly list of children.

Note: the returned list is readonly. To modify, please use NodeInfo.appendChild(org.zkoss.zuss.metainfo.NodeInfo) and NodeInfo.removeChild(org.zkoss.zuss.metainfo.NodeInfo) instead.

Specified by:
getChildren in interface NodeInfo

appendChild

public void appendChild(NodeInfo child)
Description copied from interface: NodeInfo
Append a child

Specified by:
appendChild in interface NodeInfo

removeChild

public boolean removeChild(NodeInfo child)
Description copied from interface: NodeInfo
Removes a child.

Specified by:
removeChild in interface NodeInfo


Copyright © 2005-2010 Potix Corporation. All Rights Reserved.