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

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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