|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectubiware.core.BehaviorStartParameters
public class BehaviorStartParameters
Collection maintaining a list of BehaviorStartParameters. The collection can be queried for values of certain parameters. The current
implementation is an improved version from the previous implementations in GuiAgent, ReusableAtomicBehavior and
UbiwareAgent.
| Field Summary | |
|---|---|
(package private) java.util.List<java.lang.String> |
addOnEnd
|
(package private) java.util.List<java.lang.String> |
addOnFail
|
(package private) java.util.List<java.lang.String> |
addOnStart
A behaviour can have parameters like sapl:Success sapl:add ... |
(package private) java.util.List<java.lang.String> |
addOnSuccess
|
(package private) java.util.List<java.lang.String> |
removeOnEnd
|
(package private) java.util.List<java.lang.String> |
removeOnFail
|
(package private) java.util.List<java.lang.String> |
removeOnStart
|
(package private) java.util.List<java.lang.String> |
removeOnSuccess
|
| Constructor Summary | |
|---|---|
BehaviorStartParameters()
|
|
| Method Summary | |
|---|---|
void |
add(ubiware.util.saplbuilder.Resource parameter,
java.lang.String value)
Add a parameter to the collection. |
boolean |
getObligatedBooleanParameter(ubiware.util.saplbuilder.Resource name)
Returns a boolean representation of the value for that parameter |
java.lang.String |
getObligatedContainerID(ubiware.util.saplbuilder.Resource name)
Get the value for the given resource. |
java.io.File |
getObligatedFileParameter(ubiware.util.saplbuilder.Resource name)
Returns the File for the value of the parameter |
java.lang.String |
getObligatedNonEmptyStringParameter(ubiware.util.saplbuilder.Resource name)
Returns a non empty String representation of the value for that parameter |
int |
getObligatedNumericParameter(ubiware.util.saplbuilder.Resource name)
Returns a int representation of the value for that parameter. |
ubiware.util.saplbuilder.Resource |
getObligatedResourceParameter(ubiware.util.saplbuilder.Resource name)
Returns the Resource given as a value for the given parameter. |
java.lang.String |
getObligatedStringParameter(ubiware.util.saplbuilder.Resource name)
Returns a String representation of the value for that parameter |
java.net.URL |
getObligatedURLParameter(ubiware.util.saplbuilder.Resource name)
Returns the URL for the value of the parameter |
java.lang.Boolean |
getOptionalBooleanParameter(ubiware.util.saplbuilder.Resource name)
Returns a Boolean representation of the value for that parameter if it exists, otherwise null is returned. |
boolean |
getOptionalBooleanParameter(ubiware.util.saplbuilder.Resource name,
boolean defaultValue)
Returns a Boolean representation of the value for that parameter if it exists, otherwise the default is returned. |
java.lang.String |
getOptionalContainerID(ubiware.util.saplbuilder.Resource name)
Get the value for the given resource. |
java.lang.String |
getOptionalContainerID(ubiware.util.saplbuilder.Resource name,
java.lang.String defaultValue)
Get the value for the given resource. |
java.io.File |
getOptionalFileParameter(ubiware.util.saplbuilder.Resource name)
Returns the File for the value of the parameter or null if there is no such parameter. |
java.io.File |
getOptionalFileParameter(ubiware.util.saplbuilder.Resource name,
java.io.File defaultValue)
Returns the File for the value of the parameter or the default if there is no such parameter. |
java.lang.Integer |
getOptionalNumericParameter(ubiware.util.saplbuilder.Resource name)
Returns a Integer representation of the value for that parameter if it exists, otherwise null is returned. |
int |
getOptionalNumericParameter(ubiware.util.saplbuilder.Resource name,
int defaultValue)
Returns a Integer representation of the value for that parameter if it exists, otherwise the default is returned. |
ubiware.util.saplbuilder.Resource |
getOptionalResourceParameter(ubiware.util.saplbuilder.Resource name)
Returns the Resource given as a value for the given parameter or null if the parameter is not specified. |
ubiware.util.saplbuilder.Resource |
getOptionalResourceParameter(ubiware.util.saplbuilder.Resource name,
ubiware.util.saplbuilder.Resource defaultValue)
Returns the Resource given as a value for the given parameter or the default if the parameter is not specified. |
java.lang.String |
getOptionalStringParameter(ubiware.util.saplbuilder.Resource name)
Returns a String representation of the value for that parameter if it exists, otherwise null is returned. |
java.lang.String |
getOptionalStringParameter(ubiware.util.saplbuilder.Resource name,
java.lang.String defaultValue)
Returns a String representation of the value for that parameter if it exists, otherwise null is returned. |
java.net.URL |
getOptionalURLParameter(ubiware.util.saplbuilder.Resource name)
Returns the URL for the value of the parameter or null if there is no such parameter. |
java.net.URL |
getOptionalURLParameter(ubiware.util.saplbuilder.Resource name,
java.net.URL defaultValue)
Returns the URL for the value of the parameter or the default if there is no such parameter. |
(package private) com.google.common.collect.Multimap<ubiware.util.saplbuilder.Resource,java.lang.String> |
getParameters()
get an unmodifiable collection containing all parameters added. |
java.lang.String |
getParameterValue(ubiware.util.saplbuilder.Resource name)
Retrieves the value of the parameter from the collection. |
java.util.Collection<java.lang.String> |
getParameterValues(ubiware.util.saplbuilder.Resource name)
retrieves all the values of the parameter with the given parameter name from the collection in an unmodifiable collection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final java.util.List<java.lang.String> addOnStart
final java.util.List<java.lang.String> addOnEnd
final java.util.List<java.lang.String> addOnFail
final java.util.List<java.lang.String> addOnSuccess
final java.util.List<java.lang.String> removeOnStart
final java.util.List<java.lang.String> removeOnEnd
final java.util.List<java.lang.String> removeOnFail
final java.util.List<java.lang.String> removeOnSuccess
| Constructor Detail |
|---|
public BehaviorStartParameters()
| Method Detail |
|---|
public void add(ubiware.util.saplbuilder.Resource parameter,
java.lang.String value)
parameter - The resource of the parameter.value - The value of the parameter.com.google.common.collect.Multimap<ubiware.util.saplbuilder.Resource,java.lang.String> getParameters()
public java.lang.String getParameterValue(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - the parameter name
IllegalParameterConfigurationException - If multiple values are specified for this parameter.public java.util.Collection<java.lang.String> getParameterValues(ubiware.util.saplbuilder.Resource name)
name - the parameter name
public java.lang.String getObligatedStringParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name
public java.lang.String getObligatedNonEmptyStringParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name or the argument value is empty.
public java.lang.String getOptionalStringParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - thrown if more as one binding for this parameter is found.
public java.lang.String getOptionalStringParameter(ubiware.util.saplbuilder.Resource name,
java.lang.String defaultValue)
throws IllegalParameterConfigurationException
name - The name of the parameter.defaultValue - The default value if the parameter does not exist.
IllegalParameterConfigurationException - thrown if more as one binding for this parameter is found.
public java.lang.String getObligatedContainerID(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
IllegalParameterConfigurationException is thrown.
name - The name of the parameter.
IllegalParameterConfigurationException - If no such parameter is specified or the value is not a container ID.
public java.lang.String getOptionalContainerID(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
IllegalParameterConfigurationException is
thrown. If the value is not specified, null is returned.
name - The name of the parameter.
IllegalParameterConfigurationException - If the parameter is specified and the value is not a container ID.
public java.lang.String getOptionalContainerID(ubiware.util.saplbuilder.Resource name,
java.lang.String defaultValue)
throws IllegalParameterConfigurationException
IllegalParameterConfigurationException is
thrown. If the value is not specified, the default value is returned.
name - The name of the parameter.defaultValue - The default value which will be returned in case this parameter is not specified.
IllegalParameterConfigurationException - If the parameter is specified and the value is not a container ID.
public boolean getObligatedBooleanParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name or the value is not "true" or "false"
public java.lang.Boolean getOptionalBooleanParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If there is a value but it is none of "true" or "false". Or, if there are multiple bindings for this variable.
public boolean getOptionalBooleanParameter(ubiware.util.saplbuilder.Resource name,
boolean defaultValue)
throws IllegalParameterConfigurationException
name - The name of the parameter.defaultValue - The default value, which will be returned in case this parameter is not specified.
IllegalParameterConfigurationException - If there is a value but it is none of "true" or "false". Or, if there are multiple bindings for this variable.
public int getObligatedNumericParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name or the value triggers a NumberFormatException in
Integer.parseInt(String)
public java.lang.Integer getOptionalNumericParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
name - The name of the parameter.
IllegalParameterConfigurationException - If the value is specified but not convertible to integer by Integer.parseInt(String)
public int getOptionalNumericParameter(ubiware.util.saplbuilder.Resource name,
int defaultValue)
throws IllegalParameterConfigurationException
name - The name of the parameter.defaultValue - The value which will be returned in case the parameter is not specified.
IllegalParameterConfigurationException - If the value is specified but is not convertible to integer by Integer.parseInt(String)
public java.io.File getObligatedFileParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
File for the value of the parameter
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name. TODO should there be more checks on this object?
public java.io.File getOptionalFileParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
File for the value of the parameter or null if there is no such parameter.
name - The name of the parameter.
IllegalParameterConfigurationException - Never thrown at the moment, might be if more checks get implemented. TODO should there be more checks on this object?
public java.io.File getOptionalFileParameter(ubiware.util.saplbuilder.Resource name,
java.io.File defaultValue)
throws IllegalParameterConfigurationException
File for the value of the parameter or the default if there is no such parameter.
name - The name of the parameter.defaultValue - The default which will be returned in case this parameter is not specified.
IllegalParameterConfigurationException - Never thrown at the moment, might be if more checks get implemented. TODO should there be more checks on this object?
public java.net.URL getObligatedURLParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
URL for the value of the parameter
name - The name of the parameter.
IllegalParameterConfigurationException - If there is no argument with name name or does not have a value which is a valid URL. TODO should there be more checks on
this object?
public java.net.URL getOptionalURLParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
URL for the value of the parameter or null if there is no such parameter.
name - The name of the parameter.
IllegalParameterConfigurationException - If the argument is given, but does not have a value which is a valid URL. TODO should there be more checks on this
object?
public java.net.URL getOptionalURLParameter(ubiware.util.saplbuilder.Resource name,
java.net.URL defaultValue)
throws IllegalParameterConfigurationException
URL for the value of the parameter or the default if there is no such parameter.
name - The name of the parameter.defaultValue - The default which will be returned in case this parameter is not specified.
IllegalParameterConfigurationException - If the argument is given, but does not have a value which is a valid URL. TODO should there be more checks on this
object?
public ubiware.util.saplbuilder.Resource getObligatedResourceParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
Resource given as a value for the given parameter.
name - The parameter name.
Resource specified as a parameter value.
IllegalParameterConfigurationException - If the parameter is not specified or is not convertible to a resource.
public ubiware.util.saplbuilder.Resource getOptionalResourceParameter(ubiware.util.saplbuilder.Resource name)
throws IllegalParameterConfigurationException
Resource given as a value for the given parameter or null if the parameter is not specified.
name - The parameter name.
Resource specified as a parameter value or the null if the parameter is not specified.
IllegalParameterConfigurationException - If the parameter is specified but is not convertible to a resource.
public ubiware.util.saplbuilder.Resource getOptionalResourceParameter(ubiware.util.saplbuilder.Resource name,
ubiware.util.saplbuilder.Resource defaultValue)
throws IllegalParameterConfigurationException
Resource given as a value for the given parameter or the default if the parameter is not specified.
name - The parameter name.defaultValue - The default value which will be returned in case the parameter is not specified.
Resource specified as a parameter value or the default if the parameter is not specified.
IllegalParameterConfigurationException - If the parameter is specified but is not convertible to a resource.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||