public class ParameterIndexOutOfBoundsException
extends java.lang.IndexOutOfBoundsException
Note: for performance reasons, this exception is only thrown when the Commons Attribute runtime can quickly determine that the index is out of bounds. Therefore, you may sometimes be able to pass an invalid index and not receive this exception. For example, if the runtime knows that the method or constructor has no attributes at all, an empty collection / null or false (as appropriate) will be returned instead. Put simply, don't use this exception to test how many parameters a method or constructor has.
Constructor and Description |
---|
ParameterIndexOutOfBoundsException(java.lang.String methodOrConstructorName,
int index,
int maxIndex)
Create a new ParameterIndexOutOfBoundsException.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
formatMessage(java.lang.String methodOrConstructorName,
int index,
int maxIndex) |
public ParameterIndexOutOfBoundsException(java.lang.String methodOrConstructorName, int index, int maxIndex)
methodOrConstructorName
- the name of the method or constructor whose parameter
the client tried to get attributes for.index
- the index supplied by the client.maxIndex
- the maximum + 1 parameter index allowed. For example, if a method takes
two parameters, the maximum allowed index is 1, and this parameter should
be set to 2. There is no minIndex parameter - it is assumed to be 0.