org.ow2.orchestra.console.ws.server
Class XBeansUtils

java.lang.Object
  extended by org.ow2.orchestra.console.ws.server.XBeansUtils

public class XBeansUtils
extends Object

Author:
Loic Albertin

Method Summary
static void createPartElement(javax.wsdl.Part part, List<javax.wsdl.extensions.schema.Schema> schemas, org.apache.xmlbeans.XmlCursor partCursor, org.apache.xmlbeans.XmlOptions options)
          Uses XmlBeans to generate a sample of a Part element
static String prettyToString(String xmlAsString)
          Indent an XML string using XmlBeans
static String prettyToString(org.apache.xmlbeans.XmlObject xmlObject)
          Indent the result of an XmlTokenSource.save(java.io.Writer) operation.
static void prettyWrite(org.apache.xmlbeans.XmlObject xmlObject, Writer writer)
          Wrapper for the prettyWrite(org.apache.xmlbeans.XmlObject, java.io.Writer, org.apache.xmlbeans.XmlOptions) operation with default options.
static void prettyWrite(org.apache.xmlbeans.XmlObject xmlObject, Writer writer, org.apache.xmlbeans.XmlOptions options)
          Saves an XmlObject to a writer using options to have a pretty indentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prettyToString

public static String prettyToString(String xmlAsString)
                             throws org.apache.xmlbeans.XmlException,
                                    IOException
Indent an XML string using XmlBeans

Parameters:
xmlAsString - the XML string
Returns:
the same XML string with a correct indentation
Throws:
org.apache.xmlbeans.XmlException - Throws if the XML string is not valid
IOException

prettyToString

public static String prettyToString(org.apache.xmlbeans.XmlObject xmlObject)
                             throws IOException
Indent the result of an XmlTokenSource.save(java.io.Writer) operation.

Parameters:
xmlObject - The XmlObject to convert in string
Returns:
The returned string
Throws:
IOException

prettyWrite

public static void prettyWrite(org.apache.xmlbeans.XmlObject xmlObject,
                               Writer writer)
                        throws IOException
Wrapper for the prettyWrite(org.apache.xmlbeans.XmlObject, java.io.Writer, org.apache.xmlbeans.XmlOptions) operation with default options.

Parameters:
xmlObject - The XmlObject to write
writer - The writer to use
Throws:
IOException
See Also:
prettyWrite(org.apache.xmlbeans.XmlObject, java.io.Writer, org.apache.xmlbeans.XmlOptions)

prettyWrite

public static void prettyWrite(org.apache.xmlbeans.XmlObject xmlObject,
                               Writer writer,
                               org.apache.xmlbeans.XmlOptions options)
                        throws IOException
Saves an XmlObject to a writer using options to have a pretty indentation.

Parameters:
xmlObject - The XmlObject to write
writer - The writer to use
options - Additional options
Throws:
IOException

createPartElement

public static void createPartElement(javax.wsdl.Part part,
                                     List<javax.wsdl.extensions.schema.Schema> schemas,
                                     org.apache.xmlbeans.XmlCursor partCursor,
                                     org.apache.xmlbeans.XmlOptions options)
                              throws OrchestraGwtException
Uses XmlBeans to generate a sample of a Part element

Parameters:
part - The part to write
schemas - schemas defined in the WSDL containing this Part
partCursor - an XmlCursor to write the part element
options - Additional XmlBeans options
Throws:
OrchestraGwtException


Copyright © 2012 OW2 Consortium. All Rights Reserved.