本文整理汇总了Java中lombok.core.TypeResolver.typeRefToFullyQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java TypeResolver.typeRefToFullyQualifiedName方法的具体用法?Java TypeResolver.typeRefToFullyQualifiedName怎么用?Java TypeResolver.typeRefToFullyQualifiedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lombok.core.TypeResolver
的用法示例。
在下文中一共展示了TypeResolver.typeRefToFullyQualifiedName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleAnnotation
import lombok.core.TypeResolver; //导入方法依赖的package包/类
/**
* Handles the provided annotation node by first finding a qualifying instance of
* {@link EclipseAnnotationHandler} and if one exists, calling it with a freshly cooked up
* instance of {@link AnnotationValues}.
*
* Note that depending on the printASTOnly flag, the {@link lombok.core.PrintAST} annotation
* will either be silently skipped, or everything that isn't {@code PrintAST} will be skipped.
*
* The HandlerLibrary will attempt to guess if the given annotation node represents a lombok annotation.
* For example, if {@code lombok.*} is in the import list, then this method will guess that
* {@code Getter} refers to {@code lombok.Getter}, presuming that {@link lombok.eclipse.handlers.HandleGetter}
* has been loaded.
*
* @param ast The Compilation Unit that contains the Annotation AST Node.
* @param annotationNode The Lombok AST Node representing the Annotation AST Node.
* @param annotation 'node.get()' - convenience parameter.
*/
public void handleAnnotation(CompilationUnitDeclaration ast, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation, long priority) {
TypeResolver resolver = new TypeResolver(annotationNode.getImportList());
TypeReference rawType = annotation.type;
if (rawType == null) return;
String fqn = resolver.typeRefToFullyQualifiedName(annotationNode, typeLibrary, toQualifiedName(annotation.type.getTypeName()));
if (fqn == null) return;
AnnotationHandlerContainer<?> container = annotationHandlers.get(fqn);
if (container == null) return;
if (priority != container.getPriority()) return;
if (!annotationNode.isCompleteParse() && container.deferUntilPostDiet()) {
if (needsHandling(annotation)) container.preHandle(annotation, annotationNode);
return;
}
try {
if (checkAndSetHandled(annotation)) container.handle(annotation, annotationNode);
} catch (AnnotationValueDecodeFail fail) {
fail.owner.setError(fail.getMessage(), fail.idx);
} catch (Throwable t) {
error(ast, String.format("Lombok annotation handler %s failed", container.handler.getClass()), t);
}
}
示例2: handleAnnotation
import lombok.core.TypeResolver; //导入方法依赖的package包/类
/**
* Handles the provided annotation node by first finding a qualifying instance of
* {@link JavacAnnotationHandler} and if one exists, calling it with a freshly cooked up
* instance of {@link lombok.core.AnnotationValues}.
*
* Note that depending on the printASTOnly flag, the {@link lombok.core.PrintAST} annotation
* will either be silently skipped, or everything that isn't {@code PrintAST} will be skipped.
*
* The HandlerLibrary will attempt to guess if the given annotation node represents a lombok annotation.
* For example, if {@code lombok.*} is in the import list, then this method will guess that
* {@code Getter} refers to {@code lombok.Getter}, presuming that {@link lombok.javac.handlers.HandleGetter}
* has been loaded.
*
* @param unit The Compilation Unit that contains the Annotation AST Node.
* @param node The Lombok AST Node representing the Annotation AST Node.
* @param annotation 'node.get()' - convenience parameter.
*/
public void handleAnnotation(JCCompilationUnit unit, JavacNode node, JCAnnotation annotation, long priority) {
TypeResolver resolver = new TypeResolver(node.getImportList());
String rawType = annotation.annotationType.toString();
String fqn = resolver.typeRefToFullyQualifiedName(node, typeLibrary, rawType);
if (fqn == null) return;
AnnotationHandlerContainer<?> container = annotationHandlers.get(fqn);
if (container == null) return;
try {
if (container.getPriority() == priority) {
if (checkAndSetHandled(annotation)) container.handle(node);
}
} catch (AnnotationValueDecodeFail fail) {
fail.owner.setError(fail.getMessage(), fail.idx);
} catch (Throwable t) {
String sourceName = "(unknown).java";
if (unit != null && unit.sourcefile != null) sourceName = unit.sourcefile.getName();
javacError(String.format("Lombok annotation handler %s failed on " + sourceName, container.handler.getClass()), t);
}
}
示例3: handleAnnotation
import lombok.core.TypeResolver; //导入方法依赖的package包/类
/**
* Handles the provided annotation node by first finding a qualifying instance of
* {@link EclipseAnnotationHandler} and if one exists, calling it with a freshly cooked up
* instance of {@link AnnotationValues}.
*
* Note that depending on the printASTOnly flag, the {@link lombok.core.PrintAST} annotation
* will either be silently skipped, or everything that isn't {@code PrintAST} will be skipped.
*
* The HandlerLibrary will attempt to guess if the given annotation node represents a lombok annotation.
* For example, if {@code lombok.*} is in the import list, then this method will guess that
* {@code Getter} refers to {@code lombok.Getter}, presuming that {@link lombok.eclipse.handlers.HandleGetter}
* has been loaded.
*
* @param ast The Compilation Unit that contains the Annotation AST Node.
* @param annotationNode The Lombok AST Node representing the Annotation AST Node.
* @param annotation 'node.get()' - convenience parameter.
*/
public void handleAnnotation(CompilationUnitDeclaration ast, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation, long priority) {
TypeResolver resolver = new TypeResolver(annotationNode.getImportList());
TypeReference rawType = annotation.type;
if (rawType == null) return;
String fqn = resolver.typeRefToFullyQualifiedName(annotationNode, typeLibrary, toQualifiedName(annotation.type.getTypeName()));
if (fqn == null) return;
AnnotationHandlerContainer<?> container = annotationHandlers.get(fqn);
if (container == null) return;
if (priority != container.getPriority()) return;
if (container.deferUntilBuildFieldsAndMethods()) return;
if (!annotationNode.isCompleteParse() && container.deferUntilPostDiet()) {
if (needsHandling(annotation)) container.preHandle(annotation, annotationNode);
return;
}
try {
if (checkAndSetHandled(annotation)) container.handle(annotation, annotationNode);
} catch (AnnotationValueDecodeFail fail) {
fail.owner.setError(fail.getMessage(), fail.idx);
} catch (Throwable t) {
error(ast, String.format("Lombok annotation handler %s failed", container.handler.getClass()), t);
}
}