edu.wisc.cs.java
Class Accessible

java.lang.Object
  |
  +--edu.wisc.cs.java.Accessible
Direct Known Subclasses:
ClassFile, FieldInfo, MethodInfo

public abstract class Accessible
extends java.lang.Object

This is the superclass of the ClassFile, MethodInfo, and FieldInfo classes. It provides an interface for dealing which objects which have associated access flags. For more information on the access flags provided as constants in this class, see the Java Language and Java Virtual Machine specifications. Note that this is an abstract class, and as such it is not instantiable.


Field Summary
static int ACC_ABSTRACT
          Set by all interfaces and some classes to indicate that the type is abstract.
static int ACC_FINAL
          Indicates the final property.
static int ACC_INTERFACE
          Indicates that the type is an interface.
static int ACC_NATIVE
          Indicates that this methods is native.
static int ACC_PRIVATE
          Indicates private access.
static int ACC_PROTECTED
          Indicates protected access.
static int ACC_PUBLIC
          Used to indicate public access.
static int ACC_STATIC
          Indicates that the member is static.
static int ACC_SUPER
          Used by classes and interfaces to indicate that the INVOKESPECIAL semantics should be used.
static int ACC_SYNCHRONIZED
          Used by methods to indicate synchronized semantics are to be used.
static int ACC_TRANSIENT
          Used by fields in classes to indicate the transient property.
static int ACC_VOLATILE
          Used by fields in classes to indicate the volatile property.
protected  int access_flags
          The bit field representing the flags that are set.
 
Constructor Summary
protected Accessible()
          Constructs a new Accessable object with no flags set.
 
Method Summary
 boolean getFlag(int flag)
          Queries the status of an access flag.
 void setFlag(int flags)
          Sets one or more flags for this object.
 void unSetFlag(int flags)
          Unsets one or more flags for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACC_PUBLIC

public static final int ACC_PUBLIC
Used to indicate public access. Set by classes, interfaces, fields, and methods. Note that all interface methods must set this flag.

ACC_PRIVATE

public static final int ACC_PRIVATE
Indicates private access. Set by fields and methods.

ACC_PROTECTED

public static final int ACC_PROTECTED
Indicates protected access. Set by fields and methods.

ACC_STATIC

public static final int ACC_STATIC
Indicates that the member is static. Set by fields and methods.

ACC_FINAL

public static final int ACC_FINAL
Indicates the final property. Set by classes, fields, and methods.

ACC_SYNCHRONIZED

public static final int ACC_SYNCHRONIZED
Used by methods to indicate synchronized semantics are to be used.

ACC_SUPER

public static final int ACC_SUPER
Used by classes and interfaces to indicate that the INVOKESPECIAL semantics should be used. All current compilers should set this flag.

ACC_VOLATILE

public static final int ACC_VOLATILE
Used by fields in classes to indicate the volatile property.

ACC_TRANSIENT

public static final int ACC_TRANSIENT
Used by fields in classes to indicate the transient property.

ACC_NATIVE

public static final int ACC_NATIVE
Indicates that this methods is native.

ACC_INTERFACE

public static final int ACC_INTERFACE
Indicates that the type is an interface.

ACC_ABSTRACT

public static final int ACC_ABSTRACT
Set by all interfaces and some classes to indicate that the type is abstract. Also used by methods in abstracted classes and all interface methods.

access_flags

protected int access_flags
The bit field representing the flags that are set.
Constructor Detail

Accessible

protected Accessible()
Constructs a new Accessable object with no flags set. This is intended as a simple initialization step to be called from the constructors of sub-classes.
Method Detail

getFlag

public boolean getFlag(int flag)
Queries the status of an access flag. The flag is expected to be one of the constants defined for this class.
Parameters:
flag - an integer encoding the flag being queried.
Returns:
true if the requested flag is set, false otherwise.

setFlag

public void setFlag(int flags)
Sets one or more flags for this object. The flags are expected to be one of the constants defined for this class, or a set of those constants combined with bitwise or.
Parameters:
flags - an integer encoding the flag or flags being set.

unSetFlag

public void unSetFlag(int flags)
Unsets one or more flags for this object. The flags are expected to be one of the constants defined for this class, or a set of those constants combined with bitwise or.
Parameters:
flags - an integer encoding the flag or flags being unset.