SAP CC 1.0
API 4.2 (Core)

com.highdeal.pnr.hci
Class DefaultHCIException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.highdeal.hci.OperationFailureException
              extended by com.highdeal.pnr.hci.DefaultHCIException
All Implemented Interfaces:
OperationResult, XMLMarshallable, java.io.Serializable
Direct Known Subclasses:
InvalidSubscriberAccountException

public abstract class DefaultHCIException
extends OperationFailureException

This class must be extended by all the operation failure exception. It provides the way to have meanful reason about the exception like a pretty name, a description and a list of argument.

See Also:
Serialized Form

Nested Class Summary
static class DefaultHCIException.ExceptionReason
          This class is the reason of the exception.
 
Constructor Summary
DefaultHCIException()
          Initialize an empty DefaultHCIException.
DefaultHCIException(DefaultHCIException.ExceptionReason reason, java.lang.String... args)
          Initialize a DefaultHCIException with a reason and an argument list.
 
Method Summary
protected  void _marshalAttributes(XMLOutputter output)
          Should be overwritten if the extending exception has specific attributes to be marshalled.
protected  void _marshalChildren(XMLOutputter output)
          Should be overwritten if the extending exception has specific children to be marshalled.
protected  void _setAttributes(XMLAttributes atts)
          Should be overwritten if the extending exception expect specific attributes.
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
protected static java.util.Map<java.lang.String,DefaultHCIException.ExceptionReason> generateReasons(java.lang.Class<?> clazz, java.lang.Class<?> reasonClazz)
          Builds the reason map of all the reasons defined in the the specified clazz and of type reasonClazz.
 java.util.List<java.lang.String> getArgs()
          Returns the arguments of this exception.
 java.lang.String getMessage()
          Returns the message of this exception.
 DefaultHCIException.ExceptionReason getReason()
          Returns the reason of this exception.
protected abstract  java.util.Map<java.lang.String,DefaultHCIException.ExceptionReason> getReasons()
          Returns all the available reasons of the exception.
protected abstract  java.lang.String getTagName()
          Returns the tag of the extending exception.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 
Methods inherited from class com.highdeal.hci.OperationFailureException
getOperandReference
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultHCIException

public DefaultHCIException()
Initialize an empty DefaultHCIException. It is initialized without arguments. Should only be used to be initialized using XML.


DefaultHCIException

public DefaultHCIException(DefaultHCIException.ExceptionReason reason,
                           java.lang.String... args)
Initialize a DefaultHCIException with a reason and an argument list.

Parameters:
reason - the reason of the exception. Is mandatory and cannot be null.
args - the arguments of the reason. Is optional and can be null. If specified, the argument count must be equals to the argument name count defined by the reason.
Method Detail

getArgs

public java.util.List<java.lang.String> getArgs()
Returns the arguments of this exception.

Returns:
the value of the arguments of this exception if exists, null otherwise.

getReason

public DefaultHCIException.ExceptionReason getReason()
Returns the reason of this exception.

Returns:
the reason of the exception if exists, null otherwise.

getMessage

public java.lang.String getMessage()
Returns the message of this exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the message of the exception is exists, null otherwise.

setAttributes

public final void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Parameters:
atts - the XML attributes of the current tag.

addCharacterData

public final void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Parameters:
cData - the character data to be added.

addChild

public final void addChild(java.lang.String tagName,
                           XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Parameters:
tagName - the name of tag for the child.
child - the child to be added.

marshal

public final void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, and of its children.

Parameters:
output - the XML output to marshall the object into.

getReasons

protected abstract java.util.Map<java.lang.String,DefaultHCIException.ExceptionReason> getReasons()
Returns all the available reasons of the exception.

Returns:
the mapping between the pretty name reason and the reason.

getTagName

protected abstract java.lang.String getTagName()
Returns the tag of the extending exception.

Returns:
the xml tag use to marshall the exception.

_setAttributes

protected void _setAttributes(XMLAttributes atts)
Should be overwritten if the extending exception expect specific attributes.

Parameters:
atts - the attribute list of the xml format of the extending exception.

_marshalAttributes

protected void _marshalAttributes(XMLOutputter output)
Should be overwritten if the extending exception has specific attributes to be marshalled.

Parameters:
output - the marshaller.

_marshalChildren

protected void _marshalChildren(XMLOutputter output)
Should be overwritten if the extending exception has specific children to be marshalled.

Parameters:
output - the marshaller

generateReasons

protected static final java.util.Map<java.lang.String,DefaultHCIException.ExceptionReason> generateReasons(java.lang.Class<?> clazz,
                                                                                                           java.lang.Class<?> reasonClazz)
Builds the reason map of all the reasons defined in the the specified clazz and of type reasonClazz.

Parameters:
clazz - the class from which the reasons must be extracted.
reasonClazz - the type of the reason to be extracted.
Returns:
the mapping between the pretty name of the reason and the reason.

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.