Package org.codehaus.mojo.animal_sniffer
Class SignatureChecker
java.lang.Object
org.codehaus.mojo.animal_sniffer.ClassFileVisitor
org.codehaus.mojo.animal_sniffer.SignatureChecker
Checks the signature against classes in this list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static classprivate static interfaceprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe fully qualified name of the annotation to use to annotate methods/fields/classes that are to be ignored by animal sniffer.private Collection<String>private booleanprivate final List<SignatureChecker.MatchRule>Classes in this packages are considered to be resolved elsewhere and thus not a subject of the error checking when referenced.private final Loggerstatic final StringSimilar toANNOTATION_FQN. -
Constructor Summary
ConstructorsConstructorDescriptionSignatureChecker(InputStream in, Set<String> ignoredPackages, Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringfromSourceType(String text) booleanstatic voidprivate SignatureChecker.MatchRulenewMatchRule(String matcher) protected voidprocess(String name, InputStream image) voidsetAnnotationTypes(Collection<String> annotationTypes) Sets the annotation type(s) that this checker should consider to ignore annotated methods, classes or fields.voidsetSourcePath(List<File> sourcePath) (package private) static StringtoAnnotationDescriptor(String classFqn) (package private) static StringtoSourceForm(String type, String sig) private static StringtoSourceType(String text) private static StringtoSourceType(CharBuffer type) Methods inherited from class org.codehaus.mojo.animal_sniffer.ClassFileVisitor
isCheckJars, process, process, process, processClassFile, processDirectory, processJarFile, setCheckJars
-
Field Details
-
ANNOTATION_FQN
The fully qualified name of the annotation to use to annotate methods/fields/classes that are to be ignored by animal sniffer.- See Also:
-
PREVIOUS_ANNOTATION_FQN
Similar toANNOTATION_FQN. Kept for backward compatibility reasons- See Also:
-
classes
-
logger
-
ignoredPackageRules
Classes in this packages are considered to be resolved elsewhere and thus not a subject of the error checking when referenced. -
ignoredPackages
-
ignoredOuterClassesOrMethods
-
hadError
private boolean hadError -
sourcePath
-
annotationDescriptors
-
-
Constructor Details
-
SignatureChecker
public SignatureChecker(InputStream in, Set<String> ignoredPackages, Logger logger) throws IOException - Throws:
IOException
-
SignatureChecker
public SignatureChecker(Map<String, Clazz> classes, Set<String> ignoredPackages, Logger logger) throws IOException- Throws:
IOException
-
-
Method Details
-
main
- Throws:
Exception
-
loadClasses
- Throws:
IOException
-
setSourcePath
- Since:
- 1.9
-
setAnnotationTypes
Sets the annotation type(s) that this checker should consider to ignore annotated methods, classes or fields.By default, the
ANNOTATION_FQNandPREVIOUS_ANNOTATION_FQNare used.If you want to add an extra annotation types, make sure to add the standard one to the specified lists.
- Parameters:
annotationTypes- a list of the fully qualified name of the annotation types to consider for ignoring annotated method, class and field- Since:
- 1.11
-
process
- Specified by:
processin classClassFileVisitor- Parameters:
name- Displayable name to identify what class file we are processingimage- Class file image.- Throws:
IOException
-
newMatchRule
-
isSignatureBroken
public boolean isSignatureBroken() -
toSourceForm
-
toAnnotationDescriptor
-
toSourceType
-
toSourceType
-
fromSourceType
-