Class LabeledStmt

All Implemented Interfaces:
NodeWithRange<Node>, NodeWithTokenRange<Node>, Observable, Visitable, HasParentNode<Node>, Cloneable

public class LabeledStmt extends Statement
A statement that is labeled, like label123: println("continuing");
Author:
Julio Vilmar Gesser
  • Constructor Details

    • LabeledStmt

      public LabeledStmt()
    • LabeledStmt

      public LabeledStmt(String label, Statement statement)
    • LabeledStmt

      public LabeledStmt(SimpleName label, Statement statement)
    • LabeledStmt

      public LabeledStmt(TokenRange tokenRange, SimpleName label, Statement statement)
      This constructor is used by the parser and is considered private.
  • Method Details

    • accept

      public <R,​ A> R accept(GenericVisitor<R,​A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      R - the type of the return value of the visitor
      A - the type the user argument passed to the visitor
      Parameters:
      v - the visitor implementation
      arg - the argument passed to the visitor (of type A)
      Returns:
      the result of the visit (of type R)
    • accept

      public <A> void accept(VoidVisitor<A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      A - the type the argument passed for the visitor
      Parameters:
      v - the visitor implementation
      arg - any value relevant for the visitor (of type A)
    • getStatement

      public Statement getStatement()
    • setStatement

      public LabeledStmt setStatement(Statement statement)
    • getLabel

      public SimpleName getLabel()
    • setLabel

      public LabeledStmt setLabel(SimpleName label)
    • clone

      public LabeledStmt clone()
      Overrides:
      clone in class Statement
    • getMetaModel

      public LabeledStmtMetaModel getMetaModel()
      Overrides:
      getMetaModel in class Statement
      Returns:
      get JavaParser specific node introspection information.
    • replace

      public boolean replace(Node node, Node replacementNode)
      Overrides:
      replace in class Node
    • isLabeledStmt

      public boolean isLabeledStmt()
      Overrides:
      isLabeledStmt in class Statement
    • asLabeledStmt

      public LabeledStmt asLabeledStmt()
      Overrides:
      asLabeledStmt in class Statement
    • ifLabeledStmt

      public void ifLabeledStmt(Consumer<LabeledStmt> action)
      Overrides:
      ifLabeledStmt in class Statement
    • toLabeledStmt

      public Optional<LabeledStmt> toLabeledStmt()
      Overrides:
      toLabeledStmt in class Statement