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

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 ControllerException>
extends org.deegree.commons.xml.XMLAdapter
implements ExceptionSerializer<T>

The XMLExceptionSerializer class TODO add class documentation here.

Version:
$Revision: 27406 $, $Date: 2010-10-19 18:43:48 +0200 (Di, 19. Okt 2010) $
Author:
Rutger Bezema, last edited by: $Author: sthomas $

Field Summary
 
Fields inherited from class org.deegree.commons.xml.XMLAdapter
DEFAULT_URL, nsContext, rootElement, XLN_NS
 
Constructor Summary
XMLExceptionSerializer()
           
 
Method Summary
 void serializeException(java.io.OutputStream outputStream, T exception, java.lang.String requestedEncoding)
          Wraps a IndentingXMLStreamWriter around the given output stream and calls serializeExceptionToXML(XMLStreamWriter, ControllerException).
abstract  void serializeExceptionToXML(javax.xml.stream.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, 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, 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(java.io.OutputStream outputStream,
                                     T exception,
                                     java.lang.String requestedEncoding)
                              throws java.io.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 ControllerException>
Parameters:
outputStream - which will be wrapped.
exception - which must be serialized
requestedEncoding - of the stream
Throws:
java.io.IOException - if an error occurred while writing to the stream.

serializeExceptionToXML

public abstract void serializeExceptionToXML(javax.xml.stream.XMLStreamWriter writer,
                                             T exception)
                                      throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException - if an error occurred while serializing the given exception.


Copyright © 2011. All Rights Reserved.