Home | History | Annotate | Download | only in nodeTypes
      1 package com.github.javaparser.ast.nodeTypes;
      2 
      3 import com.github.javaparser.ast.Node;
      4 import com.github.javaparser.ast.stmt.BlockStmt;
      5 import com.github.javaparser.ast.stmt.Statement;
      6 
      7 public interface NodeWithBody<T> {
      8     public Statement getBody();
      9 
     10     public T setBody(final Statement body);
     11 
     12     public default BlockStmt createBlockStatementAsBody() {
     13         BlockStmt b = new BlockStmt();
     14         b.setParentNode((Node) this);
     15         setBody(b);
     16         return b;
     17     }
     18 }
     19