org.rhq.enterprise.communications.command.param
Class DynamicFixedValuesParameterDefinition

java.lang.Object
  extended by org.rhq.enterprise.communications.command.param.ParameterDefinition
      extended by org.rhq.enterprise.communications.command.param.FixedValuesParameterDefinition
          extended by org.rhq.enterprise.communications.command.param.DynamicFixedValuesParameterDefinition
All Implemented Interfaces:
Serializable

public class DynamicFixedValuesParameterDefinition
extends FixedValuesParameterDefinition

Provides a fixed set of parameter values that are allowed just like its superclass, however, this subclass allows that set of fixed values to be changed dynamically after this object is instantiated.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.rhq.enterprise.communications.command.param.ParameterDefinition
HIDDEN, NOT_HIDDEN, NOT_NULLABLE, NULLABLE, OPTIONAL, REQUIRED
 
Constructor Summary
DynamicFixedValuesParameterDefinition(String name, String type, boolean required, boolean nullable, boolean hidden, List<Object> allowed, String description)
          The only difference between this constructor and its super constructor is allowed can be null or empty.
DynamicFixedValuesParameterDefinition(String name, String type, boolean required, boolean nullable, boolean hidden, List<Object> allowed, String description, ParameterRenderingInformation renderingInfo)
          The only difference between this constructor and its super constructor is allowed can be null or empty.
DynamicFixedValuesParameterDefinition(String name, String type, boolean required, boolean nullable, boolean hidden, Object[] allowed, String description)
          The only difference between this constructor and its super constructor is allowed can be null or empty.
DynamicFixedValuesParameterDefinition(String name, String type, boolean hidden, List<Object> allowed, String description)
          The only difference between this constructor and its super constructor is allowed can be null or empty.
DynamicFixedValuesParameterDefinition(String name, String type, boolean hidden, List<Object> allowed, String description, ParameterRenderingInformation renderingInfo)
          The only difference between this constructor and its super constructor is allowed can be null or empty.
 
Method Summary
protected  boolean allowZeroFixedValues()
          Returns true meaning this class allows the parameter definition's allowed values to be empty.
 void setAllowedValues(List<Object> newAllowedValues)
          This class allows the parameter definition's fixed values to be changed at runtime via this method (unlike its parent class).
 
Methods inherited from class org.rhq.enterprise.communications.command.param.FixedValuesParameterDefinition
convertObject, getAllowedValues, getDefaultRenderingInfo, isValidValue, toString
 
Methods inherited from class org.rhq.enterprise.communications.command.param.ParameterDefinition
equals, getDescription, getName, getRenderingInfo, getType, hashCode, isHidden, isNullable, isRequired, setDefaultRenderingAttributes, setRenderingInfo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicFixedValuesParameterDefinition

public DynamicFixedValuesParameterDefinition(String name,
                                             String type,
                                             boolean required,
                                             boolean nullable,
                                             boolean hidden,
                                             Object[] allowed,
                                             String description)
                                      throws IllegalArgumentException
The only difference between this constructor and its super constructor is allowed can be null or empty.

Throws:
IllegalArgumentException
See Also:
FixedValuesParameterDefinition.FixedValuesParameterDefinition(String, String, boolean, boolean, boolean, Object[], String)

DynamicFixedValuesParameterDefinition

public DynamicFixedValuesParameterDefinition(String name,
                                             String type,
                                             boolean hidden,
                                             List<Object> allowed,
                                             String description)
                                      throws IllegalArgumentException
The only difference between this constructor and its super constructor is allowed can be null or empty.

Throws:
IllegalArgumentException
See Also:
FixedValuesParameterDefinition.FixedValuesParameterDefinition(String, String, boolean, List, String)

DynamicFixedValuesParameterDefinition

public DynamicFixedValuesParameterDefinition(String name,
                                             String type,
                                             boolean hidden,
                                             List<Object> allowed,
                                             String description,
                                             ParameterRenderingInformation renderingInfo)
                                      throws IllegalArgumentException
The only difference between this constructor and its super constructor is allowed can be null or empty.

Throws:
IllegalArgumentException
See Also:
FixedValuesParameterDefinition.FixedValuesParameterDefinition(String, String, boolean, List, String, ParameterRenderingInformation)

DynamicFixedValuesParameterDefinition

public DynamicFixedValuesParameterDefinition(String name,
                                             String type,
                                             boolean required,
                                             boolean nullable,
                                             boolean hidden,
                                             List<Object> allowed,
                                             String description)
                                      throws IllegalArgumentException
The only difference between this constructor and its super constructor is allowed can be null or empty.

Throws:
IllegalArgumentException
See Also:
FixedValuesParameterDefinition.FixedValuesParameterDefinition(String, String, boolean, boolean, boolean, List, String)

DynamicFixedValuesParameterDefinition

public DynamicFixedValuesParameterDefinition(String name,
                                             String type,
                                             boolean required,
                                             boolean nullable,
                                             boolean hidden,
                                             List<Object> allowed,
                                             String description,
                                             ParameterRenderingInformation renderingInfo)
                                      throws IllegalArgumentException
The only difference between this constructor and its super constructor is allowed can be null or empty.

Throws:
IllegalArgumentException
See Also:
FixedValuesParameterDefinition.FixedValuesParameterDefinition(String, String, boolean, boolean, boolean, List, String, ParameterRenderingInformation)
Method Detail

allowZeroFixedValues

protected boolean allowZeroFixedValues()
Returns true meaning this class allows the parameter definition's allowed values to be empty. This is because this class allows that list of allowed values to be modified dynamically at runtime. You could therefore instantiate this parameter definition with zero allowed values and later on add to that list (in the case when the allowed values aren't known until after this object has been instantiated).

Overrides:
allowZeroFixedValues in class FixedValuesParameterDefinition
Returns:
this method implementation always returns false
See Also:
FixedValuesParameterDefinition.allowZeroFixedValues()

setAllowedValues

public void setAllowedValues(List<Object> newAllowedValues)
                      throws IllegalArgumentException
This class allows the parameter definition's fixed values to be changed at runtime via this method (unlike its parent class).

Overrides:
setAllowedValues in class FixedValuesParameterDefinition
Parameters:
newAllowedValues - the new list of allowed values
Throws:
IllegalArgumentException - if failed to convert the values to the parameter definition's type or allowedValues was null or empty and this parameter definition object does not accept that (see FixedValuesParameterDefinition.allowZeroFixedValues()).
See Also:
FixedValuesParameterDefinition.setAllowedValues(List)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.