congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CompilerBytecodeLoader
Code IndexAdd Tabnine to your IDE (free)

How to use
CompilerBytecodeLoader
in
org.kie.dmn.feel.codegen.feel11

Best Java code snippets using org.kie.dmn.feel.codegen.feel11.CompilerBytecodeLoader (Showing top 15 results out of 315)

origin: org.kie/kie-dmn-feel

/**
 * Generates a compilable class that reports a (compile-time) error at runtime
 */
public static CompiledFEELExpression compiledError(String expression, String msg) {
  return new CompilerBytecodeLoader()
      .makeFromJPExpression(
          expression,
          compiledErrorExpression(msg),
          Collections.emptySet());
}
origin: org.kie/kie-dmn-feel

public <T> T internal_makefromJP(Class<T> clazz, String templateResourcePath, String cuPackage, String cuClass, String feelExpression, Expression theExpression, Set<FieldDeclaration> fieldDeclarations) {
  CompilationUnit cu = getCompilationUnit(clazz, templateResourcePath, cuPackage, cuClass, feelExpression, theExpression, fieldDeclarations );
  return compileUnit(cuPackage, cuClass, cu);
}
origin: org.kie/kie-dmn-feel

public CompiledFEELExpression makeFromJPExpression(String feelExpression, Expression theExpression, Set<FieldDeclaration> fieldDeclarations) {
  return internal_makefromJP(CompiledFEELExpression.class, "/TemplateCompiledFEELExpression.java", generateRandomPackage(), "TemplateCompiledFEELExpression", feelExpression, theExpression, fieldDeclarations);
}
origin: org.kie/kie-dmn-feel

private CompiledFEELUnaryTests parse(String input, Map<String, Type> inputTypes, FEELEventListenersManager mgr, CompiledFEELSupport.SyntaxErrorListener listener) {
  FEEL_1_1Parser parser = FEELParser.parse(mgr, input, inputTypes, Collections.emptyMap(), Collections.emptyList(), Collections.emptyList());
  ParseTree tree = parser.unaryTestsRoot();
  DirectCompilerResult directResult;
  if (listener.isError()) {
    directResult = CompiledFEELSupport.compiledErrorUnaryTest(listener.event().getMessage());
  } else {
    ASTBuilderVisitor v = new ASTBuilderVisitor(inputTypes);
    BaseNode node = v.visit(tree);
    BaseNode transformed = node.accept(new ASTUnaryTestTransform()).node();
    directResult = transformed.accept(new ASTCompilerVisitor());
  }
  Expression expr = directResult.getExpression();
  CompiledFEELUnaryTests cu = new CompilerBytecodeLoader().makeFromJPUnaryTestsExpression(input, expr, directResult.getFieldDeclarations());
  return cu;
}

origin: org.kie/kie-dmn-feel

public CompiledFEELExpression makeFromJPExpression(Expression theExpression) {
  return makeFromJPExpression(null, theExpression, Collections.emptySet());
}
origin: org.kie/kie-dmn-feel

public String getSourceForUnaryTest(String packageName, String className, String feelExpression, Expression theExpression, Set<FieldDeclaration> fieldDeclarations) {
  CompilationUnit cu = getCompilationUnit(CompiledFEELUnaryTests.class, "/TemplateCompiledFEELUnaryTests.java", packageName, className, feelExpression, theExpression, fieldDeclarations );
  ClassOrInterfaceDeclaration classSource = cu.getClassByName( className ).get();
  classSource.setStatic( true );
  return classSource.toString();
}
origin: org.kie/kie-dmn-feel

public UnaryTestCompiledExecutableExpression getCompiled() {
  CompiledFEELUnaryTests compiledFEELExpression =
      compiler.compileUnit(
          packageName,
          TEMPLATE_CLASS,
          getSourceCode());
  return new UnaryTestCompiledExecutableExpression(compiledFEELExpression);
}
origin: org.kie/kie-dmn-feel

public CompiledFEELUnaryTests makeFromJPUnaryTestsExpression(String packageName, String className, String feelExpression, Expression theExpression, Set<FieldDeclaration> fieldDeclarations) {
  return internal_makefromJP(CompiledFEELUnaryTests.class, "/TemplateCompiledFEELUnaryTests.java", packageName, className, feelExpression, theExpression, fieldDeclarations);
}
origin: org.kie/kie-dmn-feel

public String getSourceForUnaryTest(String packageName, String className, String feelExpression, DirectCompilerResult directResult) {
  return getSourceForUnaryTest(packageName, className, feelExpression, directResult.getExpression(), directResult.getFieldDeclarations());
}
origin: org.kie/kie-dmn-feel

    .filter(fd -> !isUnaryTest(fd))
    .sorted(new SortFieldDeclarationStrategy()).forEach(classDecl::addMember);
fieldDeclarations.stream()
origin: org.kie/kie-dmn-feel

public CompilationUnit getSourceCode() {
  DirectCompilerResult compilerResult = getCompilerResult();
  return compiler.getCompilationUnit(
      CompiledFEELUnaryTests.class,
      TEMPLATE_RESOURCE,
      packageName,
      TEMPLATE_CLASS,
      expression,
      compilerResult.getExpression(),
      compilerResult.getFieldDeclarations());
}
origin: org.kie/kie-dmn-feel

public CompiledExecutableExpression getCompiled() {
  CompiledFEELExpression compiledFEELExpression =
      compiler.compileUnit(
          packageName,
          TEMPLATE_CLASS,
          getSourceCode());
  return new CompiledExecutableExpression(compiledFEELExpression);
}
origin: org.kie/kie-dmn-feel

private CompiledFEELExpression parse(String input, Map<String, Type> inputTypes) {
  FEEL_1_1Parser parser = FEELParser.parse(null, input, inputTypes, Collections.emptyMap(), Collections.emptyList(), Collections.emptyList());
  ParseTree tree = parser.compilation_unit();
  ASTBuilderVisitor v = new ASTBuilderVisitor(inputTypes);
  BaseNode node = v.visit(tree);
  DirectCompilerResult directResult = node.accept(new ASTCompilerVisitor());
  
  Expression expr = directResult.getExpression();
  CompiledFEELExpression cu = new CompilerBytecodeLoader().makeFromJPExpression(input, expr, directResult.getFieldDeclarations());
  return cu;
}

origin: org.kie/kie-dmn-feel

public CompiledFEELUnaryTests makeFromJPUnaryTestsExpression(String feelExpression, Expression theExpression, Set<FieldDeclaration> fieldDeclarations) {
  return internal_makefromJP(CompiledFEELUnaryTests.class, "/TemplateCompiledFEELUnaryTests.java", generateRandomPackage(), "TemplateCompiledFEELUnaryTests", feelExpression, theExpression, fieldDeclarations);
}
origin: org.kie/kie-dmn-feel

public CompilationUnit getSourceCode() {
  DirectCompilerResult compilerResult = getCompilerResult();
  return compiler.getCompilationUnit(
      CompiledFEELExpression.class,
      TEMPLATE_RESOURCE,
      packageName,
      TEMPLATE_CLASS,
      expression,
      compilerResult.getExpression(),
      compilerResult.getFieldDeclarations());
}
org.kie.dmn.feel.codegen.feel11CompilerBytecodeLoader

Most used methods

  • <init>
  • makeFromJPExpression
  • compileUnit
  • generateRandomPackage
  • getCompilationUnit
  • getSourceForUnaryTest
  • internal_makefromJP
  • isUnaryTest
  • makeFromJPUnaryTestsExpression

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JButton (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now