| Method from com.sun.xml.internal.messaging.saaj.soap.SOAPPartImpl Detail: |
public void addMimeHeader(String name,
String value) {
headers.addHeader(name, value);
}
|
public Node adoptNode(Node source) throws DOMException {
handleNewSource();
return document.adoptNode(source);
}
|
public Node appendChild(Node newChild) throws DOMException {
handleNewSource();
return document.appendChild(newChild);
}
|
public Node cloneNode(boolean deep) {
handleNewSource();
return document.cloneNode(deep);
}
|
public short compareDocumentPosition(Node other) throws DOMException {
return document.compareDocumentPosition(other);
}
|
public Attr createAttribute(String name) throws DOMException {
return document.createAttribute(name);
}
|
public Attr createAttributeNS(String namespaceURI,
String qualifiedName) throws DOMException {
return document.createAttributeNS(namespaceURI, qualifiedName);
}
|
public CDATASection createCDATASection(String data) throws DOMException {
return document.createCDATASection(data);
}
|
public Comment createComment(String data) {
return document.createComment(data);
}
|
public DocumentFragment createDocumentFragment() {
return document.createDocumentFragment();
}
|
public Element createElement(String tagName) throws DOMException {
return document.createElement(tagName);
}
|
public Element createElementNS(String namespaceURI,
String qualifiedName) throws DOMException {
return document.createElementNS(namespaceURI, qualifiedName);
}
|
abstract protected Envelope createEmptyEnvelope(String prefix) throws SOAPException
|
public EntityReference createEntityReference(String name) throws DOMException {
return document.createEntityReference(name);
}
|
abstract protected Envelope createEnvelopeFromSource() throws SOAPException
|
public ProcessingInstruction createProcessingInstruction(String target,
String data) throws DOMException {
return document.createProcessingInstruction(target, data);
}
|
public Text createTextNode(String data) {
return document.createTextNode(data);
}
|
public void detachNode() {
// Nothing seems to be required to be done here
}
|
protected SOAPPartImpl doCloneNode() {
handleNewSource();
SOAPPartImpl newSoapPart = duplicateType();
newSoapPart.headers = MimeHeadersUtil.copy(this.headers);
newSoapPart.source = this.source;
return newSoapPart;
}
|
protected void doGetDocumentElement() {
handleNewSource();
try {
lookForEnvelope();
} catch (SOAPException e) {
}
}
|
abstract protected SOAPPartImpl duplicateType()
|
public Iterator getAllMimeHeaders() {
return headers.getAllHeaders();
}
|
public NamedNodeMap getAttributes() {
return document.getAttributes();
}
|
public String getBaseURI() {
return document.getBaseURI();
}
|
public NodeList getChildNodes() {
handleNewSource();
return document.getChildNodes();
}
|
public Source getContent() throws SOAPException {
if (source != null) {
InputStream bis = null;
if (source instanceof JAXMStreamSource) {
StreamSource streamSource = (StreamSource)source;
bis = streamSource.getInputStream();
} else if (FastInfosetReflection.isFastInfosetSource(source)) {
// FastInfosetSource inherits from SAXSource
SAXSource saxSource = (SAXSource)source;
bis = saxSource.getInputSource().getByteStream();
}
if (bis != null) {
try {
bis.reset();
} catch (IOException e) {
/* This exception will never be thrown.
*
* The setContent method will modify the source
* if StreamSource to JAXMStreamSource, that uses
* a ByteInputStream, and for a FastInfosetSource will
* replace the InputStream with a ByteInputStream.
*/
}
}
return source;
}
return ((Envelope) getEnvelope()).getContent();
}
|
public ByteInputStream getContentAsStream() throws IOException {
if (source != null) {
InputStream is = null;
// Allow message to be transcode if so requested
if (source instanceof StreamSource && !isFastInfoset()) {
is = ((StreamSource) source).getInputStream();
}
else if (FastInfosetReflection.isFastInfosetSource(source) &&
isFastInfoset())
{
try {
// InputStream is = source.getInputStream()
is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
}
catch (Exception e) {
throw new IOException(e.toString());
}
}
if (is != null) {
if (!(is instanceof ByteInputStream)) {
log.severe("SAAJ0546.soap.stream.incorrect.type");
throw new IOException("Internal error: stream not of the right type");
}
return (ByteInputStream) is;
}
// need to do something here for reader...
// for now we'll see if we can fallback...
}
ByteOutputStream b = new ByteOutputStream();
Envelope env = null;
try {
env = (Envelope) getEnvelope();
env.output(b, isFastInfoset());
}
catch (SOAPException soapException) {
log.severe("SAAJ0547.soap.cannot.externalize");
throw new SOAPIOException(
"SOAP exception while trying to externalize: ",
soapException);
}
return b.newInputStream();
}
|
abstract protected String getContentType()
|
protected String getContentTypeString() {
return getContentType();
}
|
DataHandler getDataHandler() {
DataSource ds = new DataSource() {
public OutputStream getOutputStream() throws IOException {
throw new IOException("Illegal Operation");
}
public String getContentType() {
return getContentTypeString();
}
public String getName() {
return getContentId();
}
public InputStream getInputStream() throws IOException {
return getContentAsStream();
}
};
return new DataHandler(ds);
}
|
public DocumentType getDoctype() {
return document.getDoctype();
}
|
public SOAPDocumentImpl getDocument() {
handleNewSource();
return document;
}
|
public Element getDocumentElement() {
// If there is no SOAP envelope already created, then create
// one from a source if one exists. If there is a newer source
// then use that source.
try {
getEnvelope();
} catch (SOAPException e) {
}
return document.getDocumentElement();
}
|
public String getDocumentURI() {
return document.getDocumentURI();
}
|
public DOMConfiguration getDomConfig() {
return document.getDomConfig();
}
|
public Element getElementById(String elementId) {
handleNewSource();
return document.getElementById(elementId);
}
|
public NodeList getElementsByTagName(String tagname) {
handleNewSource();
return document.getElementsByTagName(tagname);
}
|
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName) {
handleNewSource();
return document.getElementsByTagNameNS(namespaceURI, localName);
}
|
public SOAPEnvelope getEnvelope() throws SOAPException {
// If there is no SOAP envelope already created, then create
// one from a source if one exists. If there is a newer source
// then use that source.
if (sourceWasSet)
sourceWasSet = false;
lookForEnvelope();
if (envelope != null) {
if (source != null) { // there's a newer source, use it
document.removeChild(envelope);
envelope = createEnvelopeFromSource();
}
} else if (source != null) {
envelope = createEnvelopeFromSource();
} else {
envelope = createEmptyEnvelope(null);
document.insertBefore(envelope, null);
}
return envelope;
}
|
public Object getFeature(String feature,
String version) {
return document.getFeature(feature,version);
}
|
public Node getFirstChild() {
handleNewSource();
return document.getFirstChild();
}
|
public DOMImplementation getImplementation() {
return document.getImplementation();
}
|
public String getInputEncoding() {
return document.getInputEncoding();
}
|
public Node getLastChild() {
handleNewSource();
return document.getLastChild();
}
|
public String getLocalName() {
return document.getLocalName();
}
|
public Iterator getMatchingMimeHeaders(String[] names) {
return headers.getMatchingHeaders(names);
}
|
public String[] getMimeHeader(String name) {
return headers.getHeader(name);
}
|
MimeHeaders getMimeHeaders() {
return headers;
}
|
MimeBodyPart getMimePart() throws SOAPException {
try {
MimeBodyPart headerEnvelope = new MimeBodyPart();
headerEnvelope.setDataHandler(getDataHandler());
AttachmentPartImpl.copyMimeHeaders(headers, headerEnvelope);
return headerEnvelope;
} catch (SOAPException ex) {
throw ex;
} catch (Exception ex) {
log.severe("SAAJ0548.soap.cannot.externalize.hdr");
throw new SOAPExceptionImpl("Unable to externalize header", ex);
}
}
|
public String getNamespaceURI() {
return document.getNamespaceURI();
}
|
public Node getNextSibling() {
handleNewSource();
return document.getNextSibling();
}
|
public String getNodeName() {
return document.getNodeName();
}
|
public short getNodeType() {
return document.getNodeType();
}
|
public String getNodeValue() throws DOMException {
return document.getNodeValue();
}
|
public Iterator getNonMatchingMimeHeaders(String[] names) {
return headers.getNonMatchingHeaders(names);
}
|
public Document getOwnerDocument() {
return document.getOwnerDocument();
}
|
public SOAPElement getParentElement() {
return null;
}
|
public Node getParentNode() {
return document.getParentNode();
}
|
public String getPrefix() {
return document.getPrefix();
}
|
public Node getPreviousSibling() {
return document.getPreviousSibling();
}
|
public SOAPPartImpl getSOAPPart() {
return this;
}
|
public boolean getStrictErrorChecking() {
return document.getStrictErrorChecking();
}
|
public String getTextContent() throws DOMException {
return document.getTextContent();
}
|
public Object getUserData(String key) {
return document.getUserData(key);
}
|
public String getValue() {
return null;
}
|
public String getXmlEncoding() {
return document.getXmlEncoding();
}
|
public boolean getXmlStandalone() {
return document.getXmlStandalone();
}
|
public String getXmlVersion() {
return document.getXmlVersion();
}
|
public boolean hasAttributes() {
return document.hasAttributes();
}
|
public boolean hasChildNodes() {
handleNewSource();
return document.hasChildNodes();
}
|
public Node importNode(Node importedNode,
boolean deep) throws DOMException {
handleNewSource();
return document.importNode(importedNode, deep);
}
|
public Node insertBefore(Node arg0,
Node arg1) throws DOMException {
handleNewSource();
return document.insertBefore(arg0, arg1);
}
|
public boolean isDefaultNamespace(String namespaceURI) {
return document.isDefaultNamespace(namespaceURI);
}
|
public boolean isEqualNode(Node arg) {
return document.isEqualNode(arg);
}
|
public boolean isFastInfoset() {
return (message != null) ? message.isFastInfoset() : false;
}
|
public boolean isSameNode(Node other) {
return document.isSameNode(other);
}
|
public boolean isSupported(String arg0,
String arg1) {
return document.isSupported(arg0, arg1);
}
|
protected void lookForEnvelope() throws SOAPException {
Element envelopeChildElement = document.doGetDocumentElement();
if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) {
envelope = (EnvelopeImpl) envelopeChildElement;
} else if (!(envelopeChildElement instanceof ElementImpl)) {
log.severe("SAAJ0512.soap.incorrect.factory.used");
throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction");
} else {
ElementImpl soapElement = (ElementImpl) envelopeChildElement;
if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) {
String prefix = soapElement.getPrefix();
String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix);
if(!uri.equals(NameImpl.SOAP11_NAMESPACE) && !uri.equals(NameImpl.SOAP12_NAMESPACE)) {
log.severe("SAAJ0513.soap.unknown.ns");
throw new SOAPVersionMismatchException("Unable to create envelope from given source because the namespace was not recognized");
}
} else {
log.severe("SAAJ0514.soap.root.elem.not.named.envelope");
throw new SOAPExceptionImpl(
"Unable to create envelope from given source because the root element is not named \"Envelope\"");
}
}
}
|
protected XMLDeclarationParser lookForXmlDecl() throws SOAPException {
if ((source != null) && (source instanceof StreamSource)) {
Reader reader = null;
InputStream inputStream = ((StreamSource) source).getInputStream();
if (inputStream != null) {
if (sourceCharsetEncoding == null) {
reader = new InputStreamReader(inputStream);
} else {
try {
reader =
new InputStreamReader(
inputStream, sourceCharsetEncoding);
} catch (UnsupportedEncodingException uee) {
log.log(
Level.SEVERE,
"SAAJ0551.soap.unsupported.encoding",
new Object[] {sourceCharsetEncoding});
throw new SOAPExceptionImpl(
"Unsupported encoding " + sourceCharsetEncoding,
uee);
}
}
} else {
reader = ((StreamSource) source).getReader();
}
if (reader != null) {
PushbackReader pushbackReader =
new PushbackReader(reader, 4096); //some size to unread < ?xml ....? >
XMLDeclarationParser ev =
new XMLDeclarationParser(pushbackReader);
try {
ev.parse();
} catch (Exception e) {
log.log(
Level.SEVERE,
"SAAJ0552.soap.xml.decl.parsing.failed");
throw new SOAPExceptionImpl(
"XML declaration parsing failed", e);
}
String xmlDecl = ev.getXmlDeclaration();
if ((xmlDecl != null) && (xmlDecl.length() > 0))
this.omitXmlDecl = false;
return ev;
}
}
return null;
}
|
public String lookupNamespaceURI(String prefix) {
return document.lookupNamespaceURI(prefix);
}
|
public String lookupPrefix(String namespaceURI) {
return document.lookupPrefix(namespaceURI);
}
|
public void normalize() {
handleNewSource();
document.normalize();
}
|
public void normalizeDocument() {
document.normalizeDocument();
}
|
public void recycleNode() {
// Nothing seems to be required to be done here
}
|
public void removeAllMimeHeaders() {
headers.removeAllHeaders();
}
|
public Node removeChild(Node arg0) throws DOMException {
handleNewSource();
return document.removeChild(arg0);
}
|
public void removeMimeHeader(String header) {
headers.removeHeader(header);
}
|
public Node renameNode(Node n,
String namespaceURI,
String qualifiedName) throws DOMException {
handleNewSource();
return document.renameNode(n, namespaceURI, qualifiedName);
}
|
public Node replaceChild(Node arg0,
Node arg1) throws DOMException {
handleNewSource();
return document.replaceChild(arg0, arg1);
}
|
public void setContent(Source source) throws SOAPException {
try {
if (source instanceof StreamSource) {
InputStream is = ((StreamSource) source).getInputStream();
Reader rdr = ((StreamSource) source).getReader();
if (is != null) {
this.source = new JAXMStreamSource(is);
} else if (rdr != null) {
this.source = new JAXMStreamSource(rdr);
} else {
log.severe("SAAJ0544.soap.no.valid.reader.for.src");
throw new SOAPExceptionImpl("Source does not have a valid Reader or InputStream");
}
}
else if (FastInfosetReflection.isFastInfosetSource(source)) {
// InputStream is = source.getInputStream()
InputStream is = FastInfosetReflection.FastInfosetSource_getInputStream(source);
/*
* Underlying stream must be ByteInputStream for getContentAsStream(). We pay the
* cost of copying the underlying bytes here to avoid multiple copies every time
* getBytes() is called on a ByteInputStream.
*/
if (!(is instanceof ByteInputStream)) {
ByteOutputStream bout = new ByteOutputStream();
bout.write(is);
// source.setInputStream(new ByteInputStream(...))
FastInfosetReflection.FastInfosetSource_setInputStream(
source, bout.newInputStream());
}
this.source = source;
}
else {
this.source = source;
}
sourceWasSet = true;
}
catch (Exception ex) {
ex.printStackTrace();
log.severe("SAAJ0545.soap.cannot.set.src.for.part");
throw new SOAPExceptionImpl(
"Error setting the source for SOAPPart: " + ex.getMessage());
}
}
|
public void setDocumentURI(String documentURI) {
document.setDocumentURI(documentURI);
}
|
public void setMimeHeader(String name,
String value) {
headers.setHeader(name, value);
}
|
public void setNodeValue(String arg0) throws DOMException {
document.setNodeValue(arg0);
}
|
public void setParentElement(SOAPElement parent) throws SOAPException {
log.severe("SAAJ0570.soappart.parent.element.not.defined");
throw new SOAPExceptionImpl("The parent element of a soap part is not defined");
}
|
public void setPrefix(String arg0) throws DOMException {
document.setPrefix(arg0);
}
|
public void setSourceCharsetEncoding(String charset) {
this.sourceCharsetEncoding = charset;
}
|
public void setStrictErrorChecking(boolean strictErrorChecking) {
document.setStrictErrorChecking(strictErrorChecking);
}
|
public void setTextContent(String textContent) throws DOMException {
document.setTextContent(textContent);
}
|
public Object setUserData(String key,
Object data,
UserDataHandler handler) {
return document.setUserData(key, data, handler);
}
|
public void setValue(String value) {
log.severe("SAAJ0571.soappart.setValue.not.defined");
throw new IllegalStateException("Setting value of a soap part is not defined");
}
|
public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
document.setXmlStandalone(xmlStandalone);
}
|
public void setXmlVersion(String xmlVersion) throws DOMException {
document.setXmlVersion(xmlVersion);
}
|