public class FilterClassIncompatibilityException extends PipelinedComparatorException
Thrown to indicate that a filter class incompatibility has been detected.
SAX event filters implemented in Java have to be assignment compatible with a small set of appropriate classes in order for them to be deployed in a pipeline. The set of appropriate classes depends on whether the filter is being used for input filtering prior to the comparator, or output filtering after the comparator. See the documentation for the various overloaded setInputFilters and setOutputFilters methods for full details of the allowable classes.
The classes which are allowable in the given context can be determined with the FilterClassIncompatibilityException.getAllowableFilterClasses()
method.
The class which is assignment incompatible, and caused the exception, is available with the FilterClassIncompatibilityException.getProposedFilterClass()
method.
In some cases the filter setting methods take aggregates (Arrays, Lists) of filters. The FilterClassIncompatibilityException.getAggregatePosition()
method
can be used to report which element of the aggregate caused the problem.
PipelinedComparator#setInputFilters(Class[])
,
PipelinedComparator#setInputFilters(java.util.List)
,
PipelinedComparator#setOutputFilters(Class[])
,
PipelinedComparator#setOutputFilters(java.util.List)
,
Serialized FormConstructor and Description |
---|
FilterClassIncompatibilityException(java.lang.String message,
java.lang.Class<?> proposedFilterClass,
java.lang.Class<?>[] allowableFilterClasses)
Creates a new FilterClassIncompatibilityException.
|
FilterClassIncompatibilityException(java.lang.String message,
java.lang.Class<?> proposedFilterClass,
java.lang.Class<?>[] allowableFilterClasses,
int aggregatePosition)
Creates a new FilterClassIncompatibilityException.
|
FilterClassIncompatibilityException(java.lang.String message,
java.lang.Class<?> proposedFilterClass,
java.lang.Class<?>[] allowableFilterClasses,
int aggregatePosition,
PipelineIOIdentifier locationId)
Creates a new FilterClassIncompatibilityException.
|
Modifier and Type | Method and Description |
---|---|
int |
getAggregatePosition()
Reports the member of an aggregate which caused the problem.
|
java.lang.Class<?>[] |
getAllowableFilterClasses()
Reports the classes which may be used as a filter in this context.
|
PipelineIOIdentifier |
getLocationId()
Returns the identity of the filter chain in which the problem occurred.
|
java.lang.Class<?> |
getProposedFilterClass()
Provides information about the class which cannot be used as a filter.
|
getCause, getThrowable
public FilterClassIncompatibilityException(java.lang.String message, java.lang.Class<?> proposedFilterClass, java.lang.Class<?>[] allowableFilterClasses)
message
- The exception message StringproposedFilterClass
- the class causing the incompatibilityallowableFilterClasses
- the set of classes allowed in the context, passed as an arraypublic FilterClassIncompatibilityException(java.lang.String message, java.lang.Class<?> proposedFilterClass, java.lang.Class<?>[] allowableFilterClasses, int aggregatePosition)
message
- The exception message StringproposedFilterClass
- the class causing the incompatibilityallowableFilterClasses
- the set of classes allowed in the context, passed as an arrayaggregatePosition
- an index into an aggregate of filters to identify the one at faultpublic FilterClassIncompatibilityException(java.lang.String message, java.lang.Class<?> proposedFilterClass, java.lang.Class<?>[] allowableFilterClasses, int aggregatePosition, PipelineIOIdentifier locationId)
message
- The exception message StringproposedFilterClass
- the class causing the incompatibilityallowableFilterClasses
- the set of classes allowed in the context, passed as an arrayaggregatePosition
- an index into an aggregate of filters to identify the one at faultlocationId
- the id of the pipeline on which the error has occurredpublic java.lang.Class<?> getProposedFilterClass()
public java.lang.Class<?>[] getAllowableFilterClasses()
public int getAggregatePosition()
public PipelineIOIdentifier getLocationId()