Class ASTParserUtils
java.lang.Object
org.jenkinsci.plugins.pipeline.modeldefinition.parser.ASTParserUtils
- All Implemented Interfaces:
groovy.lang.GroovyObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.codehaus.groovy.ast.expr.Expression
static org.codehaus.groovy.ast.stmt.BlockStatement
asBlock
(org.codehaus.groovy.ast.stmt.Statement st) static boolean
blockHasMethod
(org.codehaus.groovy.ast.stmt.BlockStatement block, String methodName) static BlockStatementMatch
blockStatementFromExpression
(org.codehaus.groovy.ast.expr.MethodCallExpression exp) static <T> List<T>
eachStatement
(org.codehaus.groovy.ast.stmt.Statement st, groovy.lang.Closure<T> c) groovy.lang.MetaClass
getProperty
(String property) invokeMethod
(String method, Object arguments) static boolean
isDeclarativePipelineStep
(org.codehaus.groovy.ast.stmt.Statement stmt) static boolean
isDeclarativePipelineStep
(org.codehaus.groovy.ast.stmt.Statement stmt, boolean topLevel) static boolean
isGroovyAST
(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement original) static BlockStatementMatch
matchBlockStatement
(org.codehaus.groovy.ast.stmt.Statement st) static org.codehaus.groovy.ast.expr.MethodCallExpression
matchMethodCall
(org.codehaus.groovy.ast.stmt.Statement st) static String
matchMethodName
(org.codehaus.groovy.ast.expr.MethodCallExpression exp) static List<org.codehaus.groovy.ast.expr.Expression>
methodCallArgs
(org.codehaus.groovy.ast.expr.MethodCallExpression expr) static org.codehaus.groovy.ast.expr.Expression
methodCallToDescribable
(org.codehaus.groovy.ast.expr.MethodCallExpression expr, Class<? extends Describable> descClass) static String
prettyPrint
(org.codehaus.groovy.ast.ASTNode n) static String
prettyPrint
(org.codehaus.groovy.ast.ASTNode n, int ind) static String
static org.codehaus.groovy.ast.expr.MapExpression
recurseAndTransformMappedClosure
(org.codehaus.groovy.ast.expr.ClosureExpression original) void
setMetaClass
(groovy.lang.MetaClass mc) void
setProperty
(String property, Object value) static org.codehaus.groovy.ast.expr.Expression
transformDescribableContainer
(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement original, List<org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement> children, Class containerClass, Class<? extends Describable> descClass) static org.codehaus.groovy.ast.expr.Expression
transformListOfDescribables
(List<org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement> children, Class<? extends Describable> descClass) static org.codehaus.groovy.ast.expr.Expression
transformWhenContentToRuntimeAST
(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenContent original)
-
Constructor Details
-
ASTParserUtils
public ASTParserUtils()
-
-
Method Details
-
prettyPrint
-
isDeclarativePipelineStep
public static boolean isDeclarativePipelineStep(org.codehaus.groovy.ast.stmt.Statement stmt) -
getMetaClass
public groovy.lang.MetaClass getMetaClass()- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc) - Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
matchMethodName
@CheckForNull public static String matchMethodName(org.codehaus.groovy.ast.expr.MethodCallExpression exp) -
printer
-
prettyPrint
-
blockStatementFromExpression
@CheckForNull public static BlockStatementMatch blockStatementFromExpression(@NonNull org.codehaus.groovy.ast.expr.MethodCallExpression exp) -
asBlock
public static org.codehaus.groovy.ast.stmt.BlockStatement asBlock(org.codehaus.groovy.ast.stmt.Statement st) -
matchMethodCall
@CheckForNull public static org.codehaus.groovy.ast.expr.MethodCallExpression matchMethodCall(org.codehaus.groovy.ast.stmt.Statement st) -
eachStatement
public static <T> List<T> eachStatement(org.codehaus.groovy.ast.stmt.Statement st, groovy.lang.Closure<T> c) -
matchBlockStatement
@CheckForNull public static BlockStatementMatch matchBlockStatement(org.codehaus.groovy.ast.stmt.Statement st) -
transformListOfDescribables
@NonNull public static org.codehaus.groovy.ast.expr.Expression transformListOfDescribables(@CheckForNull List<org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement> children, Class<? extends Describable> descClass) -
transformDescribableContainer
public static org.codehaus.groovy.ast.expr.Expression transformDescribableContainer(@CheckForNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement original, @CheckForNull List<org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement> children, @NonNull Class containerClass, @NonNull Class<? extends Describable> descClass) -
transformWhenContentToRuntimeAST
public static org.codehaus.groovy.ast.expr.Expression transformWhenContentToRuntimeAST(@CheckForNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenContent original) -
recurseAndTransformMappedClosure
@CheckForNull public static org.codehaus.groovy.ast.expr.MapExpression recurseAndTransformMappedClosure(@CheckForNull org.codehaus.groovy.ast.expr.ClosureExpression original) -
argsMap
@CheckForNull public static org.codehaus.groovy.ast.expr.Expression argsMap(List<org.codehaus.groovy.ast.expr.Expression> args) -
methodCallArgs
@NonNull public static List<org.codehaus.groovy.ast.expr.Expression> methodCallArgs(@NonNull org.codehaus.groovy.ast.expr.MethodCallExpression expr) -
methodCallToDescribable
@CheckForNull public static org.codehaus.groovy.ast.expr.Expression methodCallToDescribable(org.codehaus.groovy.ast.expr.MethodCallExpression expr, Class<? extends Describable> descClass) -
isGroovyAST
public static boolean isGroovyAST(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement original) -
blockHasMethod
public static boolean blockHasMethod(org.codehaus.groovy.ast.stmt.BlockStatement block, String methodName) -
isDeclarativePipelineStep
public static boolean isDeclarativePipelineStep(org.codehaus.groovy.ast.stmt.Statement stmt, boolean topLevel)
-