public class AnnotationChecker extends ContextVisitor
context, outer, prune, rethrowMissingDependencies
error, job, nf, ts
bypass, bypassParent
Constructor and Description |
---|
AnnotationChecker(Job job,
TypeSystem ts,
NodeFactory nf) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<EnumInstance> |
annotationElementTypesForDeclaration(Declaration decl) |
void |
checkAnnotationApplicability(AnnotationElem n,
Declaration decl)
Is the annotation element
annotation applicable
to Declaration decl? For example, if annotation is "@Override" then decl
better be a methodInstance that overrides another method. |
protected void |
checkOverrideAnnotation(Declaration decl) |
protected void |
checkTargetMetaAnnotation(AnnotationElementValueArray targetKinds,
AnnotationElem n,
Declaration decl) |
protected Node |
leaveCall(Node old,
Node n,
NodeVisitor v) |
JL5TypeSystem |
typeSystem()
Returns the
TypeSystem that this Visitor is using. |
addDecls, addDecls, begin, context, context, enter, enter, enterScope, leave, rethrowMissingDependencies, superEnter
catchErrors, enterCall, enterCall, enterError, errorQueue, hasErrors, job, leaveCall, leaveCall, nodeFactory
bypass, bypass, bypassChildren, override, visitChildren
copy, finish, finish, lang, leave, override, toString, visitEdge, visitEdgeNoOverride
public AnnotationChecker(Job job, TypeSystem ts, NodeFactory nf)
protected Node leaveCall(Node old, Node n, NodeVisitor v) throws SemanticException
leaveCall
in class ErrorHandlingVisitor
SemanticException
public JL5TypeSystem typeSystem()
ErrorHandlingVisitor
TypeSystem
that this Visitor is using.typeSystem
in class ErrorHandlingVisitor
TypeSystem
public void checkAnnotationApplicability(AnnotationElem n, Declaration decl) throws SemanticException
annotation
applicable
to Declaration decl? For example, if annotation is "@Override" then decl
better be a methodInstance that overrides another method. If annotation's
type itself has annotations describing which targets are appropriate,
then decl must be an appropriate target.annotation
- decl
- SemanticException
protected void checkOverrideAnnotation(Declaration decl) throws SemanticException
SemanticException
protected void checkTargetMetaAnnotation(AnnotationElementValueArray targetKinds, AnnotationElem n, Declaration decl) throws SemanticException
SemanticException
public java.util.Collection<EnumInstance> annotationElementTypesForDeclaration(Declaration decl)