ca.ubc.cs.elide.nodes
Class FieldNode
java.lang.Object
|
+--ca.ubc.cs.elide.nodes.ParseNode
|
+--ca.ubc.cs.elide.nodes.ChildBearingNode
|
+--ca.ubc.cs.elide.nodes.ModifierBearingNode
|
+--ca.ubc.cs.elide.nodes.FieldNode
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class FieldNode
- extends ModifierBearingNode
FieldNode
objects represent fields of classes.
FieldNode
s can be created by calling NodeFactory.createField(java.lang.String)
or by extending a class with new fields (see ClassNode.extend(java.lang.String)
)
- See Also:
- Serialized Form
Method Summary |
java.lang.String |
getInitializer()
Returns a String representing the initialization statement
for the field represented by this FieldNode object. |
java.lang.String |
getType()
Returns a String representing the type of the field represented
by this FieldNode object. |
void |
setInitializer(java.lang.String initializer)
Sets the initializer of the field represented by this FieldNode object
to the specified String . |
void |
setType(java.lang.String type)
Sets the type of the field represented by this FieldNode object. |
Methods inherited from class ca.ubc.cs.elide.nodes.ModifierBearingNode |
getModifiers, makeDefaultAccess, makePrivate, makeProtected, makePublic, setAbstract, setFinal, setNative, setStatic, setSynchronized, setTransient, setVolatile |
Methods inherited from class ca.ubc.cs.elide.nodes.ParseNode |
findType, get, getComment, getDeclaringClass, getName, getPackage, getParent, getRoot, put, registerType, setComment, setName, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FieldNode
public FieldNode()
FieldNode
public FieldNode(java.lang.String name,
java.lang.String type)
getType
public java.lang.String getType()
- Returns a
String
representing the type of the field represented
by this FieldNode
object.
setType
public void setType(java.lang.String type)
- Sets the type of the field represented by this
FieldNode
object.
This method does not check whether the string provided names a valid type
in the field's context.
getInitializer
public java.lang.String getInitializer()
- Returns a
String
representing the initialization statement
for the field represented by this FieldNode
object.
An example would be = new HashMap()
Returns an empty string if no intializer was provided.
setInitializer
public void setInitializer(java.lang.String initializer)
- Sets the initializer of the field represented by this
FieldNode
object
to the specified String
.