com.togethersoft.sca.core
Interface IParameterRegistry


public interface IParameterRegistry

The parameter registry holds the list of parameters of a plug-in or a code analyzer.

The parameter registry can be enumerated or queried by name.

This interface is not intended to be implemented by clients.


Method Summary
 boolean addParameter(IParameter parameter)
          Adds a new parameter to the registry.
 java.lang.Object clone()
          Creates a deep copy of this parameter registry.
 boolean getBooleanValue(java.lang.String id, boolean defaultValue)
          Returns the value of the boolean parameter with the specified identifier.
 long getIntegerValue(java.lang.String id, long defaultValue)
          Returns the value of the integer parameter with the specified identifier.
 IParameter getParameter(java.lang.String id, int type)
          Returns the parameter with the specified identifier and of the specified type contained in this parameter registry, or null if there is no such parameter.
 IParameter[] getParameters()
          Returns all the parameters known to this parameter registry.
 boolean removeParameter(java.lang.String id, boolean force)
          Removes the parameter with the given identifier from the registry.
 

Method Detail

addParameter

public boolean addParameter(IParameter parameter)
Adds a new parameter to the registry.
Parameters:
parameter - the new parameter.
Returns:
true if parameter was successfully added, false if parameter with such id already exists.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a deep copy of this parameter registry.

getBooleanValue

public boolean getBooleanValue(java.lang.String id,
                               boolean defaultValue)
Returns the value of the boolean parameter with the specified identifier. Returns defaultValue if parameter with the specified id does not exist or is not boolean.
Parameters:
id - the unique identifier of the parameter.
defaultValue - the default return value.
Returns:
the parameter value.

getIntegerValue

public long getIntegerValue(java.lang.String id,
                            long defaultValue)
Returns the value of the integer parameter with the specified identifier. Returns defaultValue if parameter with the specified id does not exist or is not integer.
Parameters:
id - the unique identifier of the parameter.
defaultValue - the default return value.
Returns:
the parameter value.

getParameter

public IParameter getParameter(java.lang.String id,
                               int type)
Returns the parameter with the specified identifier and of the specified type contained in this parameter registry, or null if there is no such parameter.
Parameters:
id - the unique identifier of the parameter.
type - the type of the parameter, for example IParameter.STRING. -1 matches parameter of any type.
Returns:
the found parameter, or null.

getParameters

public IParameter[] getParameters()
Returns all the parameters known to this parameter registry. Returns an empty array if there are no installed parameters.
Returns:
the parameters known to this parameter registry.

removeParameter

public boolean removeParameter(java.lang.String id,
                               boolean force)
Removes the parameter with the given identifier from the registry.
Parameters:
id - the identifier of the parameter to remove.
force - allows to remove any parameter. If set to false, only parameters that were added with #addParameter() can be removed.
Returns:
true if parameter was successfully removed, false otherwise.