MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.xdmio
Class XDMSerializer

java.lang.Object
  extended by ch.ethz.mxquery.xdmio.XDMSerializer

public class XDMSerializer
extends java.lang.Object

Serializer to turn XDM into a textual form Follows the XDM Serializer specification


Constructor Summary
XDMSerializer()
          Creates an XDM Serializer with XML output mode and the default settings
XDMSerializer(int outputMode)
          Creates an XDM Serializer with the given output mode and the default settings for this mode
XDMSerializer(XDMSerializerSettings settings)
          Creates an XDM Serializer with the given settings
 
Method Summary
 void eventsToSOAPMsg(java.io.PrintStream stream, XDMIterator resIter)
          Serialize the XDM instance generated by resIter into a character stream suitable for SOAP
static java.lang.StringBuffer eventsToString(XDMIterator iter)
          Serialize the XDM instance generated by resIter into a String containing the Token trace This is mainly suited for debugging
 void eventsToXML(java.io.PrintStream stream, XDMIterator resIter)
          Serialize the XDM instance generated by resIter into stream as character sequence
 java.lang.String eventsToXML(XDMIterator resIter)
          Serialize the XDM instance generated by resIter into a String
static java.lang.StringBuffer eventToString(Token tok)
          Serialize the XDM Token into a String containing the Token details This is mainly suited for debugging
static java.lang.String XMLPrettyPrint(java.lang.String str)
          Indent/beautify an String containing XML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDMSerializer

public XDMSerializer()
Creates an XDM Serializer with XML output mode and the default settings


XDMSerializer

public XDMSerializer(int outputMode)
              throws MXQueryException
Creates an XDM Serializer with the given output mode and the default settings for this mode

Parameters:
outputMode - One of XDMSerializerSettings.OUTPUT_METHOD_XML, XDMSerializerSettings.OUTPUT_METHOD_XHTML, XDMSerializerSettings.OUTPUT_METHOD_HTML, XDMSerializerSettings.OUTPUT_METHOD_TEXT
Throws:
MXQueryException - thrown if unsupported mode requested

XDMSerializer

public XDMSerializer(XDMSerializerSettings settings)
Creates an XDM Serializer with the given settings

Parameters:
settings -
Method Detail

eventsToXML

public void eventsToXML(java.io.PrintStream stream,
                        XDMIterator resIter)
                 throws MXQueryException
Serialize the XDM instance generated by resIter into stream as character sequence

Parameters:
stream - PrintStream
resIter - MXQuery Iterator producing an XDM instance
Throws:
MXQueryException - Exception generated by retrieving the XDM from resIter or during the serialization

eventsToXML

public java.lang.String eventsToXML(XDMIterator resIter)
                             throws MXQueryException
Serialize the XDM instance generated by resIter into a String

Parameters:
resIter - MXQuery Iterator producing an XDM instance
Throws:
MXQueryException - Exception generated by retrieving the XDM from resIter or during the serialization

eventsToSOAPMsg

public void eventsToSOAPMsg(java.io.PrintStream stream,
                            XDMIterator resIter)
                     throws MXQueryException
Serialize the XDM instance generated by resIter into a character stream suitable for SOAP

Parameters:
stream - PrintStream
resIter - MXQuery Iterator producing an XDM instance
Throws:
MXQueryException - Exception generated by retrieving the XDM from resIter or during the serialization

eventsToString

public static java.lang.StringBuffer eventsToString(XDMIterator iter)
                                             throws MXQueryException
Serialize the XDM instance generated by resIter into a String containing the Token trace This is mainly suited for debugging

Parameters:
iter - MXQuery Iterator producing an XDM instance
Returns:
a StringBuffer contained the event trace
Throws:
MXQueryException - Exception generated by retrieving the XDM from resIter or during the serialization

eventToString

public static java.lang.StringBuffer eventToString(Token tok)
                                            throws MXQueryException
Serialize the XDM Token into a String containing the Token details This is mainly suited for debugging

Parameters:
tok - XDM Token
Returns:
a StringBuffer containing the trace information for this particular event/token
Throws:
MXQueryException - Exception generated by retrieving the XDM from resIter or during the serialization

XMLPrettyPrint

public static java.lang.String XMLPrettyPrint(java.lang.String str)
Indent/beautify an String containing XML

Parameters:
str - A wring with XML to be intented
Returns:
A string with indented XML

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich