Constructor and Description |
---|
DocumentService(Shell shell,
ExecutionContext executionContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(String documentName)
Executes a source code document.
|
void |
executeOnce(String documentName)
As
execute(String) , but will only execute once per this thread. |
String |
getDefaultLanguageTag()
For use with
include(String) and execute(String) , this
is the default language tag used for scriptlets in case none is
specified. |
CopyOnWriteArrayList<DocumentSource<Executable>> |
getLibrarySources()
The additional document sources to use.
|
String |
getPreferredExtension()
An extension to prefer if more than one file with the same name is in a
directory.
|
DocumentSource<Executable> |
getSource()
The document source.
|
void |
include(String documentName)
Includes a text document into the current location.
|
boolean |
markExecuted(String documentName,
boolean wasExecuted)
Marks a document as executed for this thread's
ExecutionContext . |
void |
require(String... documentNames)
|
void |
setDefaultLanguageTag(String defaultLanguageTag) |
void |
setPreferredExtension(String preferredExtension) |
public DocumentService(Shell shell, ExecutionContext executionContext)
shell
- The shell instanceexecutionContext
- The execution contextpublic DocumentSource<Executable> getSource()
public CopyOnWriteArrayList<DocumentSource<Executable>> getLibrarySources()
public String getDefaultLanguageTag()
include(String)
and execute(String)
, this
is the default language tag used for scriptlets in case none is
specified. Defaults to "js".setDefaultLanguageTag(String)
public void setDefaultLanguageTag(String defaultLanguageTag)
defaultLanguageTag
- The default language taggetDefaultLanguageTag()
public String getPreferredExtension()
DocumentFileSource
.setPreferredExtension(String)
public void setPreferredExtension(String preferredExtension)
preferredExtension
- The preferred extensiongetPreferredExtension()
public void execute(String documentName) throws ParsingException, ExecutionException, DocumentException, IOException
documentName
- The document nameParsingException
- In case of a parsing errorExecutionException
- In case of an execution errorDocumentException
- In case of a document retrieval errorIOException
- In case of a writing errorLanguageManager.getAdapterByExtension(String, String)
public void executeOnce(String documentName) throws ParsingException, ExecutionException, DocumentException, IOException
execute(String)
, but will only execute once per this thread.documentName
- The document nameParsingException
- In case of a parsing errorExecutionException
- In case of an execution errorDocumentException
- In case of a document retrieval errorIOException
- In case of a writing errormarkExecuted(String, boolean)
public void require(String... documentNames) throws ParsingException, ExecutionException, DocumentException, IOException
documentNames
- The document namesParsingException
- In case of a parsing errorExecutionException
- In case of an execution errorDocumentException
- In case of a document retrieval errorIOException
- In case of a writing errorpublic boolean markExecuted(String documentName, boolean wasExecuted)
ExecutionContext
.documentName
- The document namewasExecuted
- True if marked as executed, false to clear execution flagexecuteOnce(String)
public void include(String documentName) throws ParsingException, ExecutionException, DocumentException, IOException
documentName
- The document nameParsingException
- In case of a parsing errorExecutionException
- In case of an execution errorDocumentException
- In case of a document retrieval errorIOException
- In case of a writing errorCopyright © 2009-2015 Three Crickets LLC.