serp.bytecode
Class BCField

java.lang.Object
  extended by serp.bytecode.Attributes
      extended by serp.bytecode.Annotated
          extended by serp.bytecode.BCMember
              extended by serp.bytecode.BCField
All Implemented Interfaces:
BCEntity, VisitAcceptor

public class BCField
extends BCMember
implements VisitAcceptor

A field of a class.

Author:
Abe White

Method Summary
 void acceptVisit(BCVisitor visit)
          Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
 ConstantValue getConstantValue(boolean add)
          Return the constant value information for the field.
 Class getType()
          Return the Class object for the type of this field.
 BCClass getTypeBC()
          Return the bytecode for the type of this field.
 String getTypeName()
          Return the name of the type of this field.
 boolean isEnum()
          Manipulate the field access flags.
 boolean isTransient()
          Manipulate the field access flags.
 boolean isVolatile()
          Manipulate the field access flags.
 boolean removeConstantValue()
          Remove the constant value attribute for the field.
 void setEnum(boolean on)
          Manipulate the field access flags.
 void setTransient(boolean on)
          Manipulate the field access flags.
 void setType(BCClass type)
          Set the type of this field.
 void setType(Class type)
          Set the type of this field.
 void setType(String type)
          Set the name of the type of this field.
 void setVolatile(boolean on)
          Manipulate the field access flags.
 
Methods inherited from class serp.bytecode.BCMember
getAccessFlags, getClassLoader, getDeclarer, getDescriptor, getDescriptorIndex, getName, getNameIndex, getPool, getProject, isDeprecated, isFinal, isPackage, isPrivate, isProtected, isPublic, isStatic, isSynthetic, isValid, makePackage, makePrivate, makeProtected, makePublic, setAccessFlags, setDeprecated, setDescriptor, setDescriptorIndex, setFinal, setName, setNameIndex, setStatic, setSynthetic
 
Methods inherited from class serp.bytecode.Annotated
getDeclaredAnnotations, getDeclaredRuntimeAnnotations, removeDeclaredAnnotations, removeDeclaredRuntimeAnnotations
 
Methods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isVolatile

public boolean isVolatile()
Manipulate the field access flags.


setVolatile

public void setVolatile(boolean on)
Manipulate the field access flags.


isTransient

public boolean isTransient()
Manipulate the field access flags.


setTransient

public void setTransient(boolean on)
Manipulate the field access flags.


isEnum

public boolean isEnum()
Manipulate the field access flags. Defaults to true for fields added to enum classes.


setEnum

public void setEnum(boolean on)
Manipulate the field access flags. Defaults to true for fields added to enum classes.


getTypeName

public String getTypeName()
Return the name of the type of this field. The name will be given in a form suitable for a Class.forName(java.lang.String) call.

See Also:
BCMember.getDescriptor()

getType

public Class getType()
Return the Class object for the type of this field.


getTypeBC

public BCClass getTypeBC()
Return the bytecode for the type of this field.


setType

public void setType(String type)
Set the name of the type of this field.

See Also:
BCMember.setDescriptor(java.lang.String)

setType

public void setType(Class type)
Set the type of this field.

See Also:
BCMember.setDescriptor(java.lang.String)

setType

public void setType(BCClass type)
Set the type of this field.

See Also:
BCMember.setDescriptor(java.lang.String)

getConstantValue

public ConstantValue getConstantValue(boolean add)
Return the constant value information for the field. Acts internally through the Attributes interface.

Parameters:
add - if true, a new constant value attribute will be added if not already present
Returns:
the constant value information, or null if none and the add param is set to false

removeConstantValue

public boolean removeConstantValue()
Remove the constant value attribute for the field. Acts internally through the Attributes interface.

Returns:
true if there was a value to remove

acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: VisitAcceptor
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.

Specified by:
acceptVisit in interface VisitAcceptor


Copyright © 2002-2007. All Rights Reserved.