Class ScriptDefinition
public final class ScriptDefinition
Describes a reusable script source and its implementation class.
Definitions are registered with ScriptManager.setDefinitions(Collection) and referenced by
ScriptBinding.getScript(). Source resolution and compilation are delegated to the selected
ScriptProvider.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty JAXB definition.ScriptDefinition(ScriptDefinition definition) Creates an independent snapshot of another definition.ScriptDefinition(String id, String language, String source, String implementation, ScriptHostType host) Creates a definition. -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Returns the required host category.getId()Returns the unique identifier.Returns the implementation class name.Returns the provider language identifier.getName()Returns the display name.Returns the source path or resource name.Returns an optional required host class.voidsetHost(ScriptHostType host) Sets the required host category.voidSets the unique identifier.voidsetImplementation(String implementation) Sets the implementation class name.voidsetLanguage(String language) Sets the provider language identifier.voidSets the display name.voidSets the source path or resource name.voidsetTargetType(String targetType) Sets an optional required host class.validate()Validates fields required for registration.
-
Constructor Details
-
ScriptDefinition
public ScriptDefinition()Creates an empty JAXB definition. -
ScriptDefinition
public ScriptDefinition(String id, String language, String source, String implementation, ScriptHostType host) Creates a definition.- Parameters:
id- The unique definition identifier.language- The provider language identifier.source- The source path or resource name.implementation- The fully qualified implementation class name.host- The required host category.
-
ScriptDefinition
Creates an independent snapshot of another definition.- Parameters:
definition- The definition to copy.
-
-
Method Details
-
validate
-
getId
-
getName
-
getLanguage
Returns the provider language identifier.- Returns:
- The language identifier.
-
getSource
Returns the source path or resource name.- Returns:
- The source, or
nullfor precompiled code.
-
getImplementation
Returns the implementation class name.- Returns:
- The fully qualified class name.
-
getHost
-
getTargetType
Returns an optional required host class.- Returns:
- The fully qualified type name, or
null.
-
setId
-
setName
-
setLanguage
Sets the provider language identifier.- Parameters:
language- The language identifier.
-
setSource
Sets the source path or resource name.- Parameters:
source- The source.
-
setImplementation
Sets the implementation class name.- Parameters:
implementation- The fully qualified class name.
-
setHost
Sets the required host category.- Parameters:
host- The host category.
-
setTargetType
Sets an optional required host class.- Parameters:
targetType- The fully qualified type name.
-