Package scriptella.core
Class ScriptExecutor
java.lang.Object
scriptella.core.ScriptExecutor
- All Implemented Interfaces:
ExecutableElement
<script> element executor.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidexecute(DynamicContext ctx) Executes the element.protected voidexecute(Connection connection, Resource resource, DynamicContext ctx) Executes a script or a query resource using the specified connection.getContent(DialectIdentifier dialectIdentifier) Returns content satisfying dialect information.Returns scripting element specified inconstructorA short forgetElement().getLocation()static ExecutableElementprotected ContentElprepareContent(ContentEl content) Prepares the content for later execution.
-
Field Details
-
log
-
debug
protected final boolean debug
-
-
Constructor Details
-
ScriptExecutor
-
-
Method Details
-
execute
Executes a script or a query resource using the specified connection.- Parameters:
connection- connection to use for element execution.resource- query/script content to execute.ctx- dynamic context to use for variables, etc.
-
prepare
-
getElement
Returns scripting element specified inconstructor- Returns:
- scripting element
-
execute
Description copied from interface:ExecutableElementExecutes the element.Note: the context may be decorated by
DynamicContextDecorator.- Specified by:
executein interfaceExecutableElement- Parameters:
ctx- context to use.
-
getContent
Returns content satisfying dialect information.This method caches contents based on dialects. For now we assume dialectIdentifier is constant for element.
- Parameters:
dialectIdentifier- dialect identifier.- Returns:
- content for dialect. Not null.
-
getLocation
A short forgetElement().getLocation()- Returns:
- element location.
-
prepareContent
Prepares the content for later execution.If content is dynamic, i.e. contains includes with bind variables, the properties substitutor is specified, otherwise no properties .
- Parameters:
content- content to traverse.- Returns:
- the same content object for convenience only.
-