Package org.apache.bcel.classfile
Class MethodParameter
- java.lang.Object
-
- org.apache.bcel.classfile.MethodParameter
-
- All Implemented Interfaces:
java.lang.Cloneable,Node
public class MethodParameter extends java.lang.Object implements java.lang.Cloneable, Node
Entry of the parameters table.Implements
Nodeas of 6.7.0.- Since:
- 6.0
- See Also:
- The class File Format : The MethodParameters Attribute
-
-
Field Summary
Fields Modifier and Type Field Description private intaccessFlagsThe access flagsprivate intnameIndexIndex of the CONSTANT_Utf8_info structure in the constant_pool table representing the name of the parameter
-
Constructor Summary
Constructors Constructor Description MethodParameter()Constructs a MethodParameter.MethodParameter(java.io.DataInput input)Constructs an instance from a DataInput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Accepts a visitor.MethodParametercopy()Creates a deep copy of this object.voiddump(java.io.DataOutputStream file)Dumps object to file stream on binary format.intgetAccessFlags()Gets the access flags.intgetNameIndex()Gets the name index.java.lang.StringgetParameterName(ConstantPool constantPool)Gets the name of the parameter.booleanisFinal()Checks if this parameter is final.booleanisMandated()Checks if this parameter is mandated.booleanisSynthetic()Checks if this parameter is synthetic.voidsetAccessFlags(int accessFlags)Sets the access flags.voidsetNameIndex(int nameIndex)Sets the name index.
-
-
-
Constructor Detail
-
MethodParameter
public MethodParameter()
Constructs a MethodParameter.
-
MethodParameter
MethodParameter(java.io.DataInput input) throws java.io.IOExceptionConstructs an instance from a DataInput.- Parameters:
input- Input stream.- Throws:
java.io.IOException- if an I/O error occurs.ClassFormatException- if a class is malformed or cannot be interpreted as a class file
-
-
Method Detail
-
copy
public MethodParameter copy()
Creates a deep copy of this object.- Returns:
- deep copy of this object.
-
dump
public final void dump(java.io.DataOutputStream file) throws java.io.IOExceptionDumps object to file stream on binary format.- Parameters:
file- Output file stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
getAccessFlags
public int getAccessFlags()
Gets the access flags.- Returns:
- the access flags.
-
getNameIndex
public int getNameIndex()
Gets the name index.- Returns:
- the name index.
-
getParameterName
public java.lang.String getParameterName(ConstantPool constantPool)
Gets the name of the parameter.- Parameters:
constantPool- The pool to query.- Returns:
- Constant from the given pool.
-
isFinal
public boolean isFinal()
Checks if this parameter is final.- Returns:
- true if this parameter is final.
-
isMandated
public boolean isMandated()
Checks if this parameter is mandated.- Returns:
- true if this parameter is mandated.
-
isSynthetic
public boolean isSynthetic()
Checks if this parameter is synthetic.- Returns:
- true if this parameter is synthetic.
-
setAccessFlags
public void setAccessFlags(int accessFlags)
Sets the access flags.- Parameters:
accessFlags- the access flags.
-
setNameIndex
public void setNameIndex(int nameIndex)
Sets the name index.- Parameters:
nameIndex- the name index.
-
-