|
Axis 2 example source code file (MTOMAwareXMLSerializer.java)
The Axis 2 MTOMAwareXMLSerializer.java source code
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.axis2.databinding.utils.writer;
import org.apache.axiom.om.impl.llom.OMTextImpl;
import org.apache.axiom.om.OMAbstractFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.namespace.NamespaceContext;
import javax.activation.DataHandler;
/**
* this class wrapps the existing xmlStreamWriter and implements the new method
* writeDataHandler
*/
public class MTOMAwareXMLSerializer implements MTOMAwareXMLStreamWriter {
private XMLStreamWriter xmlStreamWriter;
public MTOMAwareXMLSerializer(XMLStreamWriter xmlStreamWriter) {
this.xmlStreamWriter = xmlStreamWriter;
}
public void writeStartElement(String string) throws XMLStreamException {
this.xmlStreamWriter.writeStartElement(string);
}
public void writeStartElement(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeStartElement(string, string1);
}
public void writeStartElement(String string, String string1, String string2) throws XMLStreamException {
this.xmlStreamWriter.writeStartElement(string, string1, string2);
}
public void writeEmptyElement(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeEmptyElement(string, string1);
}
public void writeEmptyElement(String string, String string1, String string2) throws XMLStreamException {
this.xmlStreamWriter.writeEmptyElement(string, string1, string2);
}
public void writeEmptyElement(String string) throws XMLStreamException {
this.xmlStreamWriter.writeEmptyElement(string);
}
public void writeEndElement() throws XMLStreamException {
this.xmlStreamWriter.writeEndElement();
}
public void writeEndDocument() throws XMLStreamException {
this.xmlStreamWriter.writeEndDocument();
}
public void close() throws XMLStreamException {
this.xmlStreamWriter.close();
}
public void flush() throws XMLStreamException {
this.xmlStreamWriter.flush();
}
public void writeAttribute(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeAttribute(string, string1);
}
public void writeAttribute(String string, String string1, String string2, String string3) throws XMLStreamException {
this.xmlStreamWriter.writeAttribute(string, string1, string2, string3);
}
public void writeAttribute(String string, String string1, String string2) throws XMLStreamException {
this.xmlStreamWriter.writeAttribute(string, string1, string2);
}
public void writeNamespace(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeNamespace(string, string1);
}
public void writeDefaultNamespace(String string) throws XMLStreamException {
this.xmlStreamWriter.writeDefaultNamespace(string);
}
public void writeComment(String string) throws XMLStreamException {
this.xmlStreamWriter.writeComment(string);
}
public void writeProcessingInstruction(String string) throws XMLStreamException {
this.xmlStreamWriter.writeProcessingInstruction(string);
}
public void writeProcessingInstruction(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeProcessingInstruction(string, string1);
}
public void writeCData(String string) throws XMLStreamException {
this.xmlStreamWriter.writeCData(string);
}
public void writeDTD(String string) throws XMLStreamException {
this.xmlStreamWriter.writeDTD(string);
}
public void writeEntityRef(String string) throws XMLStreamException {
this.xmlStreamWriter.writeEntityRef(string);
}
public void writeStartDocument() throws XMLStreamException {
this.xmlStreamWriter.writeStartDocument();
}
public void writeStartDocument(String string) throws XMLStreamException {
this.xmlStreamWriter.writeStartDocument(string);
}
public void writeStartDocument(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.writeStartDocument(string, string1);
}
public void writeCharacters(String string) throws XMLStreamException {
this.xmlStreamWriter.writeCharacters(string);
}
public void writeCharacters(char[] chars, int i, int i1) throws XMLStreamException {
this.xmlStreamWriter.writeCharacters(chars, i, i1);
}
public String getPrefix(String string) throws XMLStreamException {
return this.xmlStreamWriter.getPrefix(string);
}
public void setPrefix(String string, String string1) throws XMLStreamException {
this.xmlStreamWriter.setPrefix(string, string1);
}
public void setDefaultNamespace(String string) throws XMLStreamException {
this.xmlStreamWriter.setDefaultNamespace(string);
}
public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException {
this.xmlStreamWriter.setNamespaceContext(namespaceContext);
}
public NamespaceContext getNamespaceContext() {
return this.xmlStreamWriter.getNamespaceContext();
}
public Object getProperty(String string) throws IllegalArgumentException {
return this.xmlStreamWriter.getProperty(string);
}
public void writeDataHandler(DataHandler dataHandler) throws XMLStreamException {
OMTextImpl omText = new OMTextImpl(dataHandler, OMAbstractFactory.getOMFactory());
omText.internalSerializeAndConsume(this.xmlStreamWriter);
}
}
Other Axis 2 examples (source code examples)Here is a short list of links related to this Axis 2 MTOMAwareXMLSerializer.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.