Class Validator
java.lang.Object
org.robolectric.annotation.processing.validator.Validator
- All Implemented Interfaces:
javax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
- Direct Known Subclasses:
FoundOnImplementsValidator
,ImplementsValidator
public abstract class Validator extends Object implements javax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
Base class for validators.
-
Field Summary
Fields Modifier and Type Field Description protected javax.lang.model.element.TypeElement
annotationType
protected javax.lang.model.element.AnnotationMirror
currentAnnotation
protected javax.lang.model.element.Element
currentElement
protected javax.lang.model.util.Elements
elements
protected Helpers
helpers
protected Messager
messager
protected RobolectricModel.Builder
modelBuilder
protected javax.lang.model.util.Types
types
-
Constructor Summary
Constructors Constructor Description Validator(RobolectricModel.Builder modelBuilder, ProcessingEnvironment env, String annotationType)
-
Method Summary
Modifier and Type Method Description protected void
error(String msg)
protected void
error(String msg, javax.lang.model.element.AnnotationValue av)
javax.lang.model.element.TypeElement
getAnnotationType()
protected javax.lang.model.element.AnnotationMirror
getCurrentAnnotation()
void
init(javax.lang.model.element.Element e, javax.lang.model.element.Element p)
protected void
message(javax.tools.Diagnostic.Kind severity, String msg)
protected void
message(javax.tools.Diagnostic.Kind severity, String msg, javax.lang.model.element.AnnotationValue av)
Void
visit(javax.lang.model.element.Element e)
Void
visit(javax.lang.model.element.Element e, javax.lang.model.element.Element p)
Void
visitExecutable(javax.lang.model.element.ExecutableElement e, javax.lang.model.element.Element p)
Void
visitPackage(javax.lang.model.element.PackageElement e, javax.lang.model.element.Element p)
Void
visitType(javax.lang.model.element.TypeElement e, javax.lang.model.element.Element p)
Void
visitTypeParameter(javax.lang.model.element.TypeParameterElement e, javax.lang.model.element.Element p)
Void
visitUnknown(javax.lang.model.element.Element e, javax.lang.model.element.Element p)
Void
visitVariable(javax.lang.model.element.VariableElement e, javax.lang.model.element.Element p)
-
Field Details
-
modelBuilder
-
elements
protected final javax.lang.model.util.Elements elements -
types
protected final javax.lang.model.util.Types types -
messager
-
annotationType
protected final javax.lang.model.element.TypeElement annotationType -
helpers
-
currentElement
protected javax.lang.model.element.Element currentElement -
currentAnnotation
protected javax.lang.model.element.AnnotationMirror currentAnnotation
-
-
Constructor Details
-
Validator
public Validator(RobolectricModel.Builder modelBuilder, ProcessingEnvironment env, String annotationType)
-
-
Method Details
-
getCurrentAnnotation
protected javax.lang.model.element.AnnotationMirror getCurrentAnnotation() -
message
protected void message(javax.tools.Diagnostic.Kind severity, String msg, javax.lang.model.element.AnnotationValue av) -
message
-
error
-
error
-
init
public void init(javax.lang.model.element.Element e, javax.lang.model.element.Element p) -
getAnnotationType
public javax.lang.model.element.TypeElement getAnnotationType() -
visit
- Specified by:
visit
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visit
- Specified by:
visit
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitPackage
public Void visitPackage(javax.lang.model.element.PackageElement e, javax.lang.model.element.Element p)- Specified by:
visitPackage
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitType
- Specified by:
visitType
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitVariable
public Void visitVariable(javax.lang.model.element.VariableElement e, javax.lang.model.element.Element p)- Specified by:
visitVariable
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitExecutable
public Void visitExecutable(javax.lang.model.element.ExecutableElement e, javax.lang.model.element.Element p)- Specified by:
visitExecutable
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitTypeParameter
public Void visitTypeParameter(javax.lang.model.element.TypeParameterElement e, javax.lang.model.element.Element p)- Specified by:
visitTypeParameter
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-
visitUnknown
- Specified by:
visitUnknown
in interfacejavax.lang.model.element.ElementVisitor<Void,javax.lang.model.element.Element>
-