/** * @param parameter * @param specifiedValues * multiple values which are all elements of the valueDomain of the parameter. Use this constructor * if you want to associate a parameter with given values (e.g.: FORMAT=jpeg or COVERAGE=c1,c2,c3). * @throws OXFException * if one value of the specifiedValues are not contained in the valueDomain of the parameter. */ public ParameterShell(final Parameter parameter, final Object... specifiedValues) throws OXFException { if (parameter == null) { throw new IllegalArgumentException("Parameter is null."); } else if (specifiedValues == null || specifiedValues.length == 0) { throw new IllegalArgumentException("No specifiedValues for parameter '" + parameter + "' were given."); } this.parameter = parameter; if (specifiedValues.length > 1) { setSpecifiedValueArray(specifiedValues); } else { setSpecifiedValue(specifiedValues[0]); } }
/** * searches the ParameterShell whose Parameter has the commonName and sets the newValues to this * Parameter. * * @param commonName * @param newValues * @throws OXFException * if there is no ParameterShell whose parameter has the specified commonName.<br> * or if the one of the newValues is not contained in the valueDomain of the parameter. */ public void setParameterValueArray(final String commonName, final Object[] newValues) throws OXFException { final ParameterShell ps = getParameterShellWithCommonName(commonName); if (ps != null) { ps.setSpecifiedValueArray(newValues); } else { throw new OXFException("There is no ParameterShell whose parameter has the commonName '" + commonName + "'."); } }