Class Param
- java.lang.Object
-
- Ice.ObjectImpl
-
- omero.grid.Param
-
- All Implemented Interfaces:
Ice.Object
,java.io.Serializable
,java.lang.Cloneable
public class Param extends Ice.ObjectImpl
A single parameter to a Job. For example, used by ScriptJobs to define what the input and output environment variables should be. Helper classes are available in the Python omero.scripts module, so that the following are equivalent:# 1 a = omero.grid.Params() a.optional = True a.prototype = omero.rtypes.rstring("") a.description = "An optional string which will be ignored by the script" omero.scripts.client(inputs = {"a":a})
# 2 a = omero.scripts.String("a", optional=True, description= * "An optional string which will be ignored by the script") omero.scripts.client(a)
For advanced setters not available on the Type classes (like omero.script.String) use the getter type.param() and then set values directly.a = omero.scripts.String("a") a.param().values = \["hi", "bye"]
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
__ids
java.lang.String
description
Usage documentation of this param for script users.java.lang.String
grouping
Defines the grouping strategy for thisParam
.RType
max
Maximum value which an input may contain.RType
min
Minimum value which an input may contain.java.util.List<java.lang.String>
namespaces
Defines machine readable interpretations for this parameter.boolean
optional
Whether or not a script will require this value to be present in the input or output.RType
prototype
RType
which represents what the input or output value should look like.static long
serialVersionUID
boolean
useDefault
Whether or not the prototype should be used as a default.RList
values
An enumeration of acceptable values which can be used for this parameter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
__readImpl(IceInternal.BasicStream __is)
protected void
__writeImpl(IceInternal.BasicStream __os)
Param
clone()
static Ice.ObjectFactory
ice_factory()
java.lang.String
ice_id()
java.lang.String
ice_id(Ice.Current __current)
java.lang.String[]
ice_ids()
java.lang.String[]
ice_ids(Ice.Current __current)
boolean
ice_isA(java.lang.String s)
boolean
ice_isA(java.lang.String s, Ice.Current __current)
static java.lang.String
ice_staticId()
-
-
-
Field Detail
-
__ids
public static final java.lang.String[] __ids
-
description
public java.lang.String description
Usage documentation of this param for script users. Example of a bad description: ""a long value"" Example of a good description: ""long representing the number of bins to be used by. A sensible value would be between 16 and 32""
-
optional
public boolean optional
Whether or not a script will require this value to be present in the input or output. If an input is missing or None when non-optional, then aValidationException
will be thrown onprocessJob
. A missing output param will be marked after execution.
-
useDefault
public boolean useDefault
Whether or not the prototype should be used as a default. If true, then if the value is missing from the input OR output values, the prototype will be substituted.param = ...; inputs = ...; if name in inputs: value = inputs\[name] elif param.inputs\[name].useDefault: value = param.inputs\[name].prototype
-
prototype
public RType prototype
RType
which represents what the input or output value should look like. If this is a collection type (i.e.RCollection
orRMap
or their subclasses), then the first contents of the collection will be used (recursively).param.prototype = rlist(rlist(rstring)))
requires that a list of list of strings be passed.
-
min
public RType min
Minimum value which an input may contain. If the prototype is a collection type, then the min type must match the type of the innermost non-collection instance. For example,param.prototype = rlong(0) param.min = rlong(-5)
butparam.prototype = rlist(rlong(0)) param.min = rlong(-5)
-
max
public RType max
Maximum value which an input may contain. If the prototype is a collection type, then the max type must match the type of the innermost non-collection instance. For example,param.prototype = rlong(0) param.max = rlong(5)
butparam.prototype = rlist(rlong(0)) param.max = rlong(5)
-
values
public RList values
An enumeration of acceptable values which can be used for this parameter. Ifmin
andmax
are set, this value will be ignored. Ifprototype
is anRCollection
orRMap
instance, then the values in thisRList
will be of the member types of the collection or map, and not a collection or map instance.
-
grouping
public java.lang.String grouping
Defines the grouping strategy for thisParam
.A set of
Param
objects in a singleJobParams
can use dot notation to specify that they belong together, and in which order they should be presented to the user.inputs = {"a" : Param(..., grouping = "1.1"), "b" : Param(..., grouping = "1.2"), "c" : Param(..., grouping = "2.2"), "d" : Param(..., grouping = "2.1")}
defines two groups of parameters which might be display to the user so:Group 1: Group 2: +-----------------------+ +-----------------------+ | a: | | d: | +-----------------------+ +-----------------------+ | b: | | c: | +-----------------------+ +-----------------------+
Further dots (e.g. "1.2.3.5") can be used to specify deeper trees of parameters.
By most clients, Params missing grouping values (e.g. "") will be ordered after params with grouping values.
A group which has a boolean as the top-level object can be thought of as a checkbox which turns on or off all of the other group members. For example,
inputs = {"Image_Ids" : Param(prototype=rlist(), grouping = "1"), "Scale_Bar" : Param(prototype=rbool(), grouping = "2"), "Color" : Param(prototype=rinternal(Color()), grouping = "2.1"), "Size" : Param(prototype=rlong(), grouping = "2.2")}
might be displayed as:
Scale Bar: \[ on/off ] ====================== Color: \[rgb] Size: \[ 10]
-
namespaces
public java.util.List<java.lang.String> namespaces
Defines machine readable interpretations for this parameter.Where the description field should provide information for users, the assigned namespaces can define how clients may interpret the param.
omero.constants.namespaces.NSDOWNLOAD
, for example, indicates that users may want to download the resulting file. Theprototype
of theParam
should be one of:OriginalFile
,FileAnnotation
, or an annotation link (likeImageAnnotationLink
) which points to a file annotation.
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
ice_factory
public static Ice.ObjectFactory ice_factory()
-
ice_isA
public boolean ice_isA(java.lang.String s)
- Specified by:
ice_isA
in interfaceIce.Object
- Overrides:
ice_isA
in classIce.ObjectImpl
-
ice_isA
public boolean ice_isA(java.lang.String s, Ice.Current __current)
- Specified by:
ice_isA
in interfaceIce.Object
- Overrides:
ice_isA
in classIce.ObjectImpl
-
ice_ids
public java.lang.String[] ice_ids()
- Specified by:
ice_ids
in interfaceIce.Object
- Overrides:
ice_ids
in classIce.ObjectImpl
-
ice_ids
public java.lang.String[] ice_ids(Ice.Current __current)
- Specified by:
ice_ids
in interfaceIce.Object
- Overrides:
ice_ids
in classIce.ObjectImpl
-
ice_id
public java.lang.String ice_id()
- Specified by:
ice_id
in interfaceIce.Object
- Overrides:
ice_id
in classIce.ObjectImpl
-
ice_id
public java.lang.String ice_id(Ice.Current __current)
- Specified by:
ice_id
in interfaceIce.Object
- Overrides:
ice_id
in classIce.ObjectImpl
-
ice_staticId
public static java.lang.String ice_staticId()
-
__writeImpl
protected void __writeImpl(IceInternal.BasicStream __os)
- Overrides:
__writeImpl
in classIce.ObjectImpl
-
__readImpl
protected void __readImpl(IceInternal.BasicStream __is)
- Overrides:
__readImpl
in classIce.ObjectImpl
-
clone
public Param clone()
- Specified by:
clone
in interfaceIce.Object
- Overrides:
clone
in classIce.ObjectImpl
-
-