public abstract class Usages
extends java.lang.Object
Constructor and Description |
---|
Usages() |
Modifier and Type | Method and Description |
---|---|
void |
declareCatchParameter(SourceCatchParameter s)
Declares a parameter of a catch clause
|
void |
declareClass(SourceClass s)
Declares a class.
|
void |
declareConstructor(SourceMethod s)
Declares a constructor.
|
void |
declareEnumConstant(SourceEnumConstant s)
Declares an enum constant.
|
void |
declareField(SourceFieldVariable s)
Declares a single field that is not a enum constant.
|
void |
declareLambdaParameter(SourceLambdaParameter s)
Declares a parameter of a lambda expression
|
void |
declareLocalVariable(SourceLocalVariable s)
Declares a single local variable, different from a parameter.
|
void |
declareMethod(SourceMethod s)
Declares a method.
|
void |
declareParameter(SourceFormalParameter s)
Declares a formal parameter.
|
void |
declareTypeParameter(SourceTypeParameter s)
Declares a type parameter, part of a generic declaration.
|
static void |
processUsages(SourceElement sourceElement,
Usages usages)
Finds declarations and usages in a SourceElement.
|
boolean |
shouldTraverse(SourceElement element)
True says "Yes, traverse (normally) the given SourceElement and
its subtree as part of the compile".
|
void |
useFieldInDocComment(SourceDocReference s,
JavaField field)
Usage of a field or enum constant in a doc comment.
|
void |
useFieldInExpression(SourceExpression s,
JavaField field)
Usage of a field or enum constant in an expression.
|
void |
useLocalVariableInExpression(SourceExpression s,
JavaLocalVariable local)
Usage of a local variable in an expression.
|
void |
useMethodInDocComment(SourceDocReference s,
JavaMethod method)
Usage of a method or constructor in a doc comment.
|
void |
useMethodInExpression(SourceInvokeExpression s,
JavaMethod method)
Usage of a method or constructor in an expression.
|
void |
useMethodInExpression(SourceMethodReferenceExpression s,
JavaMethod method)
Usage of a method or constructor reference in an expression.
|
void |
useParameterInDocComment(SourceDocReference s,
JavaLocalVariable parameter)
Usage of a local variable or formal parameter in an expression.
|
void |
useParameterInExpression(SourceExpression s,
JavaLocalVariable parameter)
Usage of a method or lambda parameter in an expression.
|
void |
useTypeInAnnotation(SourceAnnotation s,
JavaType type)
Usage of a type in an annotation.
|
void |
useTypeInCatchParameter(SourceTypeReference s,
JavaType type)
Usage of a type as the type of a catch parameter.
|
void |
useTypeInClassExtends(SourceTypeReference s,
JavaType type)
Usage of a type as a proper supertype.
|
void |
useTypeInCreator(SourceTypeReference s,
JavaType type)
Usage of a type in a creator expression.
|
void |
useTypeInDocComment(SourceDocReference s,
JavaType type)
Usage of a type in a doc comment.
|
void |
useTypeInExpression(SourceExpression s,
JavaType type)
Usage of a type in an expression that is not covered in any other
category.
|
void |
useTypeInFieldDecl(SourceTypeReference s,
JavaType type)
Usage of a type in a field declaration.
|
void |
useTypeInInstanceof(SourceTypeReference s,
JavaType type)
Usage of a type in a field declaration.
|
void |
useTypeInLambdaParameter(SourceTypeReference s,
JavaType type)
Usage of a type as the type of a lambda parameter.
|
void |
useTypeInLocalVariableDecl(SourceTypeReference s,
JavaType type)
Usage of a type for a local variable.
|
void |
useTypeInMethodReference(SourceExpression s,
JavaType type)
Usage of a type as the type of a method reference.
|
void |
useTypeInMiscellaneous(SourceTypeReference s,
JavaType type)
Usage of a type that doesn't fall into any other category.
|
void |
useTypeInNarrowImport(SourceImport s,
JavaType type)
Usage of a type in a narrow import.
|
void |
useTypeInParameter(SourceTypeReference s,
JavaType type)
Usage of a type as the type of a formal parameter.
|
void |
useTypeInReturnType(SourceTypeReference s,
JavaType type)
Usage of a type as a return type of a method.
|
void |
useTypeInThrows(SourceTypeReference s,
JavaType type)
Usage of a type as a declared exception for a method or
constructor.
|
void |
useTypeInTypecast(SourceTypeReference s,
JavaType type)
Usage of a type in a typecast expression.
|
public static void processUsages(SourceElement sourceElement, Usages usages)
public boolean shouldTraverse(SourceElement element)
public void declareClass(SourceClass s)
public void declareConstructor(SourceMethod s)
public void declareEnumConstant(SourceEnumConstant s)
public void declareField(SourceFieldVariable s)
public void declareLocalVariable(SourceLocalVariable s)
public void declareCatchParameter(SourceCatchParameter s)
s
- The catch parameterpublic void declareLambdaParameter(SourceLambdaParameter s)
s
- The lambda parameterpublic void declareMethod(SourceMethod s)
public void declareParameter(SourceFormalParameter s)
public void declareTypeParameter(SourceTypeParameter s)
public void useFieldInDocComment(SourceDocReference s, JavaField field)
public void useFieldInExpression(SourceExpression s, JavaField field)
s
- Either a SourceDotExpression or a SourceSimpleNameExpression.public void useLocalVariableInExpression(SourceExpression s, JavaLocalVariable local)
s
- Either a SourceDotExpression or a SourceSimpleNameExpression.public void useMethodInDocComment(SourceDocReference s, JavaMethod method)
public void useMethodInExpression(SourceInvokeExpression s, JavaMethod method)
public void useMethodInExpression(SourceMethodReferenceExpression s, JavaMethod method)
public void useParameterInDocComment(SourceDocReference s, JavaLocalVariable parameter)
public void useParameterInExpression(SourceExpression s, JavaLocalVariable parameter)
s
- Either a SourceDotExpression or a SourceSimpleNameExpression.parameter
- The parameterpublic void useTypeInAnnotation(SourceAnnotation s, JavaType type)
public void useTypeInDocComment(SourceDocReference s, JavaType type)
public void useTypeInExpression(SourceExpression s, JavaType type)
s
- Either a SourceDotExpression or a SourceSimpleNameExpression.public void useTypeInClassExtends(SourceTypeReference s, JavaType type)
public void useTypeInFieldDecl(SourceTypeReference s, JavaType type)
public void useTypeInInstanceof(SourceTypeReference s, JavaType type)
public void useTypeInLocalVariableDecl(SourceTypeReference s, JavaType type)
public void useTypeInMiscellaneous(SourceTypeReference s, JavaType type)
public void useTypeInNarrowImport(SourceImport s, JavaType type)
public void useTypeInCreator(SourceTypeReference s, JavaType type)
public void useTypeInParameter(SourceTypeReference s, JavaType type)
public void useTypeInCatchParameter(SourceTypeReference s, JavaType type)
public void useTypeInLambdaParameter(SourceTypeReference s, JavaType type)
public void useTypeInMethodReference(SourceExpression s, JavaType type)
public void useTypeInReturnType(SourceTypeReference s, JavaType type)
public void useTypeInThrows(SourceTypeReference s, JavaType type)
public void useTypeInTypecast(SourceTypeReference s, JavaType type)