Class JavaParserUtils
java.lang.Object
org.kie.pmml.compiler.commons.utils.JavaParserUtils
Class to provide shared, helper methods to be invoked by model-specific
code-generation
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalsNode(com.github.javaparser.ast.Node node1, com.github.javaparser.ast.Node node2) static com.github.javaparser.ast.CompilationUnitgetFromFileName(String fileName) static com.github.javaparser.ast.CompilationUnitgetFromSource(String source) static StringgetFullClassName(com.github.javaparser.ast.CompilationUnit cu) Return the fully qualified name of the generated class.static com.github.javaparser.ast.CompilationUnitgetKiePMMLModelCompilationUnit(String className, String packageName, String javaTemplate, String modelClassName) static com.github.javaparser.ast.stmt.BlockStmtparseBlock(String block) static com.github.javaparser.ast.stmt.BlockStmtparseConstructorBlock(String block) static com.github.javaparser.ast.expr.ExpressionparseExpression(String statement) static com.github.javaparser.ast.body.MethodDeclarationparseMethod(String method) static com.github.javaparser.ast.stmt.StatementparseStatement(String statement) static StringprintNode(com.github.javaparser.ast.Node node)
-
Field Details
-
MAIN_CLASS_NOT_FOUND
- See Also:
-
-
Method Details
-
getFromFileName
-
getFromSource
-
getKiePMMLModelCompilationUnit
public static com.github.javaparser.ast.CompilationUnit getKiePMMLModelCompilationUnit(String className, String packageName, String javaTemplate, String modelClassName) - Parameters:
className-packageName-javaTemplate- the name of the file to be used as template sourcemodelClassName- the name of the class used in the provided template- Returns:
-
getFullClassName
Return the fully qualified name of the generated class. It throwsKiePMMLExceptionif the package name is missing- Parameters:
cu-- Returns:
-
parseMethod
-
parseBlock
-
parseConstructorBlock
-
parseStatement
-
parseExpression
-
equalsNode
public static boolean equalsNode(com.github.javaparser.ast.Node node1, com.github.javaparser.ast.Node node2) -
printNode
-