org.codehaus.activesoap.util
Class XMLStreamHelper

java.lang.Object
  extended byorg.codehaus.activesoap.util.XMLStreamHelper
All Implemented Interfaces:
XMLStreamConstants

public class XMLStreamHelper
extends Object
implements XMLStreamConstants

Utility methods for working with an XMLStreamWriter. Maybe push this back into stax-utils project.

Version:
$Revision: 1.14 $

Field Summary
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
XMLStreamHelper()
           
 
Method Summary
static void copy(XMLStreamReader in, ContentHandler contentHandler)
          Copies the content to the SAX stream
static void copy(XMLStreamReader in, XMLStreamWriter out, boolean repairing)
          Copies the current element and its conetnt to the output
static void copyElement(XMLStreamReader in, ContentHandler contentHandler)
          Copies the element and its content to the SAX stream
protected static boolean isPrefixNotMappedToUri(XMLStreamWriter out, String prefix, String uri)
           
static boolean skipToStartOfElement(XMLStreamReader in)
          Returns true if currently at the start of an element, otherwise move forwards to the next element start and return true, otherwise false is returned if the end of the stream is reached.
static void writeAttribute(XMLStreamWriter out, QName name, String attributeValue)
           
static void writeAttribute(XMLStreamWriter out, String prefix, String namespaceURI, String localPart, String attributeValue)
           
static void writeAttributes(XMLStreamWriter out, XMLStreamReader in)
           
static void writeEndElement(QName qname, ContentHandler handler)
           
static void writeNamespaces(XMLStreamWriter out, XMLStreamReader in, String prefixOfCurrentElement)
           
static void writeNamespacesExcludingPrefixAndNamespace(XMLStreamWriter out, XMLStreamReader in, String ignorePrefix, String ignoreNamespace)
           
static void writeStartElement(QName qname, ContentHandler handler)
           
static void writeStartElement(XMLStreamWriter out, QName envelopeName, boolean repairing)
           
static void writeStartElement(XMLStreamWriter out, String prefix, String uri, String localName, boolean repairing)
           
static void writeStartElement(XMLStreamWriter out, XMLStreamReader in, boolean repairing)
           
static void writeStartElementAndAttributes(XMLStreamWriter out, XMLStreamReader in, boolean repairing)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLStreamHelper

public XMLStreamHelper()
Method Detail

skipToStartOfElement

public static boolean skipToStartOfElement(XMLStreamReader in)
                                    throws XMLStreamException
Returns true if currently at the start of an element, otherwise move forwards to the next element start and return true, otherwise false is returned if the end of the stream is reached.

Throws:
XMLStreamException

writeStartElement

public static void writeStartElement(QName qname,
                                     ContentHandler handler)
                              throws SAXException
Throws:
SAXException

writeEndElement

public static void writeEndElement(QName qname,
                                   ContentHandler handler)
                            throws SAXException
Throws:
SAXException

copy

public static void copy(XMLStreamReader in,
                        XMLStreamWriter out,
                        boolean repairing)
                 throws XMLStreamException
Copies the current element and its conetnt to the output

Throws:
XMLStreamException

writeStartElement

public static void writeStartElement(XMLStreamWriter out,
                                     String prefix,
                                     String uri,
                                     String localName,
                                     boolean repairing)
                              throws XMLStreamException
Throws:
XMLStreamException

writeStartElement

public static void writeStartElement(XMLStreamWriter out,
                                     QName envelopeName,
                                     boolean repairing)
                              throws XMLStreamException
Throws:
XMLStreamException

writeStartElement

public static void writeStartElement(XMLStreamWriter out,
                                     XMLStreamReader in,
                                     boolean repairing)
                              throws XMLStreamException
Throws:
XMLStreamException

writeStartElementAndAttributes

public static void writeStartElementAndAttributes(XMLStreamWriter out,
                                                  XMLStreamReader in,
                                                  boolean repairing)
                                           throws XMLStreamException
Throws:
XMLStreamException

writeAttributes

public static void writeAttributes(XMLStreamWriter out,
                                   XMLStreamReader in)
                            throws XMLStreamException
Throws:
XMLStreamException

writeNamespaces

public static void writeNamespaces(XMLStreamWriter out,
                                   XMLStreamReader in,
                                   String prefixOfCurrentElement)
                            throws XMLStreamException
Throws:
XMLStreamException

writeNamespacesExcludingPrefixAndNamespace

public static void writeNamespacesExcludingPrefixAndNamespace(XMLStreamWriter out,
                                                              XMLStreamReader in,
                                                              String ignorePrefix,
                                                              String ignoreNamespace)
                                                       throws XMLStreamException
Throws:
XMLStreamException

writeAttribute

public static void writeAttribute(XMLStreamWriter out,
                                  QName name,
                                  String attributeValue)
                           throws XMLStreamException
Throws:
XMLStreamException

writeAttribute

public static void writeAttribute(XMLStreamWriter out,
                                  String prefix,
                                  String namespaceURI,
                                  String localPart,
                                  String attributeValue)
                           throws XMLStreamException
Throws:
XMLStreamException

isPrefixNotMappedToUri

protected static boolean isPrefixNotMappedToUri(XMLStreamWriter out,
                                                String prefix,
                                                String uri)

copy

public static void copy(XMLStreamReader in,
                        ContentHandler contentHandler)
                 throws XMLStreamException
Copies the content to the SAX stream

Throws:
XMLStreamException

copyElement

public static void copyElement(XMLStreamReader in,
                               ContentHandler contentHandler)
                        throws XMLStreamException
Copies the element and its content to the SAX stream

Throws:
XMLStreamException


Copyright © 2004-2007 LogicBlaze, Inc.. All Rights Reserved.