Package serp.bytecode
Class BCMember
java.lang.Object
serp.bytecode.Attributes
serp.bytecode.Annotated
serp.bytecode.BCMember
- All Implemented Interfaces:
BCEntity
A member field or method of a class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private Collection
private int
private int
private BCClass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Return the access flags for this member as a bit array of ACCESS_XXX constants fromConstants
.(package private) Collection
Return the collection used to hold the attributes of this entity.(package private) BCClass
Internal access to the owning class.Return the class loader to use when loading related classes.Return theBCClass
that declares this member.Return the descriptor of this member, in internal form.int
Return the index in the classConstantPool
of theUTF8Entry
holding the descriptor of this member.getName()
Return the name of this member.int
Return the index in the classConstantPool
of theUTF8Entry
holding the name of this member.getPool()
Return the constant pool of the current class.Return the project of the current class.(package private) void
initialize
(String name, String descriptor) Either this method orread(java.io.DataInput)
must be called prior to use of this class.(package private) void
Used when this member is deleted from its class.boolean
Convenience method to return deprecation information for the member.boolean
isFinal()
Manipulate the member access flags.boolean
Manipulate the member access flags.boolean
Manipulate the member access flags.boolean
Manipulate the member access flags.boolean
isPublic()
Manipulate the member access flags.boolean
isStatic()
Manipulate the member access flags.boolean
Manipulate the field access flags.boolean
isValid()
Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined.void
Manipulate the member access flags.void
Manipulate the member access flags.void
Manipulate the member access flags.void
Manipulate the member access flags.(package private) void
void
setAccessFlags
(int access) Set the access flags for this member as a bit array of ACCESS_XXX constants fromConstants
.void
setDeprecated
(boolean on) Convenience method to set whether this member should be considered deprecated.void
setDescriptor
(String desc) Set the descriptor of this member.void
setDescriptorIndex
(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the descriptor of this member.private void
Resets theComplexEntry
of the owning class corresponding to this member.void
setFinal
(boolean on) Manipulate the member access flags.void
Set the name of this member.void
setNameIndex
(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the name of this member.void
setStatic
(boolean on) Manipulate the member access flags.void
setSynthetic
(boolean on) Manipulate the field access flags.(package private) void
write
(DataOutput out) Methods inherited from class serp.bytecode.Annotated
getDeclaredAnnotations, getDeclaredRuntimeAnnotations, removeDeclaredAnnotations, removeDeclaredRuntimeAnnotations
Methods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, readAttributes, removeAttribute, removeAttribute, setAttributes, visitAttributes, writeAttributes
-
Field Details
-
_owner
-
_access
private int _access -
_nameIndex
private int _nameIndex -
_descriptorIndex
private int _descriptorIndex -
_attrs
-
-
Constructor Details
-
BCMember
BCMember(BCClass owner)
-
-
Method Details
-
getDeclarer
Return theBCClass
that declares this member. -
getAccessFlags
public int getAccessFlags()Return the access flags for this member as a bit array of ACCESS_XXX constants fromConstants
. This can be used to transfer access flags between members without getting/setting each possible access flag. Defaults toConstants.ACCESS_PRIVATE
-
setAccessFlags
public void setAccessFlags(int access) Set the access flags for this member as a bit array of ACCESS_XXX constants fromConstants
. This can be used to transfer access flags between members without getting/setting each possible access flag. Defaults toConstants.ACCESS_PRIVATE
-
isPublic
public boolean isPublic()Manipulate the member access flags. -
makePublic
public void makePublic()Manipulate the member access flags. -
isProtected
public boolean isProtected()Manipulate the member access flags. -
makeProtected
public void makeProtected()Manipulate the member access flags. -
isPrivate
public boolean isPrivate()Manipulate the member access flags. -
makePrivate
public void makePrivate()Manipulate the member access flags. -
isPackage
public boolean isPackage()Manipulate the member access flags. -
makePackage
public void makePackage()Manipulate the member access flags. -
isFinal
public boolean isFinal()Manipulate the member access flags. -
setFinal
public void setFinal(boolean on) Manipulate the member access flags. -
isStatic
public boolean isStatic()Manipulate the member access flags. -
setStatic
public void setStatic(boolean on) Manipulate the member access flags. -
isSynthetic
public boolean isSynthetic()Manipulate the field access flags. This method also checks the synthetic member attribute. -
setSynthetic
public void setSynthetic(boolean on) Manipulate the field access flags. This method also manipulates the synthetic member attribute. -
getNameIndex
public int getNameIndex()Return the index in the classConstantPool
of theUTF8Entry
holding the name of this member. -
setNameIndex
public void setNameIndex(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the name of this member. -
getDescriptorIndex
public int getDescriptorIndex()Return the index in the classConstantPool
of theUTF8Entry
holding the descriptor of this member. -
setDescriptorIndex
public void setDescriptorIndex(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the descriptor of this member. -
getName
Return the name of this member. -
setName
Set the name of this member. -
getDescriptor
Return the descriptor of this member, in internal form. -
setDescriptor
Set the descriptor of this member. -
setEntry
Resets theComplexEntry
of the owning class corresponding to this member. Changes in the member will therefore propogate to all code in the class. -
isDeprecated
public boolean isDeprecated()Convenience method to return deprecation information for the member. Acts internally through theAttributes
interface. -
setDeprecated
public void setDeprecated(boolean on) Convenience method to set whether this member should be considered deprecated. Acts internally through theAttributes
interface. -
getProject
Description copied from interface:BCEntity
Return the project of the current class. -
getPool
Description copied from interface:BCEntity
Return the constant pool of the current class. -
getClassLoader
Description copied from interface:BCEntity
Return the class loader to use when loading related classes. -
isValid
public boolean isValid()Description copied from interface:BCEntity
Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined. -
getAttributesHolder
Collection getAttributesHolder()Description copied from class:Attributes
Return the collection used to hold the attributes of this entity.- Specified by:
getAttributesHolder
in classAttributes
-
initialize
Either this method orread(java.io.DataInput)
must be called prior to use of this class. The given descriptor must be in internal form. -
getBCClass
BCClass getBCClass()Description copied from class:Annotated
Internal access to the owning class.- Specified by:
getBCClass
in classAnnotated
-
invalidate
void invalidate()Used when this member is deleted from its class. -
read
- Throws:
IOException
-
write
- Throws:
IOException
-