org.apache.commons.attributes
Class ParameterIndexOutOfBoundsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IndexOutOfBoundsException
org.apache.commons.attributes.ParameterIndexOutOfBoundsException
- All Implemented Interfaces:
- Serializable
- public class ParameterIndexOutOfBoundsException
- extends IndexOutOfBoundsException
Thrown when attempting to get attributes for a parameter of a constructor or method
and the parameter index is out of bounds.
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.
- Since:
- 2.2
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
ParameterIndexOutOfBoundsException
public ParameterIndexOutOfBoundsException(String methodOrConstructorName,
int index,
int maxIndex)
- Create a new ParameterIndexOutOfBoundsException.
- Parameters:
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.
Copyright © The Apache Software Foundation. All Rights Reserved.