com.arsdigita.util.parameter
Class MapParameter

java.lang.Object
  extended bycom.arsdigita.util.parameter.AbstractParameter
      extended bycom.arsdigita.util.parameter.MapParameter
All Implemented Interfaces:
Parameter

public class MapParameter
extends AbstractParameter

Subject to change. A parameter that manages a collection of Parameter to Object value mappings.

Version:
$Id: //core-platform/dev/src/com/arsdigita/util/parameter/MapParameter.java#5 $
Author:
Justin Ross <jross@redhat.com>
See Also:
Map, Parameter

Field Summary
static String versionId
           
 
Fields inherited from interface com.arsdigita.util.parameter.Parameter
OPTIONAL, REQUIRED
 
Constructor Summary
MapParameter(String name)
           
MapParameter(String name, int multiplicity, Object defaalt)
           
 
Method Summary
 void add(Parameter param)
           
 boolean contains(Parameter param)
           
protected  Object doRead(ParameterReader reader, ErrorList errors)
          Reads the value of the parameter from reader, unmarshals it, and returns it.
protected  void doValidate(Object value, ErrorList errors)
          Validates value, placing any validation errors in errors.
protected  void doWrite(ParameterWriter writer, Object value)
          Marshals and writes value to writer.
 Iterator iterator()
           
 
Methods inherited from class com.arsdigita.util.parameter.AbstractParameter
getDefaultValue, getInfo, getName, isRequired, marshal, read, setInfo, toString, unmarshal, validate, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

MapParameter

public MapParameter(String name,
                    int multiplicity,
                    Object defaalt)

MapParameter

public MapParameter(String name)
Method Detail

add

public final void add(Parameter param)

contains

public final boolean contains(Parameter param)

iterator

public final Iterator iterator()

doRead

protected Object doRead(ParameterReader reader,
                        ErrorList errors)
Description copied from class: AbstractParameter
Reads the value of the parameter from reader, unmarshals it, and returns it. If any errors are encountered, they are added to errors. If the literal string value from reader is not null, this method delegates to AbstractParameter.unmarshal(String,ErrorList). This implementation is suited to a parameter with a singular scalar value. Subclasses that are compound parameters should override this method to delegate to child parameters.

Overrides:
doRead in class AbstractParameter
Parameters:
reader - The ParameterReader that will supply the literal stored value for this parameter; it cannot be null
errors - The ErrorList that will trap any errors encountered; it cannot be null

doValidate

protected void doValidate(Object value,
                          ErrorList errors)
Description copied from class: AbstractParameter
Validates value, placing any validation errors in errors. This particular implementation does nothing. Subclasses are expected to add specific validation behaviors.

Overrides:
doValidate in class AbstractParameter
Parameters:
value - The value to validate; it cannot be null
errors - The ErrorList that traps validation errors; it cannot be null

doWrite

protected void doWrite(ParameterWriter writer,
                       Object value)
Description copied from class: AbstractParameter
Marshals and writes value to writer. This implementation is suited to a parameter with a singular scalar value. Subclasses that are compound parameters should override this method to delegate to child parameters.

Overrides:
doWrite in class AbstractParameter
Parameters:
writer - The ParameterWriter we write to; it cannot be null
value - The value to write; it may be null


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC