edu.ksu.cis.projects.bogor.ast
Class ExtensionDefinition

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.SystemMember
          extended by edu.ksu.cis.projects.bogor.ast.Definition
              extended by edu.ksu.cis.projects.bogor.ast.ExtensionDefinition
All Implemented Interfaces:
Disposable, Serializable, Cloneable

public final class ExtensionDefinition
extends Definition

Extension definition AST.

Version:
CVS $Revision: 1.9 $ $Date: 2005/05/06 17:25:17 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
ExtensionDefinition(String id, String name, List<? extends Extension> extensions)
          Default constructor.
 
Method Summary
 ExtensionDefinition clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to id and name, and disposes extensions.
 Extension getExtension(int index)
          Gets a extension at a specified index.
 int getExtensionCount()
          Gets the number of extensions.
 String getId()
          Gets the id.
 String getName()
          Gets the fully qualified Java class name.
 void setExtensions(List<? extends Extension> newExtensions)
          Sets the extensions.
 void setId(String newId)
          Sets the id.
 void setName(String newName)
          Sets the fully qualified Java class name.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.SystemMember
getParent, setParent
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionDefinition

public ExtensionDefinition(String id,
                           String name,
                           List<? extends Extension> extensions)
Default constructor. Set this object as each extension's parent.

Parameters:
id - The id. Must be non-null.
name - The fully qualified Java class name. Must be non-null.
extensions - The extensions. Must be non-null. Each element must be instance of Extension.
Method Detail

getExtension

public Extension getExtension(int index)
Gets a extension at a specified index.

Parameters:
index - The index of the constant. Must be between 0 and getExtensionCount() - 1, inclusive.
Returns:
The extension at the specified index.

getExtensionCount

public int getExtensionCount()
Gets the number of extensions.

Returns:
The number of extensions.

setExtensions

public void setExtensions(List<? extends Extension> newExtensions)
Sets the extensions. Set this object as each extension's parent.

Parameters:
newExtensions - The new extensions. Must be non-null. Each element must be instance of Extension.

setId

public void setId(String newId)
Sets the id.

Parameters:
newId - The new id. Must be non-null.

getId

public String getId()
Gets the id.

Returns:
The id. Non-null.

setName

public void setName(String newName)
Sets the fully qualified Java class name.

Parameters:
newName - The fully qualified Java class name. Must be non-null.

getName

public String getName()
Gets the fully qualified Java class name.

Returns:
The the fully qualified Java class name. Non-null.

clone

public ExtensionDefinition clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Definition
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes reference to id and name, and disposes extensions. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class SystemMember

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
"extension id for name { ( extension )* }".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node