org.apache.tuscany.sca.xsd.xml
Class XMLDocumentHelper

java.lang.Object
  extended by org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper

public class XMLDocumentHelper
extends java.lang.Object


Field Summary
protected static int BUFFER_SIZE
           
static javax.xml.namespace.QName WSDL11
           
static javax.xml.namespace.QName WSDL20
           
static javax.xml.namespace.QName XSD
           
 
Constructor Summary
XMLDocumentHelper()
           
 
Method Summary
static java.lang.String getEncoding(java.io.InputStream is)
          Detect the XML encoding of the document
static org.xml.sax.InputSource getInputSource(java.net.URL url)
           
static org.xml.sax.InputSource getInputSource(java.net.URL url, java.io.InputStream is)
           
protected static java.lang.String getXMLEncoding(byte[] bytes)
          Searches the array of bytes to determine the XML encoding.
protected static byte[] readBuffer(java.io.InputStream is)
           
static java.lang.String readTargetNamespace(java.net.URL doc, javax.xml.namespace.QName element, boolean rootOnly, java.lang.String attribute, javax.xml.stream.XMLInputFactory inputFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WSDL11

public static final javax.xml.namespace.QName WSDL11

XSD

public static final javax.xml.namespace.QName XSD

WSDL20

public static final javax.xml.namespace.QName WSDL20

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

XMLDocumentHelper

public XMLDocumentHelper()
Method Detail

getEncoding

public static java.lang.String getEncoding(java.io.InputStream is)
                                    throws java.io.IOException
Detect the XML encoding of the document

Parameters:
is - The input stream
Returns:
The encoding
Throws:
java.io.IOException

getXMLEncoding

protected static java.lang.String getXMLEncoding(byte[] bytes)
Searches the array of bytes to determine the XML encoding.


readBuffer

protected static byte[] readBuffer(java.io.InputStream is)
                            throws java.io.IOException
Throws:
java.io.IOException

getInputSource

public static org.xml.sax.InputSource getInputSource(java.net.URL url)
                                              throws java.io.IOException
Throws:
java.io.IOException

getInputSource

public static org.xml.sax.InputSource getInputSource(java.net.URL url,
                                                     java.io.InputStream is)
                                              throws java.io.IOException
Throws:
java.io.IOException

readTargetNamespace

public static java.lang.String readTargetNamespace(java.net.URL doc,
                                                   javax.xml.namespace.QName element,
                                                   boolean rootOnly,
                                                   java.lang.String attribute,
                                                   javax.xml.stream.XMLInputFactory inputFactory)
                                            throws java.io.IOException,
                                                   javax.xml.stream.XMLStreamException
Throws:
java.io.IOException
javax.xml.stream.XMLStreamException