Package lombok.ast

Examples of lombok.ast.Switch


  public Node createAssertStatement(Node assertion, Node message) {
    return posify(new Assert().rawAssertion(assertion).rawMessage(message));
  }
 
  public Node createSwitchStatement(Node condition, Node body) {
    return posify(new Switch().rawCondition(condition).rawBody(body));
  }
View Full Code Here


 
  private void checkChildOfSwitch(Statement node, String desc) {
    if (node.getParent() == null) return;
   
    Block p = node.upToBlock();
    Switch gp = p == null ? null : p.upToSwitch();
    boolean genError = false;
   
    genError = p == null;
    genError |= gp == null && p.getParent() != null;
   
View Full Code Here

      }
      set(node, f);
    }
   
    @Override public void visitSwitch(JCSwitch node) {
      Switch s = new Switch();
      JCExpression cond = node.getExpression();
      setConversionPositionInfo(s, "()", getPosition(cond));
      s.rawCondition(toTree(removeParens(cond)));
      Block b = new Block();
      s.astBody(b);
      for (JCCase c : node.getCases()) {
        JCExpression rawExpr = c.getExpression();
        if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default()));
        else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr))));
        fillList(c.getStatements(), b.rawContents());
View Full Code Here

TOP

Related Classes of lombok.ast.Switch

Copyright © 2018 www.massapicom. 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.