예제 #1
0
 private static void addSuppressWarningsAll(
     JCModifiers mods, JavacNode node, int pos, JCTree source) {
   TreeMaker maker = node.getTreeMaker();
   JCExpression suppressWarningsType = chainDots(node, "java", "lang", "SuppressWarnings");
   JCLiteral allLiteral = maker.Literal("all");
   suppressWarningsType.pos = pos;
   allLiteral.pos = pos;
   JCAnnotation annotation =
       recursiveSetGeneratedBy(
           maker.Annotation(suppressWarningsType, List.<JCExpression>of(allLiteral)), source);
   annotation.pos = pos;
   mods.annotations = mods.annotations.append(annotation);
 }
예제 #2
0
 @Override
 public JCTree visitClassDecl(final lombok.ast.ClassDecl node, final Void p) {
   final JCModifiers mods =
       setGeneratedBy(
           M(node)
               .Modifiers(
                   flagsFor(node.getModifiers()),
                   build(node.getAnnotations(), JCAnnotation.class)),
           source);
   if (node.isInterface()) mods.flags |= Flags.INTERFACE;
   final ListBuffer<JCTree> defs = ListBuffer.lb();
   defs.appendList(build(node.getFields()));
   defs.appendList(build(node.getMethods()));
   defs.appendList(build(node.getMemberTypes()));
   final List<JCTypeParameter> typarams = build(node.getTypeParameters());
   final JCExpression extending = build(node.getSuperclass());
   final List<JCExpression> implementing = build(node.getSuperInterfaces());
   final JCClassDecl classDecl =
       setGeneratedBy(
           createClassDef(
               node, mods, name(node.getName()), typarams, extending, implementing, defs.toList()),
           source);
   return classDecl;
 }