org.xins.common.spec
Class ErrorCodeSpec

java.lang.Object
  extended byorg.xins.common.spec.ErrorCodeSpec

public final class ErrorCodeSpec
extends Object

Specification of a error code (also known as result code).

Since:
XINS 1.3.0
Version:
$Revision: 1.19 $ $Date: 2006/08/28 09:12:34 $
Author:
Anthony Goubard

Nested Class Summary
static class ErrorCodeSpec.Type
          Type of an error code.
 
Field Summary
static ErrorCodeSpec.Type FUNCTIONAL
          Type indicating that the error code is functional.
static ErrorCodeSpec.Type TECHNICAL
          Type indicating that the error code is technical.
 
Constructor Summary
ErrorCodeSpec(String name, Class reference, String baseURL)
          Creates a new instance of ErrorCodeSpec.
 
Method Summary
 String getDescription()
          Gets the description of the error code.
 String getName()
          Gets the name of the error code.
 DataSectionElementSpec getOutputDataSectionElement(String elementName)
          Gets the specification of the element of the output data section with the specified name.
 Map getOutputDataSectionElements()
          Gets the specification of the elements of the output data section.
 ParameterSpec getOutputParameter(String parameterName)
          Gets the output parameter for the specified name.
 Map getOutputParameters()
          Gets the output parameter specifications defined in the error code.
 ErrorCodeSpec.Type getType()
          Gets the type of the error code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUNCTIONAL

public static final ErrorCodeSpec.Type FUNCTIONAL
Type indicating that the error code is functional.

Since:
XINS 1.4.0

TECHNICAL

public static final ErrorCodeSpec.Type TECHNICAL
Type indicating that the error code is technical.

Since:
XINS 1.4.0
Constructor Detail

ErrorCodeSpec

public ErrorCodeSpec(String name,
                     Class reference,
                     String baseURL)
              throws IllegalArgumentException,
                     InvalidSpecificationException
Creates a new instance of ErrorCodeSpec.

Parameters:
name - the name of the error code, cannot be null.
reference - the reference class used to get the type of the parameters, cannot be null.
baseURL - the base URL used to located the specifications, cannot be null.
Throws:
IllegalArgumentException - if name == null || reference == null || baseURL == null.
InvalidSpecificationException - if the result code file cannot be found or is incorrect.
Method Detail

getName

public String getName()
Gets the name of the error code.

Returns:
The name of the error code, never null.

getDescription

public String getDescription()
Gets the description of the error code.

Returns:
The description of the error code, never null.

getOutputParameter

public ParameterSpec getOutputParameter(String parameterName)
                                 throws EntityNotFoundException,
                                        IllegalArgumentException
Gets the output parameter for the specified name.

Parameters:
parameterName - the name of the parameter, cannot be null.
Returns:
the parameter, never null.
Throws:
EntityNotFoundException - if the error code does not contain any output parameter with the specified name.
IllegalArgumentException - if parameterName == null.

getOutputParameters

public Map getOutputParameters()
Gets the output parameter specifications defined in the error code. The key is the name of the parameter, the value is the ParameterSpec object.

Returns:
The output parameters specifications, never null.

getOutputDataSectionElement

public DataSectionElementSpec getOutputDataSectionElement(String elementName)
                                                   throws EntityNotFoundException,
                                                          IllegalArgumentException
Gets the specification of the element of the output data section with the specified name.

Parameters:
elementName - the name of the element, cannot be null.
Returns:
The specification of the output data section element, never null.
Throws:
EntityNotFoundException - if the error code does not define any output data element with the specified name.
IllegalArgumentException - if elementName == null.

getOutputDataSectionElements

public Map getOutputDataSectionElements()
Gets the specification of the elements of the output data section. The key is the name of the element, the value is the DataSectionElementSpec object.

Returns:
the specification of the output data section, never null.

getType

public ErrorCodeSpec.Type getType()
Gets the type of the error code.

Returns:
the type of the error code.
Since:
XINS 1.4.0


See http://www.xins.org/.