Package serp.bytecode
Class BCMethod
java.lang.Object
serp.bytecode.Attributes
serp.bytecode.Annotated
serp.bytecode.BCMember
serp.bytecode.BCMethod
- All Implemented Interfaces:
BCEntity,VisitAcceptor
A method of a class.
- Author:
- Abe White
-
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisit(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.voidAdd a parameter type to this method.voidAdd a parameter type to this method.voidAdd a parameter type to this method.voidAdd a parameter type to this method.voidAdd a parameter type to this method.voidAdd a parameter type to this method.voidClear all parameters from this method.getCode(boolean add) Return the code for the method.getExceptions(boolean add) Return the checked exceptions information for the method.BCClass[]Return the bytecode for all the parameter types for this method.String[]Return the names of all the parameter types for this method.Class[]Return theClassobjects for all the parameter types for this method.Return the bytecode for the return type of this method.Return the name of the type returned by this method.Return theClassobject for the return type of this method.booleanManipulate the method access flags.booleanisBridge()Manipulate the method access flags.booleanisNative()Manipulate the method access flags.booleanisStrict()Manipulate the method access flags.booleanManipulate the method access flags.booleanManipulate the method access flags.booleanRemove the code attribute from the method.booleanRemove the exceptions attribute for the method.voidremoveParam(int pos) Remove a parameter from this method.voidsetAbstract(boolean on) Manipulate the method access flags.voidsetBridge(boolean on) Manipulate the method access flags.voidsetNative(boolean on) Manipulate the method access flags.voidChange a parameter type of this method.voidChange a parameter type of this method.voidChange a parameter type of this method.voidSet the parameter type of this method.voidSet the parameter types of this method.voidSet the parameter type of this method.voidSet the return type of this method.voidSet the return type of this method.voidSet the return type of this method.voidsetStrict(boolean on) Manipulate the method access flags.voidsetSynchronized(boolean on) Manipulate the method access flags.voidsetVarArgs(boolean on) Manipulate the method access flags.Methods inherited from class serp.bytecode.BCMember
getAccessFlags, getClassLoader, getDeclarer, getDescriptor, getDescriptorIndex, getName, getNameIndex, getPool, getProject, isDeprecated, isFinal, isPackage, isPrivate, isProtected, isPublic, isStatic, isSynthetic, isValid, makePackage, makePrivate, makeProtected, makePublic, setAccessFlags, setDeprecated, setDescriptor, setDescriptorIndex, setFinal, setName, setNameIndex, setStatic, setSyntheticMethods inherited from class serp.bytecode.Annotated
getDeclaredAnnotations, getDeclaredRuntimeAnnotations, removeDeclaredAnnotations, removeDeclaredRuntimeAnnotationsMethods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
-
Method Details
-
isSynchronized
public boolean isSynchronized()Manipulate the method access flags. -
setSynchronized
public void setSynchronized(boolean on) Manipulate the method access flags. -
isNative
public boolean isNative()Manipulate the method access flags. -
setNative
public void setNative(boolean on) Manipulate the method access flags. -
isAbstract
public boolean isAbstract()Manipulate the method access flags. -
setAbstract
public void setAbstract(boolean on) Manipulate the method access flags. -
isStrict
public boolean isStrict()Manipulate the method access flags. -
setStrict
public void setStrict(boolean on) Manipulate the method access flags. -
isVarArgs
public boolean isVarArgs()Manipulate the method access flags. -
setVarArgs
public void setVarArgs(boolean on) Manipulate the method access flags. -
isBridge
public boolean isBridge()Manipulate the method access flags. -
setBridge
public void setBridge(boolean on) Manipulate the method access flags. -
getReturnName
Return the name of the type returned by this method. The name will be given in a form suitable for aClass.forName(java.lang.String)call.- See Also:
-
getReturnType
Return theClassobject for the return type of this method.- See Also:
-
getReturnBC
Return the bytecode for the return type of this method.- See Also:
-
setReturn
Set the return type of this method. -
setReturn
Set the return type of this method. -
setReturn
Set the return type of this method. -
getParamNames
Return the names of all the parameter types for this method. The names will be returned in a form suitable for aClass.forName(java.lang.String)call.- See Also:
-
getParamTypes
Return theClassobjects for all the parameter types for this method.- See Also:
-
getParamBCs
Return the bytecode for all the parameter types for this method.- See Also:
-
setParams
Set the parameter types of this method.- See Also:
-
setParams
Set the parameter type of this method.- See Also:
-
setParams
Set the parameter type of this method.- See Also:
-
addParam
Add a parameter type to this method. -
addParam
Add a parameter type to this method. -
addParam
Add a parameter type to this method. -
addParam
Add a parameter type to this method.- See Also:
-
addParam
Add a parameter type to this method.- See Also:
-
addParam
Add a parameter type to this method.- See Also:
-
setParam
Change a parameter type of this method.- See Also:
-
setParam
Change a parameter type of this method.- See Also:
-
setParam
Change a parameter type of this method.- See Also:
-
clearParams
public void clearParams()Clear all parameters from this method. -
removeParam
public void removeParam(int pos) Remove a parameter from this method. -
getExceptions
Return the checked exceptions information for the method. Acts internally through theAttributesinterface.- Parameters:
add- if true, a new exceptions attribute will be added if not already present- Returns:
- the exceptions information, or null if none and the
addparam is set to false
-
removeExceptions
public boolean removeExceptions()Remove the exceptions attribute for the method. Acts internally through theAttributesinterface.- Returns:
- true if there was a value to remove
-
getCode
Return the code for the method. If the code already exists, its iterator will be reset to the first instruction. Acts internally through theAttributesinterface.- Parameters:
add- if true, a new code attribute will be added if not already present- Returns:
- the code for the metohd, or null if none and the
addparam is set to false
-
removeCode
public boolean removeCode()Remove the code attribute from the method. Acts internally through theAttributesinterface.- Returns:
- true if there was a value to remove
-
acceptVisit
Description copied from interface:VisitAcceptorAccept 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:
acceptVisitin interfaceVisitAcceptor
-