Class ScriptBinding
public final class ScriptBinding
Configures one script attachment to a game, environment, or entity.
Bindings reference a ScriptDefinition by identifier and supply instance-specific parameters.
Lower order values attach first. The parameter-value list is the live JAXB representation;
getParameters() returns a convenient snapshot keyed by name.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an enabled binding without a script identifier.ScriptBinding(ScriptBinding binding) Creates an independent copy suitable for controller ownership.ScriptBinding(String script) Creates an enabled binding for a script.ScriptBinding(String script, boolean enabled) Creates a binding for a script. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()Returns the attachment order.Returns the configured parameters keyed by name.Returns the live JAXB parameter list.Returns the referenced definition identifier.booleanReturns whether this binding participates in attachment.voidsetEnabled(boolean enabled) Enables or disables this binding.voidsetOrder(int order) Sets the attachment order.voidsetParameter(String name, String value) Adds or replaces a named parameter.voidSets the referenced definition identifier.
-
Constructor Details
-
ScriptBinding
public ScriptBinding()Creates an enabled binding without a script identifier. -
ScriptBinding
Creates an enabled binding for a script.- Parameters:
script- The definition identifier.
-
ScriptBinding
Creates a binding for a script.- Parameters:
script- The definition identifier.enabled- Whether the binding should attach.
-
ScriptBinding
Creates an independent copy suitable for controller ownership.- Parameters:
binding- The binding to copy.
-
-
Method Details
-
getScript
Returns the referenced definition identifier.- Returns:
- The script identifier.
-
isEnabled
public boolean isEnabled()Returns whether this binding participates in attachment.- Returns:
truewhen enabled.
-
getOrder
public int getOrder()Returns the attachment order.- Returns:
- The order; lower values attach first.
-
getParameterValues
Returns the live JAXB parameter list.- Returns:
- The mutable parameter-value list.
-
setScript
Sets the referenced definition identifier.- Parameters:
script- The script identifier.
-
setEnabled
public void setEnabled(boolean enabled) Enables or disables this binding.- Parameters:
enabled- Whether it should attach.
-
setOrder
public void setOrder(int order) Sets the attachment order.- Parameters:
order- The order; lower values attach first.
-
getParameters
-
setParameter
Adds or replaces a named parameter.- Parameters:
name- The non-null parameter name.value- The parameter value; may benull.- Throws:
NullPointerException- ifnameisnull.
-