public class ArgOffsets extends java.lang.Object implements IChainedDecoration<ArgOffsets>
Injectors which mutate the arguments of an invocation should apply this decoration to indicate the starting offset and size of the window which contains the original args.
| Modifier and Type | Field and Description |
|---|---|
static ArgOffsets |
DEFAULT
Null offsets
|
static java.lang.String |
KEY
Decoration key for this decoration type
|
| Constructor and Description |
|---|
ArgOffsets(int offset,
int length)
Create contiguous offsets starting from start and continuing for length
|
| Modifier and Type | Method and Description |
|---|---|
org.objectweb.asm.Type[] |
apply(org.objectweb.asm.Type[] args)
Apply this offset collection to the supplied argument array
|
int |
getArgIndex(int index)
Compute the argument index for the specified new index
|
int |
getArgIndex(int index,
boolean mustBeInWindow)
Compute the argument index for the specified new index
|
int |
getEndIndex()
Compute the argument index for the end of the window (offset length)
|
int |
getLength()
Get the size of the offset window
|
int |
getStartIndex()
Compute the argument index for the start of the window (offet 0)
|
boolean |
isEmpty()
Get whether this argument offset window is empty
|
void |
replace(ArgOffsets old)
Called when this decoration replaces a previous decoration with the same
key
|
java.lang.String |
toString() |
public static ArgOffsets DEFAULT
public static final java.lang.String KEY
public ArgOffsets(int offset,
int length)
offset - start indexlength - lengthpublic java.lang.String toString()
toString in class java.lang.Objectpublic void replace(ArgOffsets old)
IChainedDecorationreplace in interface IChainedDecoration<ArgOffsets>old - The previous decorationpublic int getLength()
public boolean isEmpty()
public int getStartIndex()
public int getEndIndex()
public int getArgIndex(int index)
index - The new index to computepublic int getArgIndex(int index,
boolean mustBeInWindow)
index - The new index to computemustBeInWindow - Throw an exception if the requested index exceeds
the length of the defined windowpublic org.objectweb.asm.Type[] apply(org.objectweb.asm.Type[] args)
args - New arguments