Package serp.bytecode
Class InnerClass
java.lang.Object
serp.bytecode.InnerClass
- All Implemented Interfaces:
BCEntity
,VisitAcceptor
Any referenced class that is not a package member is represented by
this structure. This includes member classes and interfaces.
- Author:
- Abe White
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Return the access flags of the inner class.Return the class loader to use when loading related classes.Return the type for this instruction.int
Return theConstantPool
index of theClassEntry
that describes the declaring class, or 0 if this class is not a member class.Return the full name of the declaring class, or null if unset/not a member.Return the type of the declaring class.getName()
Return the simple name of this inner class, or null if anonymous.int
Return theConstantPool
index of theUTF8Entry
that describes the simple name this class is referred to in source, or 0 for anonymous classes.getOwner()
Inner classes are stored in anInnerClasses
attribute.getPool()
Return the constant pool of the current class.Return the project of the current class.getType()
Return the type of the inner class.Return the type for this instruction.int
Return theConstantPool
index of theClassEntry
that describes this class, or 0 if none.Return the full name of the inner class, or null if unset.boolean
Manipulate the class access flags.boolean
Manipulate the inner class access flags.boolean
isEnum()
Manipulate the inner class access flags.boolean
isFinal()
Manipulate the inner class access flags.boolean
Manipulate the class access flags.boolean
Manipulate the inner class access flags.boolean
Manipulate the inner class access flags.boolean
isPublic()
Manipulate the inner class access flags.boolean
isStatic()
Manipulate the inner class access flags.boolean
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
Manipulate the inner class access flags.void
Manipulate the inner class access flags.void
Manipulate the inner class access flags.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
(Class type) Set the type of this declaring class.void
setDeclarer
(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
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
Set the type of this inner class.void
Set the type of this inner class.void
Set the type of this inner class.void
setTypeIndex
(int index) Set theConstantPool
index of theClassEntry
that describes this class.
-
Method Details
-
getOwner
Inner classes are stored in anInnerClasses
attribute. -
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
Return the simple name of this inner class, or null if anonymous. -
setName
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
Return the full name of the inner class, or null if unset. -
getType
Return the type of the inner class. If the type has not been set, this method will return null. -
getTypeBC
Return the type for this instruction. If the type has not been set, this method will return null. -
setType
Set the type of this inner class. -
setType
Set the type of this inner class. -
setType
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
Return the full name of the declaring class, or null if unset/not a member. -
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
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
Set the type of this declaring class. -
setDeclarer
Set the type of this declaring class. -
setDeclarer
Set the type of this declaring class. -
getProject
Description copied from interface:BCEntity
Return the project of the current class.- Specified by:
getProject
in interfaceBCEntity
-
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.- 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
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
-