Package lombok.ast

Examples of lombok.ast.TypeDeclaration.astModifiers()


  }
 
  public void checkStaticInitializerInNonStaticType(StaticInitializer node) {
    TypeDeclaration parent = node.upUpToTypeDeclaration();
    if (parent != null) {
      if (!parent.astModifiers().isStatic()) {
        node.addMessage(error(INITIALIZER_STATIC_IN_NON_STATIC_TYPE,
            "static initializers are only allowed in top-level or static types declarations."));
      }
    }
  }
View Full Code Here


    Modifiers modifiers = md.astModifiers();
    if (modifiers == null) return;
    if (!modifiers.isAbstract()) return;
    TypeDeclaration parent = md.upUpToTypeDeclaration();
    if (parent != null) {
      Modifiers modifiersOfParent = parent.astModifiers();
      if (modifiersOfParent != null && modifiersOfParent.isAbstract()) return;
      md.addMessage(error(MODIFIERS_ABSTRACT_NOT_ALLOWED, "Abstract methods are only allowed in interfaces and abstract classes"));
    }
  }
 
View Full Code Here

      } else {
        throw new IllegalStateException("Unknown type declaration: " + node);
      }
     
      typeDecl.astName(new Identifier().astValue(name));
      typeDecl.astModifiers((Modifiers) toTree(node.mods));
      addJavadoc(typeDecl, node.mods);
      set(node, typeDecl);
    }
   
    @Override public void visitModifiers(JCModifiers node) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.