Version: ${maven.project.version}

org.soaplab.services.cmdline
Class NamedValues

java.lang.Object
  extended by org.soaplab.services.cmdline.NamedValues

public class NamedValues
extends java.lang.Object

A container for parameter name, parameter tag and its value, or values.

The contents of this container is somewhere in between user inputs and ready-to-use arguments for the command-line. It is used for job classes that do not create the full command-line (such as Gowlab jobs) but they still need an easy access to the user inputs (such as replacing missing inputs with their default values, checking if repetitivness (multiple values for the same parameter) is allowed, etc.).

One container represents one parameter. The parameter internal ID should be always present (but see about an exception below). The tag may be empty - this is the case when no tag (qualifier) is defined in the parameter metadata, and also if the parameter METHOD template is defined/used. The tag here does not have any prefix (such as minus sign).

The values come from the user input data. There may be multiple values in these cases: (a) a parameter can be repetitive, or (b) it is a multi-choice list parameter.

The boolean parameter is present only if it has a true value (from the user or by default). Its value is actually its tag - that's why for these parameters the same value is both in the tag and in the values.

Be aware that for repetitive parameters, this container is different from the way how it is expressed on a command-line. Here, the tag is present only once. On the command-line, it is repeated for each individual value (unless a parameter METHOD template defines it otherwise). For example, the following parameter ( as define din an ACD file):

string: str  [
 information: "str: A ordinary string with a tag 'strtag'"
 additional: "Y"
 qualifier: strtag
 default: "Ciao mundi"
]
and if a user sends two values ('a' and 'b'), will look on the command line:
-strtag a -strtag b
but this container will contain:
Param ID                 Param Tag       Value(s)
-------------------------------------------------
str                      strtag          [a, b]
If service metadata specify a global METHOD template then this container have empty parameter ID (because the role of individual parameters is hidden/lost inside the global template). Also the parameter tag is empty. Only values have contents.

Currently, the IO parameters do not use this structure.

Version:
$Id: NamedValues.java,v 1.2 2007/04/19 22:17:05 marsenger Exp $
Author:
Martin Senger

Constructor Summary
NamedValues()
          Constructor - a container without parameter ID (used when a service metadata have a global METHOD template).
NamedValues(java.lang.String paramId)
          Constructor - a parameter ID is needed (in most cases).
 
Method Summary
 void addValue(java.lang.String value)
          Add a single value to the data representing user inputs.
 java.lang.String getId()
          Return an ID of a parameter whose data this container keeps.
 java.lang.String getTag()
          Return a tag (qualifier) for this parameter (without any prefixes, such as minus sign or slash - even if such character is define din the parameter metadata).
 java.util.List<java.lang.String> getValues()
          Return a list of data values representing user inputs.
 void setTag(java.lang.String paramTag)
          Set a tag (qualifier).
 void setValues(java.util.List<java.lang.String> values)
          Set all values representing user inputs.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedValues

public NamedValues(java.lang.String paramId)
Constructor - a parameter ID is needed (in most cases).


NamedValues

public NamedValues()
Constructor - a container without parameter ID (used when a service metadata have a global METHOD template).

Method Detail

getId

public java.lang.String getId()
Return an ID of a parameter whose data this container keeps.


setTag

public void setTag(java.lang.String paramTag)
Set a tag (qualifier).


getTag

public java.lang.String getTag()
Return a tag (qualifier) for this parameter (without any prefixes, such as minus sign or slash - even if such character is define din the parameter metadata).


getValues

public java.util.List<java.lang.String> getValues()
Return a list of data values representing user inputs. It can return an empty list but never be a null.


addValue

public void addValue(java.lang.String value)
Add a single value to the data representing user inputs.


setValues

public void setValues(java.util.List<java.lang.String> values)
Set all values representing user inputs.


Version: ${maven.project.version}

Submit a bug or feature
Generated: Tue Jun 14 15:18:14 AST 2011