Package io.jans.agama.dsl
Class Transpiler
- java.lang.Object
-
- io.jans.agama.dsl.Transpiler
-
public class Transpiler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
UTIL_SCRIPT_CONTENTS
static String
UTIL_SCRIPT_NAME
-
Constructor Summary
Constructors Constructor Description Transpiler(String flowQName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description net.sf.saxon.s9api.XdmNode
asXML(String DSLCode)
String
generateJS(net.sf.saxon.s9api.XdmNode node)
List<String>
getInputs(net.sf.saxon.s9api.XdmNode node)
Integer
getTimeout(net.sf.saxon.s9api.XdmNode node)
static void
main(String... args)
static void
runSyntaxCheck(String source)
static void
runSyntaxCheck(String flowQname, String source)
static TranspilationResult
transpile(String flowQname, String source)
Transpiles the input source code to code runnable by Agama flow engine in the form of a Javascript function
-
-
-
Field Detail
-
UTIL_SCRIPT_NAME
public static final String UTIL_SCRIPT_NAME
- See Also:
- Constant Field Values
-
UTIL_SCRIPT_CONTENTS
public static final String UTIL_SCRIPT_CONTENTS
-
-
Constructor Detail
-
Transpiler
public Transpiler(String flowQName) throws TranspilerException
- Throws:
TranspilerException
-
-
Method Detail
-
asXML
public net.sf.saxon.s9api.XdmNode asXML(String DSLCode) throws SyntaxException, TranspilerException, net.sf.saxon.s9api.SaxonApiException
- Throws:
SyntaxException
TranspilerException
net.sf.saxon.s9api.SaxonApiException
-
getInputs
public List<String> getInputs(net.sf.saxon.s9api.XdmNode node) throws net.sf.saxon.s9api.SaxonApiException
- Throws:
net.sf.saxon.s9api.SaxonApiException
-
getTimeout
public Integer getTimeout(net.sf.saxon.s9api.XdmNode node) throws net.sf.saxon.s9api.SaxonApiException
- Throws:
net.sf.saxon.s9api.SaxonApiException
-
generateJS
public String generateJS(net.sf.saxon.s9api.XdmNode node) throws TranspilerException
- Throws:
TranspilerException
-
transpile
public static TranspilationResult transpile(String flowQname, String source) throws TranspilerException, SyntaxException
Transpiles the input source code to code runnable by Agama flow engine in the form of a Javascript function- Parameters:
flowQname
- Qualified name of the input flowsource
- Source code of input flow (written using Agama DSL)- Returns:
- A TranspilerResult object holding the details of the generated function
- Throws:
SyntaxException
- When the input source has syntactic errors, details are contained in the exception thrownTranspilerException
- When other kind of processing error occurred.
-
runSyntaxCheck
public static void runSyntaxCheck(String flowQname, String source) throws SyntaxException, TranspilerException
- Throws:
SyntaxException
TranspilerException
-
runSyntaxCheck
public static void runSyntaxCheck(String source) throws SyntaxException, TranspilerException
- Throws:
SyntaxException
TranspilerException
-
-