org.jwarp.service.param
Class ParameterDescription

java.lang.Object
  |
  +--org.jwarp.service.param.ParameterDescription
All Implemented Interfaces:
IConfigurable, IParameterDescription

public class ParameterDescription
extends java.lang.Object
implements IParameterDescription

Class implementing a parameters meta data information such as name, validation, requirement and amptiness of its value.

Version:
1.01
Author:
A. Tresch
See Also:
IParameterDescription

Field Summary
(package private)  java.lang.String description
          The parameters desxcription
(package private)  java.lang.String name
          The parameters name
(package private)  BasicValidator validator
          The validator for this parameter type
 
Constructor Summary
ParameterDescription()
           
ParameterDescription(java.lang.String name)
          Constructor: The description will be set to "N/A".
ParameterDescription(java.lang.String name, java.lang.String type)
          Constructor: The description will be set to "N/A".
ParameterDescription(java.lang.String name, java.lang.String type, boolean required, boolean maybeEmpty)
          Constructor: The description will be set to "N/A".
ParameterDescription(java.lang.String name, java.lang.String description, java.lang.String type, boolean required, boolean mayBeEmpty)
          Constructor: The description will be set to "N/A" if no description is provided.
 
Method Summary
 void configure(org.jdom.Element config)
          Pass the Configuration to the Configurable class.
 java.lang.String getDescription()
          Returns the parameter's description.
 boolean getMaybeEmpty()
          This method returns if the parameter may be empty.
 java.lang.String getName()
          Returns the parameters name
 boolean getRequired()
          This method returns if the parameter is required.
 java.lang.String getType()
          Returns the parameter's type.
 IValidator getValidator()
          Get a validator that validates this kind of parameter.
 void setContentValidator(IValidator nvalidator)
           
 void setMaybeEmpty(boolean empty)
          Resets the maybeEmpty setting.
 void setRequired(boolean required)
          Resets the required setting.
 void setType(java.lang.String type)
          Resets the required setting.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

java.lang.String name
The parameters name

description

java.lang.String description
The parameters desxcription

validator

transient BasicValidator validator
The validator for this parameter type
Constructor Detail

ParameterDescription

public ParameterDescription()

ParameterDescription

public ParameterDescription(java.lang.String name,
                            java.lang.String type,
                            boolean required,
                            boolean maybeEmpty)
Constructor: The description will be set to "N/A".
Parameters:
name - The parameters name
type - The parameters class type
required - Required parameter?
maybeEmpty - Can the value be empty

ParameterDescription

public ParameterDescription(java.lang.String name,
                            java.lang.String type)
Constructor: The description will be set to "N/A". The parameter is not required (optional!) and its value may be empty.
Parameters:
name - The parameters name
type - The parameters class type
required - Required parameter?
maybeEmpty - Can the value be empty

ParameterDescription

public ParameterDescription(java.lang.String name)
Constructor: The description will be set to "N/A". The parameter is not required (optional!) and its value may be empty. The type is a string type (no further validation!).
Parameters:
name - The parameters name
type - The parameters class type
required - Required parameter?
maybeEmpty - Can the value be empty

ParameterDescription

public ParameterDescription(java.lang.String name,
                            java.lang.String description,
                            java.lang.String type,
                            boolean required,
                            boolean mayBeEmpty)
Constructor: The description will be set to "N/A" if no description is provided.
Parameters:
name - The parameters name
type - The parameters class type
required - Required parameter?
maybeEmpty - Can the value be empty
Method Detail

configure

public void configure(org.jdom.Element config)
               throws ConfigurationException
Description copied from interface: IConfigurable
Pass the Configuration to the Configurable class. This method must always be called after the constructor and before any other method.
Specified by:
configure in interface IConfigurable
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

setContentValidator

public void setContentValidator(IValidator nvalidator)

getName

public java.lang.String getName()
Returns the parameters name
Specified by:
getName in interface IParameterDescription
Returns:
The name

getDescription

public java.lang.String getDescription()
Returns the parameter's description.
Specified by:
getDescription in interface IParameterDescription
Returns:
The description

getType

public java.lang.String getType()
Returns the parameter's type.
Returns:
The type

setType

public void setType(java.lang.String type)
Resets the required setting.
Parameters:
required - true if required should be set.

getRequired

public boolean getRequired()
This method returns if the parameter is required.
Specified by:
getRequired in interface IParameterDescription
Following copied from interface: org.jwarp.service.param.IParameterDescription
Returns:
true if the parameter is required.

getMaybeEmpty

public boolean getMaybeEmpty()
This method returns if the parameter may be empty.
Specified by:
getMaybeEmpty in interface IParameterDescription
Following copied from interface: org.jwarp.service.param.IParameterDescription
Returns:
true if the value of the parameter can be empty.

setRequired

public void setRequired(boolean required)
Resets the required setting.
Parameters:
required - true if required should be set.

setMaybeEmpty

public void setMaybeEmpty(boolean empty)
Resets the maybeEmpty setting.
Parameters:
empty - true if maybeEmpty should be set.

getValidator

public IValidator getValidator()
Get a validator that validates this kind of parameter.
Specified by:
getValidator in interface IParameterDescription
Returns:
A corresponding validator instance

©   O R C A   S y s t e m s