openjava.ptree
Class FieldDeclaration

java.lang.Object
  |
  +--openjava.ptree.ParseTreeObject
        |
        +--openjava.ptree.NonLeaf
              |
              +--openjava.ptree.FieldDeclaration
All Implemented Interfaces:
Cloneable, MemberDeclaration, ParseTree

public class FieldDeclaration
extends NonLeaf
implements MemberDeclaration

The FieldDeclaration class presents for node of parse tree. FieldDeclaration := ModifierList TypeName VariableDeclarator SEMI


Field Summary
private  Hashtable suffixes
           
 
Fields inherited from class openjava.ptree.NonLeaf
 
Fields inherited from class openjava.ptree.ParseTreeObject
debugFlag, debugLevel, LN, out, writerStack
 
Fields inherited from interface openjava.ptree.MemberDeclaration
CONSTRUCTOR, FIELD, METHOD, STATICINIT, STATICINITIALIZER, TYPE
 
Constructor Summary
(package private) FieldDeclaration()
          Is needed for recursive copy.
  FieldDeclaration(ModifierList e0, TypeName e1, String e2, VariableInitializer e3)
           
  FieldDeclaration(ModifierList e0, TypeName e1, VariableDeclarator e2)
          Allocates this object
 
Method Summary
 void accept(ParseTreeVisitor v)
          Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.
 VariableInitializer getInitializer()
          Gets variable initializer of this field.
 ModifierList getModifiers()
          Gets modifier list of this field.
 String getName()
          Deprecated.  
 Hashtable getSuffixes()
           
 TypeName getTypeSpecifier()
          Gets type specifier of this field variable.
 String getVariable()
          Gets variable name of this field.
 VariableDeclarator getVariableDeclarator()
          Deprecated.  
private  VariableDeclarator getVariableDeclaratorImpl()
           
 void setInitializer(VariableInitializer vinit)
          Gets variable initializer of this field.
 void setModifiers(ModifierList modifs)
          Sets modifier list of this field.
 void setSuffixes(Hashtable suffixes)
           
 void setTypeSpecifier(TypeName tspec)
          Sets type specifier of this field variable.
 void setVariable(String name)
          Sets variable name of this field.
 void setVariableDeclarator(VariableDeclarator vdeclr)
          Deprecated.  
 void writeCode()
          Overrides writing code method
 
Methods inherited from class openjava.ptree.NonLeaf
childrenAccept, childrenAreEqual, elementAt, equals, getComment, getContents, getLength, getRowType, makeRecursiveCopy, replaceChildWith, set, set, set, set, set, set, set, set, set, setComment, setElementAt
 
Methods inherited from class openjava.ptree.ParseTreeObject
clone, eq, eq, equal, flushPrintWriter, getDebugFlag, getNest, getObjectID, getParent, getPrintWriter, getTab, hashCode, lastObjectID, makeCopy, popNest, popPrintWriter, pushNest, pushPrintWriter, replace, setDebugFlag, setDebugLevel, setNest, setParent, setPrintStream, setTab, toFlattenString, toString, writeDebug, writeDebugL, writeDebugLln, writeDebugln, writeDebugLR, writeDebugR, writeDebugRln, writeTab
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface openjava.ptree.MemberDeclaration
eq, equals
 
Methods inherited from interface openjava.ptree.ParseTree
childrenAccept, getObjectID, makeCopy, makeRecursiveCopy, replace, toFlattenString, toString
 

Field Detail

suffixes

private Hashtable suffixes
Constructor Detail

FieldDeclaration

public FieldDeclaration(ModifierList e0,
                        TypeName e1,
                        VariableDeclarator e2)
Allocates this object


FieldDeclaration

public FieldDeclaration(ModifierList e0,
                        TypeName e1,
                        String e2,
                        VariableInitializer e3)

FieldDeclaration

FieldDeclaration()
Is needed for recursive copy.

Method Detail

writeCode

public void writeCode()
Overrides writing code method

Specified by:
writeCode in interface MemberDeclaration
Overrides:
writeCode in class NonLeaf

getModifiers

public ModifierList getModifiers()
Gets modifier list of this field.

Returns:
modifier list. if there is no modifiers, this returns an empty list.

setModifiers

public void setModifiers(ModifierList modifs)
Sets modifier list of this field.

Parameters:
modifs - modifiers to set

getTypeSpecifier

public TypeName getTypeSpecifier()
Gets type specifier of this field variable. Any modification on obtained objects is never reflected on this object.

Returns:
the type specifier for this field.

setTypeSpecifier

public void setTypeSpecifier(TypeName tspec)
Sets type specifier of this field variable.

Parameters:
tspec - type specifier to set

getVariableDeclarator

public VariableDeclarator getVariableDeclarator()
Deprecated.  

Gets variable declarator of this field

Returns:
variable declarator
See Also:
VariableDeclarator

getVariableDeclaratorImpl

private VariableDeclarator getVariableDeclaratorImpl()

setVariableDeclarator

public void setVariableDeclarator(VariableDeclarator vdeclr)
Deprecated.  

Sets type specifier of this field variable.

Parameters:
vdeclr - variable declarator to set

getVariable

public String getVariable()
Gets variable name of this field.

Returns:
identifier of field variable

getName

public String getName()
Deprecated.  

Gets variable name of this field.

Returns:
identifier of field variable

setVariable

public void setVariable(String name)
Sets variable name of this field.

Parameters:
name - identifier of field variable

getInitializer

public VariableInitializer getInitializer()
Gets variable initializer of this field.

Returns:
variable initializer

setInitializer

public void setInitializer(VariableInitializer vinit)
Gets variable initializer of this field.

Parameters:
vinit - variable initializer

setSuffixes

public void setSuffixes(Hashtable suffixes)

getSuffixes

public Hashtable getSuffixes()

accept

public void accept(ParseTreeVisitor v)
            throws ParseTreeException
Description copied from interface: ParseTree
Accepts a ParseTreeVisitor object as the role of a Visitor in the Visitor pattern, as the role of an Element in the Visitor pattern.

This invoke an appropriate visit() method on the accepted visitor.

Specified by:
accept in interface ParseTree
Specified by:
accept in class ParseTreeObject
Parameters:
v - a visitor
ParseTreeException

SourceForge.net_Logo