|
|||||||||
| Home >> All >> org >> apache >> [ axis overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.axis
Class SOAPPart

java.lang.Objectjavax.xml.soap.SOAPPart
org.apache.axis.SOAPPart
- All Implemented Interfaces:
- org.w3c.dom.Document, org.w3c.dom.Node, Part, java.io.Serializable
- public class SOAPPart
- extends javax.xml.soap.SOAPPart
- implements Part
- extends javax.xml.soap.SOAPPart
The SOAPPart provides access to the root part of the Message which contains the envelope.
SOAPPart implements Part, providing common MIME operations.
SOAPPart also allows access to its envelope, as a string, byte[], InputStream, or SOAPEnvelope. (This functionality used to be in Message, and has been moved here more or less verbatim pending further cleanup.)
| Field Summary | |
static java.lang.String |
ALLOW_FORM_OPTIMIZATION
property used to set SOAPEnvelope as default form |
private javax.xml.transform.Source |
contentSource
Field contentSource. |
private java.lang.String |
currentEncoding
default message encoding charset |
private int |
currentForm
|
private java.lang.Object |
currentMessage
The current representation of the SOAP contents of this part. |
private byte[] |
currentMessageAsBytes
|
private org.apache.axis.message.SOAPEnvelope |
currentMessageAsEnvelope
|
private java.lang.String |
currentMessageAsString
|
private org.w3c.dom.Document |
document
Implementation of org.w3c.Document Most of methods will be implemented using the delgate instance of SOAPDocumentImpl This is for two reasons: - possible change of message classes, by extenstion of xerces implementation - we cannot extends SOAPPart (multiple inheritance), since it is defined as Abstract class *********************************************************** |
static int |
FORM_BODYINSTREAM
|
static int |
FORM_BYTES
|
static int |
FORM_FAULT
|
static int |
FORM_INPUTSTREAM
|
static int |
FORM_OPTIMIZED
|
static int |
FORM_SOAPENVELOPE
|
static int |
FORM_STRING
|
private static java.lang.String[] |
formNames
|
protected static org.apache.commons.logging.Log |
log
|
protected org.w3c.dom.Document |
mDocument
SOAPEnvelope is the Document Elements of this XML docuement |
private org.apache.axis.message.MimeHeaders |
mimeHeaders
|
private Message |
msgObject
Message object this part is tied to. |
| Constructor Summary | |
SOAPPart(Message parent,
java.lang.Object initialContents,
boolean isBodyStream)
Create a new SOAPPart. |
|
| Method Summary | |
void |
addMimeHeader(java.lang.String header,
java.lang.String value)
Add the specified MIME header, as per JAXM. |
org.w3c.dom.Node |
adoptNode(org.w3c.dom.Node node)
Attempts to adopt a node from another document to this document. |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children
of this node. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
org.w3c.dom.Attr |
createAttribute(java.lang.String name)
Creates an Attr of the given name. |
org.w3c.dom.Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an attribute of the given qualified name and namespace URI. |
org.w3c.dom.CDATASection |
createCDATASection(java.lang.String data)
Creates a CDATASection node whose value is the specified
string. |
org.w3c.dom.Comment |
createComment(java.lang.String data)
Creates a Comment node given the specified string. |
org.w3c.dom.DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object. |
org.w3c.dom.Element |
createElement(java.lang.String tagName)
Creates an element of the type specified. |
org.w3c.dom.Element |
createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an element of the given qualified name and namespace URI. |
org.w3c.dom.EntityReference |
createEntityReference(java.lang.String name)
Creates an EntityReference object. |
org.w3c.dom.ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
Creates a ProcessingInstruction node given the specified
name and data strings. |
org.w3c.dom.Text |
createTextNode(java.lang.String data)
Creates a Text node given the specified string. |
java.util.Iterator |
getAllMimeHeaders()
Retrieves all the headers for this SOAPPart
object as an iterator over the MimeHeader
objects. |
byte[] |
getAsBytes()
Get the contents of this Part (not the headers!), as a byte array. |
org.apache.axis.message.SOAPEnvelope |
getAsSOAPEnvelope()
Get the contents of this Part (not the MIME headers!), as a SOAPEnvelope. |
java.lang.String |
getAsString()
Get the contents of this Part (not the headers!), as a String. |
org.w3c.dom.NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise. |
org.w3c.dom.NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
javax.xml.transform.Source |
getContent()
Returns the content of the SOAPEnvelope as a JAXP
Source object. |
java.lang.String |
getContentId()
Content ID. |
java.lang.String |
getContentIdRef()
Content ID. |
long |
getContentLength()
Get the content length for this SOAPPart. |
java.lang.String |
getContentLocation()
Content location. |
java.lang.String |
getContentType()
Content type is always "text/xml" for SOAPParts. |
int |
getCurrentForm()
|
java.lang.Object |
getCurrentMessage()
Get the current message, in whatever form it happens to be right now. |
org.w3c.dom.DocumentType |
getDoctype()
The Document Type Declaration (see DocumentType)
associated with this document. |
org.w3c.dom.Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the document element of the document. |
org.w3c.dom.Element |
getElementById(java.lang.String elementId)
Returns the Element that has an ID attribute with the
given value. |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagname)
Returns a NodeList of all the Elements in
document order with a given tag name and are contained in the
document. |
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns a NodeList of all the Elements with a
given local name and namespace URI in document order. |
java.lang.String |
getEncoding()
|
javax.xml.soap.SOAPEnvelope |
getEnvelope()
Gets the SOAPEnvelope object associated with
this SOAPPart object. |
org.w3c.dom.Node |
getFirstChild()
The first child of this node. |
private java.lang.String |
getFirstMimeHeader(java.lang.String header)
Get the specified MIME header. |
org.w3c.dom.DOMImplementation |
getImplementation()
The DOMImplementation object that handles this document. |
org.w3c.dom.Node |
getLastChild()
The last child of this node. |
java.lang.String |
getLocalName()
Returns the local part of the qualified name of this node. |
java.util.Iterator |
getMatchingMimeHeaders(java.lang.String[] match)
Get all headers that match. |
Message |
getMessage()
Get the Message for this Part. |
java.lang.String[] |
getMimeHeader(java.lang.String name)
Gets all the values of the MimeHeader object
in this SOAPPart object that is identified by
the given String. |
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified (see ). |
org.w3c.dom.Node |
getNextSibling()
The node immediately following this node. |
java.lang.String |
getNodeName()
Node Implementation |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
java.lang.String |
getNodeValue()
The value of this node, depending on its type; see the table above. |
java.util.Iterator |
getNonMatchingMimeHeaders(java.lang.String[] match)
Get all headers that do not match. |
org.w3c.dom.Document |
getOwnerDocument()
The Document object associated with this node. |
org.w3c.dom.Node |
getParentNode()
The parent of this node. |
java.lang.String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
org.w3c.dom.Node |
getPreviousSibling()
The node immediately preceding this node. |
org.w3c.dom.Document |
getSOAPDocument()
|
boolean |
getStandalone()
|
boolean |
getStrictErrorChecking()
An attribute specifying whether error checking is enforced or not. |
java.lang.String |
getVersion()
|
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Returns whether this node has any children. |
org.w3c.dom.Node |
importNode(org.w3c.dom.Node importedNode,
boolean deep)
Imports a node from another document to this document, without altering or removing the source node from the original document; this method creates a new copy of the source node. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Inserts the node newChild before the existing child node
refChild. |
boolean |
isBodyStream()
|
private boolean |
isFormOptimizationAllowed()
check if the allow optimization flag is on |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node, as specified in . |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
void |
removeAllMimeHeaders()
Removes all the MimeHeader objects for this
SOAPEnvelope object. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the child node indicated by oldChild from the list
of children, and returns it. |
void |
removeMimeHeader(java.lang.String header)
Removes all MIME headers that match the given name. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces the child node oldChild with newChild
in the list of children, and returns the oldChild node. |
void |
saveChanges()
|
void |
setContent(javax.xml.transform.Source source)
Sets the content of the SOAPEnvelope object
with the data from the given Source object. |
void |
setContentId(java.lang.String newCid)
Sets Content-Id of this part. |
void |
setContentLocation(java.lang.String loc)
Set content location. |
private void |
setCurrentForm(java.lang.Object currMsg,
int form)
Set the current contents of this Part. |
void |
setCurrentMessage(java.lang.Object currMsg,
int form)
Set the current message |
void |
setEncoding(java.lang.String s)
|
void |
setMessage(Message msg)
Set the Message for this Part. |
void |
setMimeHeader(java.lang.String name,
java.lang.String value)
Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match. |
void |
setNodeValue(java.lang.String nodeValue)
The value of this node, depending on its type; see the table above. |
void |
setPrefix(java.lang.String prefix)
The namespace prefix of this node, or null if it is
unspecified. |
void |
setSOAPEnvelope(org.apache.axis.message.SOAPEnvelope env)
This set the SOAP Envelope for this part. |
void |
setStandalone(boolean flag)
|
void |
setStrictErrorChecking(boolean flag)
An attribute specifying whether error checking is enforced or not. |
void |
setVersion(java.lang.String s)
|
void |
writeTo(java.io.OutputStream os)
Write the contents to the specified stream. |
void |
writeTo(java.io.Writer writer)
Write the contents to the specified writer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Document |
getDocumentURI, getDomConfig, getInputEncoding, getXmlEncoding, getXmlStandalone, getXmlVersion, normalizeDocument, renameNode, setDocumentURI, setXmlStandalone, setXmlVersion |
| Methods inherited from interface org.w3c.dom.Node |
compareDocumentPosition, getBaseURI, getFeature, getTextContent, getUserData, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, setTextContent, setUserData |
| Field Detail |
log
protected static org.apache.commons.logging.Log log
FORM_STRING
public static final int FORM_STRING
- See Also:
- Constant Field Values
FORM_INPUTSTREAM
public static final int FORM_INPUTSTREAM
- See Also:
- Constant Field Values
FORM_SOAPENVELOPE
public static final int FORM_SOAPENVELOPE
- See Also:
- Constant Field Values
FORM_BYTES
public static final int FORM_BYTES
- See Also:
- Constant Field Values
FORM_BODYINSTREAM
public static final int FORM_BODYINSTREAM
- See Also:
- Constant Field Values
FORM_FAULT
public static final int FORM_FAULT
- See Also:
- Constant Field Values
FORM_OPTIMIZED
public static final int FORM_OPTIMIZED
- See Also:
- Constant Field Values
currentForm
private int currentForm
ALLOW_FORM_OPTIMIZATION
public static final java.lang.String ALLOW_FORM_OPTIMIZATION
- property used to set SOAPEnvelope as default form
- See Also:
- Constant Field Values
mimeHeaders
private org.apache.axis.message.MimeHeaders mimeHeaders
formNames
private static final java.lang.String[] formNames
currentMessage
private java.lang.Object currentMessage
- The current representation of the SOAP contents of this part.
May be a String, byte[], InputStream, or SOAPEnvelope, depending
on whatever was last asked for. (ack)
currentForm must have the corresponding value.
As someone once said: "Just a placeholder until we figure out what the actual Message object is."
currentEncoding
private java.lang.String currentEncoding
- default message encoding charset
currentMessageAsString
private java.lang.String currentMessageAsString
currentMessageAsBytes
private byte[] currentMessageAsBytes
currentMessageAsEnvelope
private org.apache.axis.message.SOAPEnvelope currentMessageAsEnvelope
msgObject
private Message msgObject
- Message object this part is tied to. Used for serialization settings.
contentSource
private javax.xml.transform.Source contentSource
- Field contentSource.
document
private org.w3c.dom.Document document
- Implementation of org.w3c.Document
Most of methods will be implemented using the delgate
instance of SOAPDocumentImpl
This is for two reasons:
- possible change of message classes, by extenstion of xerces implementation
- we cannot extends SOAPPart (multiple inheritance),
since it is defined as Abstract class
***********************************************************
mDocument
protected org.w3c.dom.Document mDocument
- SOAPEnvelope is the Document Elements of this XML docuement
| Constructor Detail |
SOAPPart
public SOAPPart(Message parent, java.lang.Object initialContents, boolean isBodyStream)
- Create a new SOAPPart.
Do not call this directly! Should only be called by Message.
| Method Detail |
getMessage
public Message getMessage()
- Get the
Messagefor thisPart.
setMessage
public void setMessage(Message msg)
- Set the Message for this Part.
Do not call this Directly. Called by Message.
getContentType
public java.lang.String getContentType()
- Content type is always "text/xml" for SOAPParts.
- Specified by:
getContentTypein interfacePart
getContentLength
public long getContentLength()
throws AxisFault
- Get the content length for this SOAPPart.
This will force buffering of the SOAPPart, but it will
also cache the byte[] form of the SOAPPart.
setSOAPEnvelope
public void setSOAPEnvelope(org.apache.axis.message.SOAPEnvelope env)
- This set the SOAP Envelope for this part.
Note: It breaks the chicken/egg created. I need a message to create an attachment... From the attachment I should be able to get a reference... I now want to edit elements in the envelope in order to place the attachment reference to it. How do I now update the SOAP envelope with what I've changed?
writeTo
public void writeTo(java.io.OutputStream os) throws java.io.IOException
- Write the contents to the specified stream.
writeTo
public void writeTo(java.io.Writer writer) throws java.io.IOException
- Write the contents to the specified writer.
getCurrentMessage
public java.lang.Object getCurrentMessage()
- Get the current message, in whatever form it happens to be right now.
Will return a String, byte[], InputStream, or SOAPEnvelope, depending
on circumstances.
The method name is historical. TODO: rename this for clarity; should be more like getContents.
setCurrentMessage
public void setCurrentMessage(java.lang.Object currMsg, int form)
- Set the current message
setCurrentForm
private void setCurrentForm(java.lang.Object currMsg, int form)
- Set the current contents of this Part.
The method name is historical.
TODO: rename this for clarity to something more like setContents???
isFormOptimizationAllowed
private boolean isFormOptimizationAllowed()
- check if the allow optimization flag is on
getCurrentForm
public int getCurrentForm()
getAsBytes
public byte[] getAsBytes()
throws AxisFault
- Get the contents of this Part (not the headers!), as a byte
array. This will force buffering of the message.
saveChanges
public void saveChanges()
throws AxisFault
getAsString
public java.lang.String getAsString() throws AxisFault
- Get the contents of this Part (not the headers!), as a String.
This will force buffering of the message.
getAsSOAPEnvelope
public org.apache.axis.message.SOAPEnvelope getAsSOAPEnvelope() throws AxisFault
- Get the contents of this Part (not the MIME headers!), as a
SOAPEnvelope. This will force a complete parse of the
message.
addMimeHeader
public void addMimeHeader(java.lang.String header, java.lang.String value)
- Add the specified MIME header, as per JAXM.
- Specified by:
addMimeHeaderin interfacePart
getFirstMimeHeader
private java.lang.String getFirstMimeHeader(java.lang.String header)
- Get the specified MIME header.
getContentLocation
public java.lang.String getContentLocation()
- Content location.
- Specified by:
getContentLocationin interfacePart
setContentLocation
public void setContentLocation(java.lang.String loc)
- Set content location.
- Specified by:
setContentLocationin interfacePart
setContentId
public void setContentId(java.lang.String newCid)
- Sets Content-Id of this part.
already defined.
- Specified by:
setContentIdin interfacePart
getContentId
public java.lang.String getContentId()
- Content ID.
- Specified by:
getContentIdin interfacePart
getContentIdRef
public java.lang.String getContentIdRef()
- Content ID.
- Specified by:
getContentIdRefin interfacePart
getMatchingMimeHeaders
public java.util.Iterator getMatchingMimeHeaders(java.lang.String[] match)
- Get all headers that match.
- Specified by:
getMatchingMimeHeadersin interfacePart
getNonMatchingMimeHeaders
public java.util.Iterator getNonMatchingMimeHeaders(java.lang.String[] match)
- Get all headers that do not match.
- Specified by:
getNonMatchingMimeHeadersin interfacePart
setContent
public void setContent(javax.xml.transform.Source source) throws javax.xml.soap.SOAPException
- Sets the content of the
SOAPEnvelopeobject with the data from the givenSourceobject.
getContent
public javax.xml.transform.Source getContent() throws javax.xml.soap.SOAPException
- Returns the content of the SOAPEnvelope as a JAXP
Sourceobject.
getAllMimeHeaders
public java.util.Iterator getAllMimeHeaders()
- Retrieves all the headers for this
SOAPPartobject as an iterator over theMimeHeaderobjects.
setMimeHeader
public void setMimeHeader(java.lang.String name, java.lang.String value)
- Changes the first header entry that matches the given
header name so that its value is the given value, adding a
new header with the given name and value if no existing
header is a match. If there is a match, this method clears
all existing values for the first header that matches and
sets the given value instead. If more than one header has
the given name, this method removes all of the matching
headers after the first one.
Note that RFC822 headers can contain only US-ASCII characters.
getMimeHeader
public java.lang.String[] getMimeHeader(java.lang.String name)
- Gets all the values of the
MimeHeaderobject in thisSOAPPartobject that is identified by the givenString.- Specified by:
getMimeHeaderin interfacePart
removeAllMimeHeaders
public void removeAllMimeHeaders()
- Removes all the
MimeHeaderobjects for thisSOAPEnvelopeobject.
removeMimeHeader
public void removeMimeHeader(java.lang.String header)
- Removes all MIME headers that match the given name.
getEnvelope
public javax.xml.soap.SOAPEnvelope getEnvelope() throws javax.xml.soap.SOAPException
- Gets the
SOAPEnvelopeobject associated with thisSOAPPartobject. Once the SOAP envelope is obtained, it can be used to get its contents.
getSOAPDocument
public org.w3c.dom.Document getSOAPDocument()
- Since:
- SAAJ 1.2
getDoctype
public org.w3c.dom.DocumentType getDoctype()
- Description copied from interface:
org.w3c.dom.Document - The Document Type Declaration (see
DocumentType) associated with this document. For XML documents without a document type declaration this returnsnull. For HTML documents, aDocumentTypeobject may be returned, independently of the presence or absence of document type declaration in the HTML document.
This provides direct access to theDocumentTypenode, child node of thisDocument. This node can be set at document creation time and later changed through the use of child nodes manipulation methods, such asNode.insertBefore, orNode.replaceChild. Note, however, that while some implementations may instantiate different types ofDocumentobjects supporting additional features than the "Core", such as "HTML" [DOM Level 2 HTML] , based on theDocumentTypespecified at creation time, changing it afterwards is very unlikely to result in a change of the features supported.- Specified by:
getDoctypein interfaceorg.w3c.dom.Document
getImplementation
public org.w3c.dom.DOMImplementation getImplementation()
- Description copied from interface:
org.w3c.dom.Document - The
DOMImplementationobject that handles this document. A DOM application may use objects from multiple implementations.- Specified by:
getImplementationin interfaceorg.w3c.dom.Document
getDocumentElement
public org.w3c.dom.Element getDocumentElement()
- Description copied from interface:
org.w3c.dom.Document - This is a convenience attribute that allows direct access to the child
node that is the document element of the document.
- Specified by:
getDocumentElementin interfaceorg.w3c.dom.Document
createElement
public org.w3c.dom.Element createElement(java.lang.String tagName) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates an element of the type specified. Note that the instance
returned implements the
Elementinterface, so attributes can be specified directly on the returned object.
In addition, if there are known attributes with default values,Attrnodes representing them are automatically created and attached to the element.
To create an element with a qualified name and namespace URI, use thecreateElementNSmethod.- Specified by:
createElementin interfaceorg.w3c.dom.Document
createDocumentFragment
public org.w3c.dom.DocumentFragment createDocumentFragment()
- Description copied from interface:
org.w3c.dom.Document - Creates an empty
DocumentFragmentobject.- Specified by:
createDocumentFragmentin interfaceorg.w3c.dom.Document
createTextNode
public org.w3c.dom.Text createTextNode(java.lang.String data)
- Description copied from interface:
org.w3c.dom.Document - Creates a
Textnode given the specified string.- Specified by:
createTextNodein interfaceorg.w3c.dom.Document
createComment
public org.w3c.dom.Comment createComment(java.lang.String data)
- Description copied from interface:
org.w3c.dom.Document - Creates a
Commentnode given the specified string.- Specified by:
createCommentin interfaceorg.w3c.dom.Document
createCDATASection
public org.w3c.dom.CDATASection createCDATASection(java.lang.String data) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates a
CDATASectionnode whose value is the specified string.- Specified by:
createCDATASectionin interfaceorg.w3c.dom.Document
createProcessingInstruction
public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates a
ProcessingInstructionnode given the specified name and data strings.- Specified by:
createProcessingInstructionin interfaceorg.w3c.dom.Document
createAttribute
public org.w3c.dom.Attr createAttribute(java.lang.String name) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates an
Attrof the given name. Note that theAttrinstance can then be set on anElementusing thesetAttributeNodemethod.
To create an attribute with a qualified name and namespace URI, use thecreateAttributeNSmethod.- Specified by:
createAttributein interfaceorg.w3c.dom.Document
createEntityReference
public org.w3c.dom.EntityReference createEntityReference(java.lang.String name) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates an
EntityReferenceobject. In addition, if the referenced entity is known, the child list of theEntityReferencenode is made the same as that of the correspondingEntitynode.Note: If any descendant of the
Entitynode has an unbound namespace prefix, the corresponding descendant of the createdEntityReferencenode is also unbound; (itsnamespaceURIisnull). The DOM Level 2 and 3 do not support any mechanism to resolve namespace prefixes in this case.- Specified by:
createEntityReferencein interfaceorg.w3c.dom.Document
getElementsByTagName
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
- Description copied from interface:
org.w3c.dom.Document - Returns a
NodeListof all theElementsin document order with a given tag name and are contained in the document.- Specified by:
getElementsByTagNamein interfaceorg.w3c.dom.Document
importNode
public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Imports a node from another document to this document, without altering
or removing the source node from the original document; this method
creates a new copy of the source node. The returned node has no
parent; (
parentNodeisnull).
For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node'snodeNameandnodeType, plus the attributes related to namespaces (prefix,localName, andnamespaceURI). As in thecloneNodeoperation, the source node is not altered. User data associated to the imported node is not carried over. However, if anyUserDataHandlershas been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
Additional information is copied as appropriate to thenodeType, attempting to mirror the behavior expected if a fragment of XML or HTML source was copied from one document to another, recognizing that the two documents may have different DTDs in the XML case. The following list describes the specifics for each type of node.- ATTRIBUTE_NODE
- The
ownerElementattribute is set tonulland thespecifiedflag is set totrueon the generatedAttr. The descendants of the sourceAttrare recursively imported and the resulting nodes reassembled to form the corresponding subtree. Note that thedeepparameter has no effect onAttrnodes; they always carry their children with them when imported. - DOCUMENT_FRAGMENT_NODE
- If the
deepoption was set totrue, the descendants of the sourceDocumentFragmentare recursively imported and the resulting nodes reassembled under the importedDocumentFragmentto form the corresponding subtree. Otherwise, this simply generates an emptyDocumentFragment. - DOCUMENT_NODE
Documentnodes cannot be imported.- DOCUMENT_TYPE_NODE
DocumentTypenodes cannot be imported.- ELEMENT_NODE
- Specified attribute nodes of the source element are imported, and the generated
Attrnodes are attached to the generatedElement. Default attributes are not copied, though if the document being imported into defines default attributes for this element name, those are assigned. If theimportNodedeepparameter was set totrue, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree. - ENTITY_NODE
Entitynodes can be imported, however in the current release of the DOM theDocumentTypeis readonly. Ability to add these imported nodes to aDocumentTypewill be considered for addition to a future release of the DOM.On import, thepublicId,systemId, andnotationNameattributes are copied. If adeepimport is requested, the descendants of the the sourceEntityare recursively imported and the resulting nodes reassembled to form the corresponding subtree.- ENTITY_REFERENCE_NODE
- Only the
EntityReferenceitself is copied, even if adeepimport is requested, since the source and destination documents might have defined the entity differently. If the document being imported into provides a definition for this entity name, its value is assigned. - NOTATION_NODE
-
Notationnodes can be imported, however in the current release of the DOM theDocumentTypeis readonly. Ability to add these imported nodes to aDocumentTypewill be considered for addition to a future release of the DOM.On import, thepublicIdandsystemIdattributes are copied. Note that thedeepparameter has no effect on this type of nodes since they cannot have any children. - PROCESSING_INSTRUCTION_NODE
- The imported node copies its
targetanddatavalues from those of the source node.Note that thedeepparameter has no effect on this type of nodes since they cannot have any children. - TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE
- These three types of nodes inheriting
from
CharacterDatacopy theirdataandlengthattributes from those of the source node.Note that thedeepparameter has no effect on these types of nodes since they cannot have any children.
- Specified by:
importNodein interfaceorg.w3c.dom.Document
createElementNS
public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates an element of the given qualified name and namespace URI.
Per [XML Namespaces] , applications must use the valuenullas the namespaceURI parameter for methods if they wish to have no namespace.- Specified by:
createElementNSin interfaceorg.w3c.dom.Document
createAttributeNS
public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Creates an attribute of the given qualified name and namespace URI.
Per [XML Namespaces] , applications must use the valuenullas thenamespaceURIparameter for methods if they wish to have no namespace.- Specified by:
createAttributeNSin interfaceorg.w3c.dom.Document
getElementsByTagNameNS
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
- Description copied from interface:
org.w3c.dom.Document - Returns a
NodeListof all theElementswith a given local name and namespace URI in document order.- Specified by:
getElementsByTagNameNSin interfaceorg.w3c.dom.Document
getElementById
public org.w3c.dom.Element getElementById(java.lang.String elementId)
- Description copied from interface:
org.w3c.dom.Document - Returns the
Elementthat has an ID attribute with the given value. If no such element exists, this returnsnull. If more than one element has an ID attribute with that value, what is returned is undefined.
The DOM implementation is expected to use the attributeAttr.isIdto determine if an attribute is of type ID.Note: Attributes with the name "ID" or "id" are not of type ID unless so defined.
- Specified by:
getElementByIdin interfaceorg.w3c.dom.Document
getEncoding
public java.lang.String getEncoding()
setEncoding
public void setEncoding(java.lang.String s)
getStandalone
public boolean getStandalone()
setStandalone
public void setStandalone(boolean flag)
getStrictErrorChecking
public boolean getStrictErrorChecking()
- Description copied from interface:
org.w3c.dom.Document - An attribute specifying whether error checking is enforced or not. When
set to
false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMExceptionon DOM operations or report errors while usingDocument.normalizeDocument(). In case of error, the behavior is undefined. This attribute istrueby default.- Specified by:
getStrictErrorCheckingin interfaceorg.w3c.dom.Document
setStrictErrorChecking
public void setStrictErrorChecking(boolean flag)
- Description copied from interface:
org.w3c.dom.Document - An attribute specifying whether error checking is enforced or not. When
set to
false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMExceptionon DOM operations or report errors while usingDocument.normalizeDocument(). In case of error, the behavior is undefined. This attribute istrueby default.- Specified by:
setStrictErrorCheckingin interfaceorg.w3c.dom.Document
getVersion
public java.lang.String getVersion()
setVersion
public void setVersion(java.lang.String s)
adoptNode
public org.w3c.dom.Node adoptNode(org.w3c.dom.Node node) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Document - Attempts to adopt a node from another document to this document. If
supported, it changes the
ownerDocumentof the source node, its children, as well as the attached attribute nodes if there are any. If the source node has a parent it is first removed from the child list of its parent. This effectively allows moving a subtree from one document to another (unlikeimportNode()which create a copy of the source node instead of moving it). When it fails, applications should useDocument.importNode()instead. Note that if the adopted node is already part of this document (i.e. the source and target document are the same), this method still has the effect of removing the source node from the child list of its parent, if any. The following list describes the specifics for each type of node.- ATTRIBUTE_NODE
- The
ownerElementattribute is set tonulland thespecifiedflag is set totrueon the adoptedAttr. The descendants of the sourceAttrare recursively adopted. - DOCUMENT_FRAGMENT_NODE
- The descendants of the source node are recursively adopted.
- DOCUMENT_NODE
-
Documentnodes cannot be adopted. - DOCUMENT_TYPE_NODE
-
DocumentTypenodes cannot be adopted. - ELEMENT_NODE
- Specified attribute nodes of the source element are adopted. Default attributes are discarded, though if the document being adopted into defines default attributes for this element name, those are assigned. The descendants of the source element are recursively adopted.
- ENTITY_NODE
-
Entitynodes cannot be adopted. - ENTITY_REFERENCE_NODE
- Only
the
EntityReferencenode itself is adopted, the descendants are discarded, since the source and destination documents might have defined the entity differently. If the document being imported into provides a definition for this entity name, its value is assigned. - NOTATION_NODE
Notationnodes cannot be adopted.- PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE
- These nodes can all be adopted. No specifics.
Note: Since it does not create new nodes unlike the
Document.importNode()method, this method does not raise anINVALID_CHARACTER_ERRexception, and applications should use theDocument.normalizeDocument()method to check if an imported name is not an XML name according to the XML version in use.- Specified by:
adoptNodein interfaceorg.w3c.dom.Document
getNodeName
public java.lang.String getNodeName()
- Node Implementation
- Specified by:
getNodeNamein interfaceorg.w3c.dom.Node
getNodeValue
public java.lang.String getNodeValue() throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The value of this node, depending on its type; see the table above.
When it is defined to be
null, setting it has no effect, including if the node is read-only.- Specified by:
getNodeValuein interfaceorg.w3c.dom.Node
setNodeValue
public void setNodeValue(java.lang.String nodeValue) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The value of this node, depending on its type; see the table above.
When it is defined to be
null, setting it has no effect, including if the node is read-only.- Specified by:
setNodeValuein interfaceorg.w3c.dom.Node
getNodeType
public short getNodeType()
- Description copied from interface:
org.w3c.dom.Node - A code representing the type of the underlying object, as defined above.
- Specified by:
getNodeTypein interfaceorg.w3c.dom.Node
getParentNode
public org.w3c.dom.Node getParentNode()
- Description copied from interface:
org.w3c.dom.Node - The parent of this node. All nodes, except
Attr,Document,DocumentFragment,Entity, andNotationmay have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this isnull.- Specified by:
getParentNodein interfaceorg.w3c.dom.Node
getChildNodes
public org.w3c.dom.NodeList getChildNodes()
- Description copied from interface:
org.w3c.dom.Node - A
NodeListthat contains all children of this node. If there are no children, this is aNodeListcontaining no nodes.- Specified by:
getChildNodesin interfaceorg.w3c.dom.Node
getFirstChild
public org.w3c.dom.Node getFirstChild()
- Description copied from interface:
org.w3c.dom.Node - The first child of this node. If there is no such node, this returns
null.- Specified by:
getFirstChildin interfaceorg.w3c.dom.Node
getLastChild
public org.w3c.dom.Node getLastChild()
- Description copied from interface:
org.w3c.dom.Node - The last child of this node. If there is no such node, this returns
null.- Specified by:
getLastChildin interfaceorg.w3c.dom.Node
getPreviousSibling
public org.w3c.dom.Node getPreviousSibling()
- Description copied from interface:
org.w3c.dom.Node - The node immediately preceding this node. If there is no such node,
this returns
null.- Specified by:
getPreviousSiblingin interfaceorg.w3c.dom.Node
getNextSibling
public org.w3c.dom.Node getNextSibling()
- Description copied from interface:
org.w3c.dom.Node - The node immediately following this node. If there is no such node,
this returns
null.- Specified by:
getNextSiblingin interfaceorg.w3c.dom.Node
getAttributes
public org.w3c.dom.NamedNodeMap getAttributes()
- Description copied from interface:
org.w3c.dom.Node - A
NamedNodeMapcontaining the attributes of this node (if it is anElement) ornullotherwise.- Specified by:
getAttributesin interfaceorg.w3c.dom.Node
getOwnerDocument
public org.w3c.dom.Document getOwnerDocument()
- Description copied from interface:
org.w3c.dom.Node - The
Documentobject associated with this node. This is also theDocumentobject used to create new nodes. When this node is aDocumentor aDocumentTypewhich is not used with anyDocumentyet, this isnull.- Specified by:
getOwnerDocumentin interfaceorg.w3c.dom.Node
insertBefore
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Inserts the node
newChildbefore the existing child noderefChild. IfrefChildisnull, insertnewChildat the end of the list of children.
IfnewChildis aDocumentFragmentobject, all of its children are inserted, in the same order, beforerefChild. If thenewChildis already in the tree, it is first removed.Note: Inserting a node before itself is implementation dependent.
- Specified by:
insertBeforein interfaceorg.w3c.dom.Node
replaceChild
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Replaces the child node
oldChildwithnewChildin the list of children, and returns theoldChildnode.
IfnewChildis aDocumentFragmentobject,oldChildis replaced by all of theDocumentFragmentchildren, which are inserted in the same order. If thenewChildis already in the tree, it is first removed.Note: Replacing a node with itself is implementation dependent.
- Specified by:
replaceChildin interfaceorg.w3c.dom.Node
removeChild
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Removes the child node indicated by
oldChildfrom the list of children, and returns it.- Specified by:
removeChildin interfaceorg.w3c.dom.Node
appendChild
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - Adds the node
newChildto the end of the list of children of this node. If thenewChildis already in the tree, it is first removed.- Specified by:
appendChildin interfaceorg.w3c.dom.Node
hasChildNodes
public boolean hasChildNodes()
- Description copied from interface:
org.w3c.dom.Node - Returns whether this node has any children.
- Specified by:
hasChildNodesin interfaceorg.w3c.dom.Node
cloneNode
public org.w3c.dom.Node cloneNode(boolean deep)
- Description copied from interface:
org.w3c.dom.Node - Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes. The duplicate node has no parent (
parentNodeisnull) and no user data. User data associated to the imported node is not carried over. However, if anyUserDataHandlershas been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
Cloning anElementcopies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any children it contains unless it is a deep clone. This includes text contained in an theElementsince the text is contained in a childTextnode. Cloning anAttrdirectly, as opposed to be cloned as part of anElementcloning operation, returns a specified attribute (specifiedistrue). Cloning anAttralways clones its children, since they represent its value, no matter whether this is a deep clone or not. Cloning anEntityReferenceautomatically constructs its subtree if a correspondingEntityis available, no matter whether this is a deep clone or not. Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of anEntityReferenceclone are readonly . In addition, clones of unspecifiedAttrnodes are specified. And, cloningDocument,DocumentType,Entity, andNotationnodes is implementation dependent.- Specified by:
cloneNodein interfaceorg.w3c.dom.Node
normalize
public void normalize()
- Description copied from interface:
org.w3c.dom.Node - Puts all
Textnodes in the full depth of the sub-tree underneath thisNode, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separatesTextnodes, i.e., there are neither adjacentTextnodes nor emptyTextnodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer [XPointer] lookups) that depend on a particular document tree structure are to be used. If the parameter "normalize-characters" of theDOMConfigurationobject attached to theNode.ownerDocumentistrue, this method will also fully normalize the characters of theTextnodes.Note: In cases where the document contains
CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate betweenTextnodes andCDATASectionnodes.- Specified by:
normalizein interfaceorg.w3c.dom.Node
isSupported
public boolean isSupported(java.lang.String feature, java.lang.String version)
- Description copied from interface:
org.w3c.dom.Node - Tests whether the DOM implementation implements a specific feature and
that feature is supported by this node, as specified in .
- Specified by:
isSupportedin interfaceorg.w3c.dom.Node
getNamespaceURI
public java.lang.String getNamespaceURI()
- Description copied from interface:
org.w3c.dom.Node - The namespace URI of this node, or
nullif it is unspecified (see ).
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such asDocument.createElement(), this is alwaysnull.Note: Per the Namespaces in XML Specification [XML Namespaces] an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.
- Specified by:
getNamespaceURIin interfaceorg.w3c.dom.Node
getPrefix
public java.lang.String getPrefix()
- Description copied from interface:
org.w3c.dom.Node - The namespace prefix of this node, or
nullif it is unspecified. When it is defined to benull, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes thenodeNameattribute, which holds the qualified name, as well as thetagNameandnameattributes of theElementandAttrinterfaces, when applicable.
Setting the prefix tonullmakes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since thenamespaceURIandlocalNamedo not change.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such ascreateElementfrom theDocumentinterface, this is alwaysnull.- Specified by:
getPrefixin interfaceorg.w3c.dom.Node
setPrefix
public void setPrefix(java.lang.String prefix) throws org.w3c.dom.DOMException
- Description copied from interface:
org.w3c.dom.Node - The namespace prefix of this node, or
nullif it is unspecified. When it is defined to benull, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes thenodeNameattribute, which holds the qualified name, as well as thetagNameandnameattributes of theElementandAttrinterfaces, when applicable.
Setting the prefix tonullmakes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since thenamespaceURIandlocalNamedo not change.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such ascreateElementfrom theDocumentinterface, this is alwaysnull.- Specified by:
setPrefixin interfaceorg.w3c.dom.Node
getLocalName
public java.lang.String getLocalName()
- Description copied from interface:
org.w3c.dom.Node - Returns the local part of the qualified name of this node.
For nodes of any type other thanELEMENT_NODEandATTRIBUTE_NODEand nodes created with a DOM Level 1 method, such asDocument.createElement(), this is alwaysnull.- Specified by:
getLocalNamein interfaceorg.w3c.dom.Node
hasAttributes
public boolean hasAttributes()
- Description copied from interface:
org.w3c.dom.Node - Returns whether this node (if it is an element) has any attributes.
- Specified by:
hasAttributesin interfaceorg.w3c.dom.Node
isBodyStream
public boolean isBodyStream()
|
|||||||||
| Home >> All >> org >> apache >> [ axis overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC