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.ObjectImplA 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[]__idsjava.lang.StringdescriptionUsage documentation of this param for script users.java.lang.StringgroupingDefines the grouping strategy for thisParam.RTypemaxMaximum value which an input may contain.RTypeminMinimum value which an input may contain.java.util.List<java.lang.String>namespacesDefines machine readable interpretations for this parameter.booleanoptionalWhether or not a script will require this value to be present in the input or output.RTypeprototypeRTypewhich represents what the input or output value should look like.static longserialVersionUIDbooleanuseDefaultWhether or not the prototype should be used as a default.RListvaluesAn 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)Paramclone()static Ice.ObjectFactoryice_factory()java.lang.Stringice_id()java.lang.Stringice_id(Ice.Current __current)java.lang.String[]ice_ids()java.lang.String[]ice_ids(Ice.Current __current)booleanice_isA(java.lang.String s)booleanice_isA(java.lang.String s, Ice.Current __current)static java.lang.Stringice_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 aValidationExceptionwill 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
RTypewhich represents what the input or output value should look like. If this is a collection type (i.e.RCollectionorRMapor 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. Ifminandmaxare set, this value will be ignored. Ifprototypeis anRCollectionorRMapinstance, then the values in thisRListwill 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
Paramobjects in a singleJobParamscan 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. Theprototypeof theParamshould 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_isAin interfaceIce.Object- Overrides:
ice_isAin classIce.ObjectImpl
-
ice_isA
public boolean ice_isA(java.lang.String s, Ice.Current __current)- Specified by:
ice_isAin interfaceIce.Object- Overrides:
ice_isAin classIce.ObjectImpl
-
ice_ids
public java.lang.String[] ice_ids()
- Specified by:
ice_idsin interfaceIce.Object- Overrides:
ice_idsin classIce.ObjectImpl
-
ice_ids
public java.lang.String[] ice_ids(Ice.Current __current)
- Specified by:
ice_idsin interfaceIce.Object- Overrides:
ice_idsin classIce.ObjectImpl
-
ice_id
public java.lang.String ice_id()
- Specified by:
ice_idin interfaceIce.Object- Overrides:
ice_idin classIce.ObjectImpl
-
ice_id
public java.lang.String ice_id(Ice.Current __current)
- Specified by:
ice_idin interfaceIce.Object- Overrides:
ice_idin classIce.ObjectImpl
-
ice_staticId
public static java.lang.String ice_staticId()
-
__writeImpl
protected void __writeImpl(IceInternal.BasicStream __os)
- Overrides:
__writeImplin classIce.ObjectImpl
-
__readImpl
protected void __readImpl(IceInternal.BasicStream __is)
- Overrides:
__readImplin classIce.ObjectImpl
-
clone
public Param clone()
- Specified by:
clonein interfaceIce.Object- Overrides:
clonein classIce.ObjectImpl
-
-