Package serp.bytecode

# Class InnerClass

java.lang.Object
serp.bytecode.InnerClass

All Implemented Interfaces:
  `BCEntity`, `VisitAcceptor`

public class InnerClass extends Object implements 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 Type
Method
Description
`void`
`acceptVisit(BCVisitor visit)`
Accept a visit from a `BCVisitor`, 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.
`ClassLoader`
`getClassLoader()`
Return the class loader to use when loading related classes.
`BCClass`
`getDeclarerBC()`
Return the type for this instruction.
`int`
`getDeclarerIndex()`
Return the `ConstantPool` index of the `ClassEntry` that describes the declaring class, or 0 if this class is not a member class.
`String`
`getDeclarerName()`
Return the full name of the declaring class, or null if unset/not a member.
`Class`
`getDeclarerType()`
Return the type of the declaring class.
`String`
`getName()`
Return the simple name of this inner class, or null if anonymous.
`int`
`getNameIndex()`
Return the `ConstantPool` index of the `UTF8Entry` that describes the simple name this class is referred to in source, or 0 for anonymous classes.
`InnerClasses`
`getOwner()`
Inner classes are stored in an `InnerClasses` attribute.
`ConstantPool`
`getPool()`
Return the constant pool of the current class.
`Project`
`getProject()`
Return the project of the current class.
`Class`
`getType()`
Return the type of the inner class.
`BCClass`
`getTypeBC()`
Return the type for this instruction.
`int`
`getTypeIndex()`
Return the `ConstantPool` index of the `ClassEntry` that describes this class, or 0 if none.
`String`
`getTypeName()`
Return the full name of the inner class, or null if unset.
`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.
`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 the `ConstantPool` index of the `ClassEntry` 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(String name)`
Set the simple name of this inner class.
`void`
`setNameIndex(int nameIndex)`
Set the `ConstantPool` index of the `UTF8Entry` 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(Class type)`
Set the type of this inner class.
`void`
`setType(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 the `ConstantPool` index of the `ClassEntry` that describes this class.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getOwner

public InnerClasses getOwner()
Inner classes are stored in an `InnerClasses` 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 the `ConstantPool` index of the `UTF8Entry` that describes the simple name this class is referred to in source, or 0 for anonymous classes.

### setNameIndex

public void setNameIndex(int nameIndex)
Set the `ConstantPool` index of the `UTF8Entry` that describes the simple name this class is referred to in source, or 0 for anonymous classes.

### getName

public String getName()
Return the simple name of this inner class, or null if anonymous.

### setName

public void setName(String name)
Set the simple name of this inner class.

### getTypeIndex

public int getTypeIndex()
Return the `ConstantPool` index of the `ClassEntry` that describes this class, or 0 if none.

### setTypeIndex

public void setTypeIndex(int index)
Set the `ConstantPool` index of the `ClassEntry` that describes this class.

### getTypeName

public String getTypeName()
Return the full name of the inner class, or null if unset.

### getType

public 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(String type)
Set the type of this inner class.

### setType

public void setType(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 the `ConstantPool` index of the `ClassEntry` that describes the declaring class, or 0 if this class is not a member class.

### setDeclarerIndex

public void setDeclarerIndex(int ownerIndex)
Set the `ConstantPool` index of the `ClassEntry` that describes the declaring class, or 0 if this class is not a member class.

### getDeclarerName

public String getDeclarerName()
Return the full name of the declaring class, or null if unset/not a member.

### getDeclarerType

public 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(String type)
Set the type of this declaring class.

### setDeclarer

public void setDeclarer(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 interface `BCEntity`

### getPool

public ConstantPool getPool()
Description copied from interface: `BCEntity`
Return the constant pool of the current class.

Specified by:
  `getPool` in interface `BCEntity`

### getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: `BCEntity`
Return the class loader to use when loading related classes.

Specified by:
  `getClassLoader` in interface `BCEntity`

### 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.

Specified by:
  `isValid` in interface `BCEntity`

### acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: `VisitAcceptor`
Accept a visit from a `BCVisitor`, 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 interface `VisitAcceptor`