com.claritysys.jvm.classfile
Class CfEntry

java.lang.Object
  extended by com.claritysys.jvm.classfile.CfEntry
Direct Known Subclasses:
CfFieldOrMethod, ClassFile

public abstract class CfEntry
extends java.lang.Object

An entry of a classfile, i.e. a Class, Method, or Field - all of which have an "access_flags" attribute describing public, protected, native, static, etc. Also, each of this is a container for attributes.

Convenience methods are provided for testing and setting individual bits within the field.


Constructor Summary
CfEntry()
          Create a new entry with no initial value for the access flags.
CfEntry(int accessFlags)
          Create a new entry with the given access flags.
 
Method Summary
 int getAccessFlags()
          Return the access flags, as an int.
 int getAttributeCount()
          Count the number of Attributes in getAttributes.
 Attribute getAttributes()
          Return the optional linked list of unknown attributes.
 boolean isAbstract()
          Return whether the ACC_ABSTRACT access flag is set.
 boolean isDeprecated()
          Return whether the member is deprecated.
 boolean isFinal()
          Return whether the ACC_FINAL access flag is set.
 boolean isInterface()
          Return whether the ACC_INTERFACE access flag is set.
 boolean isNative()
          Return whether the ACC_NATIVE access flag is set.
 boolean isPrivate()
          Return whether the ACC_PRIVATE flag is set.
 boolean isProtected()
          Return whether the ACC_PROTECTED access flag is set.
 boolean isPublic()
          Return whether the ACC_PUBLIC flag is set.
 boolean isStatic()
          Return whether the ACC_STATIC access flag is set.
 boolean isStrict()
          Return whether the ACC_STRICT access flag is set.
 boolean isSynchronized()
          Return whether the ACC_SYNCHRONIZED access flag is set.
 boolean isTransient()
          Return whether the ACC_TRANSIENT access flag is set.
 boolean isVolatile()
          Return whether the ACC_VOLATILE access flag is set.
 void setAbstract(boolean flag)
          Set or clear the ACC_ABSTRACT access flag.
 void setAccessFlags(int accessFlags)
          Set the access flags, overriding any previously set flags.
 void setAttributes(Attribute attributes)
          Set optional linked list of unknown attributes.
 void setDeprecated(boolean deprecated)
          Set whether the member is deprecated.
 void setFinal(boolean flag)
          Set or clear the ACC_FINAL access flag.
 void setInterface(boolean flag)
          Set or clear the ACC_INTERFACE access flag.
 void setNative(boolean flag)
          Set or clear the ACC_NATIVE access flag.
 void setPrivate(boolean flag)
          Set or clear the ACC_PRIVATE access flag.
 void setProtected(boolean flag)
          Set or clear the ACC_PROTECTED access flag.
 void setPublic(boolean flag)
          Set or clear the ACC_PUBLIC access flag.
 void setStatic(boolean flag)
          Set or clear the ACC_STATIC access flag.
 void setStrict(boolean flag)
          Set or clear the ACC_STRICT access flag.
 void setSynchronized(boolean flag)
          Set or clear the ACC_SYNCHRONIZED access flag.
 void setTransient(boolean flag)
          Set or clear the ACC_TRANSIENT access flag.
 void setVolatile(boolean flag)
          Set or clear the ACC_VOLATILE access flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CfEntry

public CfEntry()
Create a new entry with no initial value for the access flags.


CfEntry

public CfEntry(int accessFlags)
Create a new entry with the given access flags.

Method Detail

getAccessFlags

public final int getAccessFlags()
Return the access flags, as an int.

The access flags is a union of JVM.ACC_XXX values.


setAccessFlags

public final void setAccessFlags(int accessFlags)
Set the access flags, overriding any previously set flags.

Use the constant JVM.ACC_XXX values, for example:

   setAccessFlags (JVM.ACC_PUBLIC | JVM.ACC_FINAL);
 


setPublic

public final void setPublic(boolean flag)
Set or clear the ACC_PUBLIC access flag.


isPublic

public final boolean isPublic()
Return whether the ACC_PUBLIC flag is set.


setPrivate

public final void setPrivate(boolean flag)
Set or clear the ACC_PRIVATE access flag.


isPrivate

public final boolean isPrivate()
Return whether the ACC_PRIVATE flag is set.


setProtected

public final void setProtected(boolean flag)
Set or clear the ACC_PROTECTED access flag.


isProtected

public final boolean isProtected()
Return whether the ACC_PROTECTED access flag is set.


setStatic

public final void setStatic(boolean flag)
Set or clear the ACC_STATIC access flag.


isStatic

public final boolean isStatic()
Return whether the ACC_STATIC access flag is set.


setFinal

public final void setFinal(boolean flag)
Set or clear the ACC_FINAL access flag.


isFinal

public final boolean isFinal()
Return whether the ACC_FINAL access flag is set.


setSynchronized

public final void setSynchronized(boolean flag)
Set or clear the ACC_SYNCHRONIZED access flag.


isSynchronized

public final boolean isSynchronized()
Return whether the ACC_SYNCHRONIZED access flag is set.


setVolatile

public final void setVolatile(boolean flag)
Set or clear the ACC_VOLATILE access flag.


isVolatile

public final boolean isVolatile()
Return whether the ACC_VOLATILE access flag is set.


setTransient

public final void setTransient(boolean flag)
Set or clear the ACC_TRANSIENT access flag.


isTransient

public final boolean isTransient()
Return whether the ACC_TRANSIENT access flag is set.


setNative

public final void setNative(boolean flag)
Set or clear the ACC_NATIVE access flag.


isNative

public final boolean isNative()
Return whether the ACC_NATIVE access flag is set.


setInterface

public final void setInterface(boolean flag)
Set or clear the ACC_INTERFACE access flag.


isInterface

public final boolean isInterface()
Return whether the ACC_INTERFACE access flag is set.


setAbstract

public final void setAbstract(boolean flag)
Set or clear the ACC_ABSTRACT access flag.


isAbstract

public final boolean isAbstract()
Return whether the ACC_ABSTRACT access flag is set.


setStrict

public final void setStrict(boolean flag)
Set or clear the ACC_STRICT access flag.


isStrict

public final boolean isStrict()
Return whether the ACC_STRICT access flag is set.


isDeprecated

public boolean isDeprecated()
Return whether the member is deprecated.

In the classfile this is represented by an attribute.

Returns:
whether the member is deprecated.

setDeprecated

public void setDeprecated(boolean deprecated)
Set whether the member is deprecated.

In the classfile this is represented by an attribute.

Parameters:
deprecated - whether the member is deprecated.

getAttributes

public Attribute getAttributes()
Return the optional linked list of unknown attributes.

Returns:
optional linked list of unknown attributes.

setAttributes

public void setAttributes(Attribute attributes)
Set optional linked list of unknown attributes.

Parameters:
attributes - optional linked list of unknown attributes.

getAttributeCount

public int getAttributeCount()
Count the number of Attributes in getAttributes.

Returns:
count of Attributes, >= 0.


Copyright ? 2000-2003 Clarity Systems Group, LLC. All Rights Reserved.