Examples of astContents()


Examples of lombok.ast.Block.astContents()

  }
 
  public void checkSwitchStartsWithDefaultOrCase(Switch node) {
    Block body = node.astBody();
    if (body != null) {
      Statement first = body.astContents().first();
      if (first != null && !(first instanceof Case) && !(first instanceof Default)) {
        node.addMessage(error(SWITCH_DOES_NOT_START_WITH_CASE, "switch statements should start with a default or case statement."));
      }
    }
  }
View Full Code Here

Examples of lombok.ast.Block.astContents()

  }
 
  private void constructorInvocationMustBeFirst(Statement node, String desc) {
    if (node.getParent() == null) return;
    Block b = node.upToBlock();
    if (b == null || b.upToConstructorDeclaration() == null || b.astContents().first() != node) {
      node.addMessage(error(CONSTRUCTOR_INVOCATION_NOT_LEGAL_HERE, "Calling " + desc + " must be the first statement in a constructor."));
      return;
    }
  }
 
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.