Package serp.bytecode
Class InnerClasses
java.lang.Object
serp.bytecode.Attributes
serp.bytecode.Attribute
serp.bytecode.InnerClasses
- All Implemented Interfaces:
BCEntity
,VisitAcceptor
Attribute describing all referenced classes that are not package
members. This includes all member interfaces and classes.
- 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.Add an inner class.addInnerClass
(String name, Class type, Class owner) Add an inner class.addInnerClass
(String name, String type, String owner) Add an inner class.addInnerClass
(String name, BCClass type, BCClass owner) Add an inner class.addInnerClass
(InnerClass inner) Import an inner class from another entity, or make a copy of one on this entity.void
clear()
Clear all inner classes from this entity.getInnerClass
(String name) Return the inner class with the given name.Return all referenced inner classes, or empty array if none.getInnerClasses
(String name) Return all inner classes with the given name, or empty array if none.boolean
removeInnerClass
(String name) Remove the inner class with the given name.boolean
removeInnerClass
(InnerClass innerClass) Remove the given inner class.void
setInnerClasses
(InnerClass[] inners) Set the inner class references for this class.Methods inherited from class serp.bytecode.Attribute
getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, isValid
Methods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
-
Method Details
-
getInnerClasses
Return all referenced inner classes, or empty array if none. -
getInnerClass
Return the inner class with the given name. If multiple inner classes share the name, which is returned is undefined. Use null to retrieve anonymous classes. -
getInnerClasses
Return all inner classes with the given name, or empty array if none. Use null to retrieve anonymous classes. -
setInnerClasses
Set the inner class references for this class. This method is useful when importing inner class references from another class. -
addInnerClass
Import an inner class from another entity, or make a copy of one on this entity.- Returns:
- the newly added inner class
-
addInnerClass
Add an inner class. -
addInnerClass
Add an inner class.- Parameters:
name
- the simple name of the class, or null if anonymoustype
- the full class name of the inner classowner
- the declaring class, or null if not a member class
-
addInnerClass
Add an inner class.- Parameters:
name
- the simple name of the class, or null if anonymoustype
- the class of the inner classowner
- the declaring class, or null if not a member class
-
addInnerClass
Add an inner class.- Parameters:
name
- the simple name of the class, or null if anonymoustype
- the class of the inner classowner
- the declaring class, or null if not a member class
-
clear
public void clear()Clear all inner classes from this entity. -
removeInnerClass
Remove the inner class with the given name. Use null for anonymous classes.- Returns:
- true if an inner class was removed, false otherwise
-
removeInnerClass
Remove the given inner class. After being removed, the given inner class is invalid, and the result of any operations on it are undefined.- Returns:
- true if the inner class was removed, false otherwise
-
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.
-