org.deegree.services.controller.exception.serializer
Class XMLExceptionSerializer<T extends OWSException>

java.lang.Object
  extended by org.deegree.commons.xml.XMLAdapter
      extended by org.deegree.services.controller.exception.serializer.XMLExceptionSerializer<T>
Type Parameters:
T - the exception which will be serialized, a subtype of ControllerException
All Implemented Interfaces:
ExceptionSerializer<T>
Direct Known Subclasses:
NamespacelessOWSExceptionXMLAdapter, OGCExceptionXMLAdapter, OWSException100XMLAdapter, OWSException110XMLAdapter, OWSException120XMLAdapter, ServiceException120XMLAdapter, SOAPExceptionSerializer

public abstract class XMLExceptionSerializer<T extends OWSException>
extends XMLAdapter
implements ExceptionSerializer<T>

The XMLExceptionSerializer class TODO add class documentation here.

Version:
$Revision: 31688 $, $Date: 2011-08-30 15:05:12 +0200 (Tue, 30 Aug 2011) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.commons.xml.XMLAdapter
DEFAULT_URL, nsContext, rootElement, XLN_NS
 
Constructor Summary
XMLExceptionSerializer()
           
 
Method Summary
 void serializeException(OutputStream outputStream, T exception, String requestedEncoding)
          Wraps a IndentingXMLStreamWriter around the given output stream and calls #serializeExceptionToXML(XMLStreamWriter, ControllerException).
abstract  void serializeExceptionToXML(XMLStreamWriter writer, T exception)
          Implementations can use the xml writer to serialize the given exception as a specific xml representation.
 
Methods inherited from class org.deegree.commons.xml.XMLAdapter
evaluateXPath, getElement, getElements, getNamespaceContext, getNode, getNodeAsBigInt, getNodeAsBoolean, getNodeAsDouble, getNodeAsFloat, getNodeAsInt, getNodeAsQName, getNodeAsString, getNodeAsURL, getNodeAsVersion, getNodes, getNodesAsQNames, getNodesAsStrings, getRequiredElement, getRequiredElements, getRequiredNode, getRequiredNodeAsBoolean, getRequiredNodeAsDouble, getRequiredNodeAsFloat, getRequiredNodeAsInteger, getRequiredNodeAsQName, getRequiredNodeAsString, getRequiredNodeAsURL, getRequiredNodeAsVersion, getRequiredNodes, getRootElement, getSchemas, getSystemId, hasSchemas, load, load, load, load, load, load, load, maybeWriteElement, maybeWriteElementNS, parseBoolean, parseDouble, parseFloat, parseInt, parseQName, parseSimpleLink, parseURL, resolve, setRootElement, setSystemId, toString, writeElement, writeElement, writeElement, writeElement, writeElement, writeOptionalAttribute, writeOptionalElement, writeOptionalNSAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLExceptionSerializer

public XMLExceptionSerializer()
Method Detail

serializeException

public final void serializeException(OutputStream outputStream,
                                     T exception,
                                     String requestedEncoding)
                              throws IOException
Wraps a IndentingXMLStreamWriter around the given output stream and calls #serializeExceptionToXML(XMLStreamWriter, ControllerException). The writer will prepare namespaces and will start and end the XML document.

Specified by:
serializeException in interface ExceptionSerializer<T extends OWSException>
Parameters:
outputStream - which will be wrapped.
exception - which must be serialized
requestedEncoding - of the stream
Throws:
IOException - if an error occurred while writing to the stream.

serializeExceptionToXML

public abstract void serializeExceptionToXML(XMLStreamWriter writer,
                                             T exception)
                                      throws XMLStreamException
Implementations can use the xml writer to serialize the given exception as a specific xml representation.

Parameters:
writer - a formatting xml writer, wrapped around an output stream.
exception - to serialize
Throws:
XMLStreamException - if an error occurred while serializing the given exception.


Copyright © 2011. All Rights Reserved.