public class ListedClassNormalizer extends ClassNormalizer
ClassNormalizer that uses a list of substitutions.
This ClassNormalizer
checks a list (in order) to find a matching
Class.
This match can be performed either strictly (using equality) or taking into account
inheritance and implementation.
If a match is found then the first substituted class is returned as the normalization.
Constructor and Description |
---|
ListedClassNormalizer() |
Modifier and Type | Method and Description |
---|---|
void |
addSubstitution(Class substitute)
Adds the given substitute to the list.
|
void |
addSubstitution(Class match,
Class substitute)
Adds this given substitution to the list.
|
boolean |
isStrickCheck()
Is strict checking of substitutions on?
|
Class |
normalize(Class clazz)
Normalize given class.
|
void |
setStrickCheck(boolean strickCheck)
Sets strict checking of substitutions?
|
getNormalizedClass
public boolean isStrickCheck()
public void setStrickCheck(boolean strickCheck)
strickCheck
- if true then equality will be used to compare classes
when considering substition,
otherwise isAssignableFrom will be used so that super classes and super interfaces
will be matched.public void addSubstitution(Class match, Class substitute)
match
- if any classes matching this then the normal class will be substitutedsubstitute
- the normalized Class if the primary class is matchedpublic void addSubstitution(Class substitute)
isStrickCheck()
is false.
In this case, any subclasses (if this is a class) or implementating classes
if this is an interface) will be subsituted with this value.substitute
- sustitude this Classpublic Class normalize(Class clazz)
normalize
in class ClassNormalizer
clazz
- the class to normalize, not nullisStrickCheck()
then equality
is used otherwise isAssignableFrom is used (so that super class and interfaces are matched).Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.