Package org.jeasy.props.processors
Class AbstractAnnotationProcessor<A extends Annotation>
- java.lang.Object
-
- org.jeasy.props.processors.AbstractAnnotationProcessor<A>
-
- All Implemented Interfaces:
AnnotationProcessor<A>
- Direct Known Subclasses:
DBPropertyAnnotationProcessor,EnvironmentVariableAnnotationProcessor,I18NPropertyAnnotationProcessor,JNDIPropertyAnnotationProcessor,ManifestPropertyAnnotationProcessor,MavenPropertyAnnotationProcessor,PropertiesAnnotationProcessor,PropertyAnnotationProcessor,SystemPropertyAnnotationProcessor
public abstract class AbstractAnnotationProcessor<A extends Annotation> extends Object implements AnnotationProcessor<A>
Base class forAnnotationProcessorimplementations providing common methods.- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Constructor Summary
Constructors Constructor Description AbstractAnnotationProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringmissingAttributeValue(String attribute, String annotation, Field field)Constructs an error message to signal missing annotation attribute value.protected voidrejectIfEmpty(String value, String message)Reject a value (by throwing aAnnotationProcessingException) if it is empty.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jeasy.props.api.AnnotationProcessor
processAnnotation
-
-
-
-
Method Detail
-
missingAttributeValue
protected String missingAttributeValue(String attribute, String annotation, Field field)
Constructs an error message to signal missing annotation attribute value.- Parameters:
attribute- the target attributeannotation- the annotation concernedfield- the target field- Returns:
- the formatted error message
-
rejectIfEmpty
protected void rejectIfEmpty(String value, String message) throws AnnotationProcessingException
Reject a value (by throwing aAnnotationProcessingException) if it is empty.- Parameters:
value- the value to checkmessage- the message of the exception- Throws:
AnnotationProcessingException- thrown if the value is empty
-
-