Package serp.bytecode
Class InnerClass
- java.lang.Object
-
- serp.bytecode.InnerClass
-
- All Implemented Interfaces:
BCEntity
,VisitAcceptor
public class InnerClass extends java.lang.Object implements BCEntity, VisitAcceptor
Any referenced class that is not a package member is represented by this structure. This includes member classes and interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description private int
_access
private int
_index
private int
_nameIndex
private InnerClasses
_owner
private int
_ownerIndex
-
Constructor Summary
Constructors Constructor Description InnerClass(InnerClasses owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acceptVisit(BCVisitor visit)
Accept a visit from aBCVisitor
, 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.int
getAccessFlags()
Return the access flags of the inner class.java.lang.ClassLoader
getClassLoader()
Return the class loader to use when loading related classes.BCClass
getDeclarerBC()
Return the type for this instruction.int
getDeclarerIndex()
Return theConstantPool
index of theClassEntry
that describes the declaring class, or 0 if this class is not a member class.java.lang.String
getDeclarerName()
Return the full name of the declaring class, or null if unset/not a member.java.lang.Class
getDeclarerType()
Return the type of the declaring class.java.lang.String
getName()
Return the simple name of this inner class, or null if anonymous.int
getNameIndex()
Return theConstantPool
index of theUTF8Entry
that describes the simple name this class is referred to in source, or 0 for anonymous classes.InnerClasses
getOwner()
Inner classes are stored in anInnerClasses
attribute.ConstantPool
getPool()
Return the constant pool of the current class.Project
getProject()
Return the project of the current class.java.lang.Class
getType()
Return the type of the inner class.BCClass
getTypeBC()
Return the type for this instruction.int
getTypeIndex()
Return theConstantPool
index of theClassEntry
that describes this class, or 0 if none.java.lang.String
getTypeName()
Return the full name of the inner class, or null if unset.(package private) void
invalidate()
boolean
isAbstract()
Manipulate the class access flags.boolean
isAnnotation()
Manipulate the inner class access flags.boolean
isEnum()
Manipulate the inner class access flags.boolean
isFinal()
Manipulate the inner class access flags.boolean
isInterface()
Manipulate the class access flags.boolean
isPrivate()
Manipulate the inner class access flags.boolean
isProtected()
Manipulate the inner class access flags.boolean
isPublic()
Manipulate the inner class access flags.boolean
isStatic()
Manipulate the inner class access flags.boolean
isSynthetic()
Manipulate the inner class 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
makePrivate()
Manipulate the inner class access flags.void
makeProtected()
Manipulate the inner class access flags.void
makePublic()
Manipulate the inner class access flags.(package private) void
read(java.io.DataInput in)
void
setAbstract(boolean on)
Manipulate the class access flags.void
setAccessFlags(int accessFlags)
Set the access flags of the inner class.void
setAnnotation(boolean on)
Manipulate the inner class access flags.void
setDeclarer(java.lang.Class type)
Set the type of this declaring class.void
setDeclarer(java.lang.String type)
Set the type of this declaring class.void
setDeclarer(BCClass type)
Set the type of this declaring class.void
setDeclarerIndex(int ownerIndex)
Set theConstantPool
index of theClassEntry
that describes the declaring class, or 0 if this class is not a member class.void
setEnum(boolean on)
Manipulate the inner class access flags.void
setFinal(boolean on)
Manipulate the inner class access flags.void
setInterface(boolean on)
Manipulate the class access flags.void
setName(java.lang.String name)
Set the simple name of this inner class.void
setNameIndex(int nameIndex)
Set theConstantPool
index of theUTF8Entry
that describes the simple name this class is referred to in source, or 0 for anonymous classes.void
setStatic(boolean on)
Manipulate the inner class access flags.void
setSynthetic(boolean on)
Manipulate the inner class access flags.void
setType(java.lang.Class type)
Set the type of this inner class.void
setType(java.lang.String type)
Set the type of this inner class.void
setType(BCClass type)
Set the type of this inner class.void
setTypeIndex(int index)
Set theConstantPool
index of theClassEntry
that describes this class.(package private) void
write(java.io.DataOutput out)
-
-
-
Field Detail
-
_index
private int _index
-
_nameIndex
private int _nameIndex
-
_ownerIndex
private int _ownerIndex
-
_access
private int _access
-
_owner
private InnerClasses _owner
-
-
Constructor Detail
-
InnerClass
InnerClass(InnerClasses owner)
-
-
Method Detail
-
getOwner
public InnerClasses getOwner()
Inner classes are stored in anInnerClasses
attribute.
-
invalidate
void invalidate()
-
getAccessFlags
public int getAccessFlags()
Return the access flags of the inner class.
-
setAccessFlags
public void setAccessFlags(int accessFlags)
Set the access flags of the inner class.
-
isPublic
public boolean isPublic()
Manipulate the inner class access flags.
-
makePublic
public void makePublic()
Manipulate the inner class access flags.
-
isProtected
public boolean isProtected()
Manipulate the inner class access flags.
-
makeProtected
public void makeProtected()
Manipulate the inner class access flags.
-
isPrivate
public boolean isPrivate()
Manipulate the inner class access flags.
-
makePrivate
public void makePrivate()
Manipulate the inner class access flags.
-
isFinal
public boolean isFinal()
Manipulate the inner class access flags.
-
setFinal
public void setFinal(boolean on)
Manipulate the inner class access flags.
-
isStatic
public boolean isStatic()
Manipulate the inner class access flags.
-
setStatic
public void setStatic(boolean on)
Manipulate the inner class access flags.
-
isInterface
public boolean isInterface()
Manipulate the class access flags.
-
setInterface
public void setInterface(boolean on)
Manipulate the class access flags.
-
isAbstract
public boolean isAbstract()
Manipulate the class access flags.
-
setAbstract
public void setAbstract(boolean on)
Manipulate the class access flags.
-
isSynthetic
public boolean isSynthetic()
Manipulate the inner class access flags.
-
setSynthetic
public void setSynthetic(boolean on)
Manipulate the inner class access flags.
-
isAnnotation
public boolean isAnnotation()
Manipulate the inner class access flags.
-
setAnnotation
public void setAnnotation(boolean on)
Manipulate the inner class access flags. Setting to true also makes this an interface.
-
isEnum
public boolean isEnum()
Manipulate the inner class access flags.
-
setEnum
public void setEnum(boolean on)
Manipulate the inner class access flags.
-
getNameIndex
public int getNameIndex()
Return theConstantPool
index of theUTF8Entry
that describes the simple name this class is referred to in source, or 0 for anonymous classes.
-
setNameIndex
public void setNameIndex(int nameIndex)
Set theConstantPool
index of theUTF8Entry
that describes the simple name this class is referred to in source, or 0 for anonymous classes.
-
getName
public java.lang.String getName()
Return the simple name of this inner class, or null if anonymous.
-
setName
public void setName(java.lang.String name)
Set the simple name of this inner class.
-
getTypeIndex
public int getTypeIndex()
Return theConstantPool
index of theClassEntry
that describes this class, or 0 if none.
-
setTypeIndex
public void setTypeIndex(int index)
Set theConstantPool
index of theClassEntry
that describes this class.
-
getTypeName
public java.lang.String getTypeName()
Return the full name of the inner class, or null if unset.
-
getType
public java.lang.Class getType()
Return the type of the inner class. If the type has not been set, this method will return null.
-
getTypeBC
public BCClass getTypeBC()
Return the type for this instruction. If the type has not been set, this method will return null.
-
setType
public void setType(java.lang.String type)
Set the type of this inner class.
-
setType
public void setType(java.lang.Class type)
Set the type of this inner class.
-
setType
public void setType(BCClass type)
Set the type of this inner class.
-
getDeclarerIndex
public int getDeclarerIndex()
Return theConstantPool
index of theClassEntry
that describes the declaring class, or 0 if this class is not a member class.
-
setDeclarerIndex
public void setDeclarerIndex(int ownerIndex)
Set theConstantPool
index of theClassEntry
that describes the declaring class, or 0 if this class is not a member class.
-
getDeclarerName
public java.lang.String getDeclarerName()
Return the full name of the declaring class, or null if unset/not a member.
-
getDeclarerType
public java.lang.Class getDeclarerType()
Return the type of the declaring class. If the type has not been set or the class is not a member, this method will return null.
-
getDeclarerBC
public BCClass getDeclarerBC()
Return the type for this instruction. If the type has not been set or the class is not a member, this method will return null.
-
setDeclarer
public void setDeclarer(java.lang.String type)
Set the type of this declaring class.
-
setDeclarer
public void setDeclarer(java.lang.Class type)
Set the type of this declaring class.
-
setDeclarer
public void setDeclarer(BCClass type)
Set the type of this declaring class.
-
getProject
public Project getProject()
Description copied from interface:BCEntity
Return the project of the current class.- Specified by:
getProject
in interfaceBCEntity
-
getPool
public ConstantPool getPool()
Description copied from interface:BCEntity
Return the constant pool of the current class.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:BCEntity
Return the class loader to use when loading related classes.- Specified by:
getClassLoader
in interfaceBCEntity
-
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.
-
acceptVisit
public void acceptVisit(BCVisitor visit)
Description copied from interface:VisitAcceptor
Accept a visit from aBCVisitor
, 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 interfaceVisitAcceptor
-
read
void read(java.io.DataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
write
void write(java.io.DataOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
-