com.sun.istack.internal.XMLStreamException2 Java Examples

The following examples show how to use com.sun.istack.internal.XMLStreamException2. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JAXBHeader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #2
Source File: JAXBHeader.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #3
Source File: JAXBHeader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #4
Source File: JAXBHeader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #5
Source File: JAXBHeader.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #6
Source File: JAXBHeader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #7
Source File: JAXBHeader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #8
Source File: JAXBHeader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
    try {
        // Get the encoding of the writer
        String encoding = XMLStreamWriterUtil.getEncoding(sw);

        // Get output stream and use JAXB UTF-8 writer
        OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null;
        if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) {
            bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), null);
        } else {
            bridge.marshal(jaxbObject,sw, null);
        }
    } catch (JAXBException e) {
        throw new XMLStreamException2(e);
    }
}
 
Example #9
Source File: DOMStreamReader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #10
Source File: DOMStreamReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #11
Source File: SAAJMessage.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #12
Source File: DOMStreamReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #13
Source File: DOMStreamReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #14
Source File: SAAJMessage.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #15
Source File: DOMStreamReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #16
Source File: DOMStreamReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #17
Source File: SAAJMessage.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #18
Source File: DOMStreamReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #19
Source File: DOMStreamReader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #20
Source File: SAAJMessage.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #21
Source File: DOMStreamReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #22
Source File: DOMStreamReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #23
Source File: SAAJMessage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #24
Source File: DOMStreamReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #25
Source File: DOMStreamReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #26
Source File: SAAJMessage.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #27
Source File: DOMStreamReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}
 
Example #28
Source File: DOMStreamReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public int nextTag() throws javax.xml.stream.XMLStreamException {
    int eventType = next();
    while (eventType == CHARACTERS && isWhiteSpace()
           || eventType == CDATA && isWhiteSpace()
           || eventType == SPACE
           || eventType == PROCESSING_INSTRUCTION
           || eventType == COMMENT)
    {
        eventType = next();
    }
    if (eventType != START_ELEMENT && eventType != END_ELEMENT) {
        throw new XMLStreamException2("DOMStreamReader: Expected start or end tag");
    }
    return eventType;
}
 
Example #29
Source File: SAAJMessage.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(XMLStreamWriter writer) throws XMLStreamException {
    try {
        writer.writeStartDocument();
        if (!parsedMessage) {
            DOMUtil.serializeNode(sm.getSOAPPart().getEnvelope(), writer);
        } else {
            SOAPEnvelope env = sm.getSOAPPart().getEnvelope();
            DOMUtil.writeTagWithAttributes(env, writer);
            if (hasHeaders()) {
                if(env.getHeader() != null) {
                    DOMUtil.writeTagWithAttributes(env.getHeader(), writer);
                } else {
                    writer.writeStartElement(env.getPrefix(), "Header", env.getNamespaceURI());
                }
                for (Header h : headers.asList()) {
                    h.writeTo(writer);
                }
                writer.writeEndElement();
            }

            DOMUtil.serializeNode(sm.getSOAPBody(), writer);
            writer.writeEndElement();
        }
        writer.writeEndDocument();
        writer.flush();
    } catch (SOAPException ex) {
        throw new XMLStreamException2(ex);
        //for now. ask jaxws team what to do.
    }
}
 
Example #30
Source File: DOMStreamReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void require(int type, String namespaceURI, String localName)
    throws javax.xml.stream.XMLStreamException
{
    if (type != _state) {
        throw new XMLStreamException2("DOMStreamReader: Required event type not found");
    }
    if (namespaceURI != null && !namespaceURI.equals(getNamespaceURI())) {
        throw new XMLStreamException2("DOMStreamReader: Required namespaceURI not found");
    }
    if (localName != null && !localName.equals(getLocalName())) {
        throw new XMLStreamException2("DOMStreamReader: Required localName not found");
    }
}