本文整理匯總了Java中lombok.core.PrintAST類的典型用法代碼示例。如果您正苦於以下問題:Java PrintAST類的具體用法?Java PrintAST怎麽用?Java PrintAST使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PrintAST類屬於lombok.core包,在下文中一共展示了PrintAST類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handle
import lombok.core.PrintAST; //導入依賴的package包/類
public void handle(AnnotationValues<PrintAST> annotation, Annotation ast, EclipseNode annotationNode) {
PrintStream stream = System.out;
String fileName = annotation.getInstance().outfile();
if (fileName.length() > 0) try {
stream = new PrintStream(new File(fileName));
} catch (FileNotFoundException e) {
Lombok.sneakyThrow(e);
}
annotationNode.up().traverse(new EclipseASTVisitor.Printer(annotation.getInstance().printContent(), stream, annotation.getInstance().printPositions()));
}
示例2: handle
import lombok.core.PrintAST; //導入依賴的package包/類
@Override public void handle(AnnotationValues<PrintAST> annotation, JCAnnotation ast, JavacNode annotationNode) {
PrintStream stream = System.out;
String fileName = annotation.getInstance().outfile();
if (fileName.length() > 0) try {
stream = new PrintStream(new File(fileName));
} catch (FileNotFoundException e) {
Lombok.sneakyThrow(e);
}
annotationNode.up().traverse(new JavacASTVisitor.Printer(annotation.getInstance().printContent(), stream));
}