public class SuccinctAdapter extends LanguageAdapterBase
LanguageAdapter
that supports the Velocity templating language.Modifier and Type | Field and Description |
---|---|
static String |
CASTER_ATTRIBUTE |
static String |
CASTER_CONTEXT_ATTRIBUTE |
static String |
FILLER_ATTRIBUTE |
static String |
FORMATTER_ATTRIBUTE |
static String |
INCLUSION_KEY |
static String |
SOURCE_ATTRIBUTE |
DEFAULT_EXTENSION, DEFAULT_TAG, EXTENSIONS, LANGUAGE_NAME, LANGUAGE_VERSION, NAME, TAGS, VERSION
Constructor and Description |
---|
SuccinctAdapter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Program |
createProgram(String sourceCode,
boolean isScriptlet,
int position,
int startLineNumber,
int startColumnNumber,
Executable executable)
Turns source code into a program.
|
Caster<Object> |
getCaster(ExecutionContext executionContext) |
Object |
getCasterContext(ExecutionContext executionContext) |
Filler |
getFiller(Executable executable,
ExecutionContext executionContext) |
Formatter |
getFormatter(ExecutionContext executionContext) |
String |
getSourceCodeForExpressionInclude(String expression,
Executable executable)
Creates source code for including the output of a text-with-scriptlets
document.
|
String |
getSourceCodeForExpressionOutput(String expression,
Executable executable)
Creates source code for outputting a source code expression to standard
output.
|
String |
getSourceCodeForLiteralOutput(String literal,
Executable executable)
Creates source code for outputting literal text to standard output.
|
TemplateSource |
getTemplateSource(ExecutionContext executionContext) |
enter, getAttributes, getLock, getManager, isEphemeral, isThreadSafe, releaseContext, setManager
public static final String SOURCE_ATTRIBUTE
public static final String FORMATTER_ATTRIBUTE
public static final String FILLER_ATTRIBUTE
public static final String CASTER_ATTRIBUTE
public static final String CASTER_CONTEXT_ATTRIBUTE
public static final String INCLUSION_KEY
public SuccinctAdapter() throws LanguageAdapterException
LanguageAdapterException
- In case of an initialization errorpublic TemplateSource getTemplateSource(ExecutionContext executionContext)
public Formatter getFormatter(ExecutionContext executionContext)
public Filler getFiller(Executable executable, ExecutionContext executionContext)
public Caster<Object> getCaster(ExecutionContext executionContext)
public Object getCasterContext(ExecutionContext executionContext)
public String getSourceCodeForLiteralOutput(String literal, Executable executable) throws ParsingException
LanguageAdapter
getSourceCodeForLiteralOutput
in interface LanguageAdapter
getSourceCodeForLiteralOutput
in class LanguageAdapterBase
literal
- The literal textexecutable
- The executableParsingException
- In case of a parsing errorpublic String getSourceCodeForExpressionOutput(String expression, Executable executable) throws ParsingException
LanguageAdapter
getSourceCodeForExpressionOutput
in interface LanguageAdapter
getSourceCodeForExpressionOutput
in class LanguageAdapterBase
expression
- The source code expressionexecutable
- The executableParsingException
- In case of a parsing errorpublic String getSourceCodeForExpressionInclude(String expression, Executable executable) throws ParsingException
LanguageAdapter
For this to work, the executable must have been created with a container
that supports an inclusion command named according to the language
manager attribute
LanguageManager.CONTAINER_INCLUDE_COMMAND_ATTRIBUTE
.
getSourceCodeForExpressionInclude
in interface LanguageAdapter
getSourceCodeForExpressionInclude
in class LanguageAdapterBase
expression
- The source code expressionexecutable
- The executableParsingException
- In case of a parsing errorLanguageManager.getAttributes()
public Program createProgram(String sourceCode, boolean isScriptlet, int position, int startLineNumber, int startColumnNumber, Executable executable) throws ParsingException
LanguageAdapter
Program.prepare()
on the program.sourceCode
- The source codeisScriptlet
- Whether the source code is a scriptletposition
- The program's position in the executablestartLineNumber
- The line number in the document for where the program's source
code beginsstartColumnNumber
- The column number in the document for where the program's source
code beginsexecutable
- The executableParsingException
- In case of a parsing errorCopyright © 2009-2015 Three Crickets LLC.