/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Partial {@link Message} implementation.
*
* <p>
* This class implements some of the {@link Message} methods.
* The idea is that those implementations may be non-optimal but
* it may save effort in implementing {@link Message} and reduce
* the code size.
*
* <p>
* {@link Message} classes that are used more commonly should
* examine carefully which method can be implemented faster,
* and override them accordingly.
*
* @author Kohsuke Kawaguchi
*/
/**
* SOAP version of this message.
* Used to implement some of the methods, but nothing more than that.
*
* <p>
* So if you aren't using those methods that use this field,
* this can be null.
*/
this.soapVersion = soapVersion;
}
/**
* Copy constructor.
*/
}
}
if(hasAttachments())
try {
} finally{
}
}
}
/**
* Default implementation that relies on {@link #writePayloadTo(XMLStreamWriter)}
*/
w.writeStartDocument();
if(hasHeaders()) {
for( int i=0; i<len; i++ ) {
}
w.writeEndElement();
}
// write the body
writePayloadTo(w);
w.writeEndElement();
w.writeEndElement();
w.writeEndDocument();
}
/**
* Writes the whole envelope as SAX events.
*/
public void writeTo( ContentHandler contentHandler, ErrorHandler errorHandler ) throws SAXException {
if(hasHeaders()) {
for( int i=0; i<len; i++ ) {
// shouldn't JDK be smart enough to use array-style indexing for this foreach!?
}
}
// write the body
}
/**
* Writes the payload to SAX events.
*
* @param fragment
* if true, this method will fire SAX events without start/endDocument events,
* suitable for embedding this into a bigger SAX event sequence.
* if false, this method generaets a completely SAX event sequence on its own.
*/
protected abstract void writePayloadTo(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) throws SAXException;
/**
* Default implementation that uses {@link #writeTo(ContentHandler, ErrorHandler)}
*/
try {
} catch (SAXException e) {
throw new SOAPException(e);
}
}
return msg;
}
/**
*
*/
}
}
}
}
}
msg.saveChanges();
return msg;
}
}