public class Action
extends java.lang.Object
ACIS
system.
Actions are the key part of the system as they provide functionality.Modifier and Type | Class and Description |
---|---|
static interface |
Action.ActionMethod
This interface includes the run() function which contains the core code
of the
Action . |
Constructor and Description |
---|
Action(java.lang.String actionName,
ActionPackage pack,
ContextVisibility contextVisibility,
java.lang.String trigger,
Action.ActionMethod method)
Creates a new Action Object.
|
Modifier and Type | Method and Description |
---|---|
Action.ActionMethod |
getActionMethod()
A function which returns the
Action.ActionMethod . |
ActionParameter[] |
getActionParams()
A function which returns the parameters declared in the Action's trigger.
|
static Action[] |
getActions(java.lang.String actionName,
ActionPackage pack,
ContextVisibility contextVisibility,
java.lang.String[] triggers,
Action.ActionMethod method)
Creates multiple Actions with same properties but different triggers.
|
ContextVisibility |
getContextVisibility()
A function which returns the
ContextVisibility of the Action. |
java.lang.String |
getName()
A function which returns the name of the Action.
|
ActionPackage |
getPackage()
A function which returns the
ActionPackage the Action belongs to. |
java.lang.String |
getTrigger()
A function which returns the trigger of the Action.
|
public Action(java.lang.String actionName, ActionPackage pack, ContextVisibility contextVisibility, java.lang.String trigger, Action.ActionMethod method) throws ActionMalformedException
trigger
parameters are allowed to directly gather certain
parts of the user input. Parameters are declared like in the following
example: "say hello to <<p$0>> and <<p$1>>".
Syntax: <<PARAMETERTYPE$INDEX>> Note: The parameter type
currently has no effect, so any expression is allowed here (see
ParameterType
). The index specifies the order the parameters are
given back in the Action.ActionMethod
(should start at 0 counting
up). When the same index occurs more than once or the specified parameter
type does not exist the Action is considered as malformed and an
ActionMalformedException
is thrown.actionName
- The name of the Action.pack
- The ActionPackage
the Action belongs to.contextVisibility
- The ContextVisibility
.trigger
- The trigger keyphrase.method
- The Action.ActionMethod
containing the core functionality of
the Action.ActionMalformedException
- When the trigger
is malformed.public static Action[] getActions(java.lang.String actionName, ActionPackage pack, ContextVisibility contextVisibility, java.lang.String[] triggers, Action.ActionMethod method) throws ActionMalformedException
Action(String, ActionPackage, ContextVisibility, String, ActionMethod)
for each trigger.actionName
- The name of the Actions.pack
- The ActionPackage
the Actions belong to.contextVisibility
- The ContextVisibility
.triggers
- Multiple trigger keyphrases.method
- The Action.ActionMethod
containing the core functionality of
the Action.ActionMalformedException
- When one or more triggers
are malformed.Action(String, ActionPackage, ContextVisibility, String,
ActionMethod)
public java.lang.String getName()
public ActionPackage getPackage()
ActionPackage
the Action belongs to.public ContextVisibility getContextVisibility()
ContextVisibility
of the Action.public Action.ActionMethod getActionMethod()
Action.ActionMethod
.public ActionParameter[] getActionParams()
ActionParameter
array.public java.lang.String getTrigger()