You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by di...@apache.org on 2006/04/04 11:33:39 UTC
svn commit: r391260 [1/7] - in /webservices/commons/trunk/modules/axiom:
src/org/apache/axiom/om/ src/org/apache/axiom/om/impl/
src/org/apache/axiom/om/impl/dom/ src/org/apache/axiom/om/impl/llom/
src/org/apache/axiom/om/impl/serialize/ src/org/apache/...
Author: dims
Date: Tue Apr 4 02:33:33 2006
New Revision: 391260
URL: http://svn.apache.org/viewcvs?rev=391260&view=rev
Log:
marking all the methods with OMOutputImpl parameters with internal prefix explicitly (next step is to try removing them...)
Modified:
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMElement.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMSerializer.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/OMNodeEx.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/AttrImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/CommentImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentFragmentimpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/ElementImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/NodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/TextImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMCommentImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMElementImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMNodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMProcessingInstructionImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMTextImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/serialize/StreamingOMSerializer.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultCodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultDetailImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultNodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultReasonImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPFaultRoleImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultCodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultDetailImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultReasonImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap11/SOAP11FaultRoleImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/dom/soap12/SOAP12FaultImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPFaultDetailImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPFaultImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPFaultNodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPFaultReasonImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPFaultRoleImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java
webservices/commons/trunk/modules/axiom/src/org/apache/axiom/soap/impl/llom/soap12/SOAP12FaultImpl.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/OMBlankElementTest.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/OMBodyTest.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/impl/llom/OMDocumentSerilizationTest.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java
webservices/commons/trunk/modules/axiom/test/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilderTest.java
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMElement.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMElement.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMElement.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMElement.java Tue Apr 4 02:33:33 2006
@@ -1,327 +1,327 @@
-/*
- * 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.axiom.om;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.util.Iterator;
-
-/**
- * A particular kind of node that represents an element infoset information item.
- * <p/>
- * <p>An element has a collection of children, attributes, and namespaces.</p>
- * <p>In contrast with DOM, this interface exposes namespaces separately from the
- * attributes.</p>
- */
-public interface OMElement extends OMNode, OMContainer {
-
- /**
- * Returns a filtered list of children - just the elements.
- *
- * @return Returns an iterator over the child elements.
- * @see #getChildren()
- * @see #getChildrenWithName(javax.xml.namespace.QName)
- */
- public Iterator getChildElements();
-
- /**
- * Creates a namespace in the current element scope.
- *
- * @param uri The namespace to declare in the current scope. The
- * caller is expected to ensure that the URI is a valid namespace name.
- * @param prefix The prefix to associate with the given namespace.
- * The caller is expected to ensure that this is a valid XML prefix.
- * If null is given, first this will check for an existing namespace
- * with the same uri. If not found, a prefix will be auto-generated.
- * @return Returns the created namespace information item.
- * @see #declareNamespace(OMNamespace)
- * @see #findNamespace(String, String)
- * @see #getAllDeclaredNamespaces()
- */
- public OMNamespace declareNamespace(String uri, String prefix);
-
-
- /**
- * This will declare a default namespace for this element explicitly
- * @param uri
- * @return
- */
- public OMNamespace declareDefaultNamespace(String uri);
-
- /**
- * This will retrieve the default namespace of this element, if available. null returned if none
- * is found.
- * @return
- */
- public OMNamespace getDefaultNamespace();
-
- /**
- * Declares a namespace with the element as its scope.
- *
- * @param namespace The namespace to declare.
- * @return Returns the namespace parameter passed.
- * @see #declareNamespace(String, String)
- * @see #findNamespace(String, String)
- * @see #getAllDeclaredNamespaces()
- */
- public OMNamespace declareNamespace(OMNamespace namespace);
-
- /**
- * Finds a namespace with the given uri and prefix, in the scope of the hierarchy.
- * <p/>
- * <p>Searches from the current element and goes up the hiararchy until a match is found.
- * If no match is found, returns <tt>null</tt>.</p>
- * <p/>
- * <p>Either <tt>prefix</tt> or <tt>uri</tt> should be null. Results are undefined
- * if both are specified.</p>
- *
- * @param uri The namespace to look for. If this is specified, <tt>prefix</tt> should be null.
- * @param prefix The prefix to look for. If this is specified, <tt>uri</tt> should be null.
- * @return Returns the matching namespace declaration, or <tt>null</tt> if none was found.
- * @see #declareNamespace(String, String)
- * @see #declareNamespace(OMNamespace)
- * @see #getAllDeclaredNamespaces()
- */
- public OMNamespace findNamespace(String uri, String prefix);
-
- /**
- * Checks for a namespace in the context of this element with the given prefix and
- * returns the relevant namespace object, if available. If not available, returns null.
- *
- * @param prefix
- */
- public OMNamespace findNamespaceURI(String prefix);
-
- /**
- * Returns an iterator for all of the namespaces declared on this element.
- * <p/>
- * <p>If you're interested in all namespaces in scope, you need to call this function
- * for all parent elements as well. Note that the iterator may be invalidated by
- * any call to either <tt>declareNamespace</tt> function.
- * </p>
- *
- * @return Returns an iterator over the {@link OMNamespace} items declared on the current element.
- * @see #findNamespace(String, String)
- * @see #declareNamespace(String, String)
- * @see #declareNamespace(OMNamespace)
- */
- public Iterator getAllDeclaredNamespaces() throws OMException;
-
- /**
- * Returns a list of OMAttributes.
- *
- * <p>Note that the iterator returned by this function will be invalidated by
- * any <tt>addAttribute</tt> call.
- * </p>
- *
- * @return Returns an {@link Iterator} of {@link OMAttribute} items associated with the element.
- * @see #getAttribute
- * @see #addAttribute(OMAttribute)
- * @see #addAttribute(String, String, OMNamespace)
- */
- public Iterator getAllAttributes();
-
- /**
- * Returns a named attribute if present.
- *
- * @param qname the qualified name to search for
- * @return Returns an OMAttribute with the given name if found, or null
- */
- public OMAttribute getAttribute(QName qname);
-
- /**
- * Returns a named attribute's value, if present.
- *
- * @param qname the qualified name to search for
- * @return Returns a String containing the attribute value, or null
- */
- public String getAttributeValue(QName qname);
-
- /**
- * Adds an attribute to this element.
- * <p/>
- * <p>There is no order implied by added attributes.</p>
- *
- * @param attr The attribute to add.
- * @return Returns the passed in attribute.
- */
- public OMAttribute addAttribute(OMAttribute attr);
-
- /**
- * Adds an attribute to the current element.
- * <p/>
- * <p>This function does not check to make sure that the given attribute value can be serialized directly
- * as an XML value. The caller may, for example, pass a string with the character 0x01.
- *
- * @param attributeName The "local name" for the attribute.
- * @param value The string value of the attribute.
- * @param ns The namespace has to be one of the in scope namespace. i.e. the passed namespace
- * must be declared in the parent element of this attribute or ancestors of the parent element of the attribute.
- * @return Returns the added attribute.
- */
- public OMAttribute addAttribute(String attributeName, String value,
- OMNamespace ns);
-
- /**
- * Method removeAttribute
- *
- * @param attr
- */
- public void removeAttribute(OMAttribute attr);
-
- /**
- * Method setBuilder.
- *
- * @param wrapper
- */
- public void setBuilder(OMXMLParserWrapper wrapper);
-
- /**
- * Returns the builder object.
- *
- * @return Returns the builder object used to construct the underlying XML infoset on the fly.
- */
- public OMXMLParserWrapper getBuilder();
-
- /**
- * Sets the first child.
- *
- * @param node
- */
- public void setFirstChild(OMNode node);
-
- /**
- * Returns the first child element of the element.
- *
- * @return Returns the first child element of the element, or <tt>null</tt> if none was found.
- */
-
- public OMElement getFirstElement();
-
-
- /**
- * Returns the pull parser that will generate the pull
- * events relevant to THIS element.
- * <p/>
- * <p>Caching is on.</p>
- *
- * @return Returns an XMLStreamReader relative to this element.
- */
- public XMLStreamReader getXMLStreamReader();
-
- /**
- * Returns the pull parser that will generate the pull
- * events relevant to THIS element.
- * <p/>
- * <p>Caching is off.</p>
- *
- * @return Returns an XMLStreamReader relative to this element, with no caching.
- */
- public XMLStreamReader getXMLStreamReaderWithoutCaching();
-
- /**
- * @param text
- */
- public void setText(String text);
- public void setText(QName text);
-
- /**
- * Returns the non-empty text children as a String.
- *
- * @return Returns a String representing the concatenation of the child text nodes.
- */
- public String getText();
- public QName getTextAsQName();
-
- /**
- * Returns the local name of the element.
- *
- * @return Returns the local name of the element.
- */
- public String getLocalName();
-
- /**
- * Method setLocalName
- *
- * @param localName
- */
- public void setLocalName(String localName);
-
- /**
- * @return Returns the OMNamespace object associated with this element
- * @throws OMException
- */
- public OMNamespace getNamespace() throws OMException;
-
- /**
- * Sets the Namespace. This will first search for a namespace in the current scope with the given
- * namespace. If no namespace is found with the given details, then it will declare a new one. Then
- * that namespace will be assigned to this element.
- *
- * @param namespace
- */
- public void setNamespace(OMNamespace namespace);
-
- /**
- * This will not search the namespace in the scope nor will declare in the current element, as
- * in setNamespace(OMNamespace). This will just assign the given namespace to the element.
- * @param namespace
- */
- public void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace);
-
-
- /**
- * Gets the QName of this node.
- *
- * @return Returns the {@link QName} for the element.
- */
- public QName getQName();
-
- /**
- * This is a convenience method only. This will basically serialize the given OMElement
- * to a String but will build the OMTree in the memory
- */
- public String toString();
-
- /**
- * This is a convenience method only. This basically serializes the given OMElement
- * to a String but will NOT build the OMTree in the memory. So you are at your own risk of
- * losing information.
- */
- public String toStringWithConsume() throws XMLStreamException;
-
-
- /**
- * Turns a prefix:local qname string into a proper QName, evaluating it in the OMElement context.
- * Unprefixed qnames resolve to the local namespace.
- *
- * @param qname prefixed qname string to resolve
- * @return Returns null for any failure to extract a qname.
- */
- QName resolveQName(String qname);
-
- /**
- * Clones this element. Since both elements are build compleletely, you will
- * lose the differed building capability.
- * @return Returns OMElement.
- */
- public OMElement cloneOMElement();
-
- public void setLineNumber(int lineNumber);
- public int getLineNumber();
-}
+/*
+ * 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.axiom.om;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.util.Iterator;
+
+/**
+ * A particular kind of node that represents an element infoset information item.
+ * <p/>
+ * <p>An element has a collection of children, attributes, and namespaces.</p>
+ * <p>In contrast with DOM, this interface exposes namespaces separately from the
+ * attributes.</p>
+ */
+public interface OMElement extends OMNode, OMContainer {
+
+ /**
+ * Returns a filtered list of children - just the elements.
+ *
+ * @return Returns an iterator over the child elements.
+ * @see #getChildren()
+ * @see #getChildrenWithName(javax.xml.namespace.QName)
+ */
+ public Iterator getChildElements();
+
+ /**
+ * Creates a namespace in the current element scope.
+ *
+ * @param uri The namespace to declare in the current scope. The
+ * caller is expected to ensure that the URI is a valid namespace name.
+ * @param prefix The prefix to associate with the given namespace.
+ * The caller is expected to ensure that this is a valid XML prefix.
+ * If null is given, first this will check for an existing namespace
+ * with the same uri. If not found, a prefix will be auto-generated.
+ * @return Returns the created namespace information item.
+ * @see #declareNamespace(OMNamespace)
+ * @see #findNamespace(String, String)
+ * @see #getAllDeclaredNamespaces()
+ */
+ public OMNamespace declareNamespace(String uri, String prefix);
+
+
+ /**
+ * This will declare a default namespace for this element explicitly
+ * @param uri
+ * @return
+ */
+ public OMNamespace declareDefaultNamespace(String uri);
+
+ /**
+ * This will retrieve the default namespace of this element, if available. null returned if none
+ * is found.
+ * @return
+ */
+ public OMNamespace getDefaultNamespace();
+
+ /**
+ * Declares a namespace with the element as its scope.
+ *
+ * @param namespace The namespace to declare.
+ * @return Returns the namespace parameter passed.
+ * @see #declareNamespace(String, String)
+ * @see #findNamespace(String, String)
+ * @see #getAllDeclaredNamespaces()
+ */
+ public OMNamespace declareNamespace(OMNamespace namespace);
+
+ /**
+ * Finds a namespace with the given uri and prefix, in the scope of the hierarchy.
+ * <p/>
+ * <p>Searches from the current element and goes up the hiararchy until a match is found.
+ * If no match is found, returns <tt>null</tt>.</p>
+ * <p/>
+ * <p>Either <tt>prefix</tt> or <tt>uri</tt> should be null. Results are undefined
+ * if both are specified.</p>
+ *
+ * @param uri The namespace to look for. If this is specified, <tt>prefix</tt> should be null.
+ * @param prefix The prefix to look for. If this is specified, <tt>uri</tt> should be null.
+ * @return Returns the matching namespace declaration, or <tt>null</tt> if none was found.
+ * @see #declareNamespace(String, String)
+ * @see #declareNamespace(OMNamespace)
+ * @see #getAllDeclaredNamespaces()
+ */
+ public OMNamespace findNamespace(String uri, String prefix);
+
+ /**
+ * Checks for a namespace in the context of this element with the given prefix and
+ * returns the relevant namespace object, if available. If not available, returns null.
+ *
+ * @param prefix
+ */
+ public OMNamespace findNamespaceURI(String prefix);
+
+ /**
+ * Returns an iterator for all of the namespaces declared on this element.
+ * <p/>
+ * <p>If you're interested in all namespaces in scope, you need to call this function
+ * for all parent elements as well. Note that the iterator may be invalidated by
+ * any call to either <tt>declareNamespace</tt> function.
+ * </p>
+ *
+ * @return Returns an iterator over the {@link OMNamespace} items declared on the current element.
+ * @see #findNamespace(String, String)
+ * @see #declareNamespace(String, String)
+ * @see #declareNamespace(OMNamespace)
+ */
+ public Iterator getAllDeclaredNamespaces() throws OMException;
+
+ /**
+ * Returns a list of OMAttributes.
+ *
+ * <p>Note that the iterator returned by this function will be invalidated by
+ * any <tt>addAttribute</tt> call.
+ * </p>
+ *
+ * @return Returns an {@link Iterator} of {@link OMAttribute} items associated with the element.
+ * @see #getAttribute
+ * @see #addAttribute(OMAttribute)
+ * @see #addAttribute(String, String, OMNamespace)
+ */
+ public Iterator getAllAttributes();
+
+ /**
+ * Returns a named attribute if present.
+ *
+ * @param qname the qualified name to search for
+ * @return Returns an OMAttribute with the given name if found, or null
+ */
+ public OMAttribute getAttribute(QName qname);
+
+ /**
+ * Returns a named attribute's value, if present.
+ *
+ * @param qname the qualified name to search for
+ * @return Returns a String containing the attribute value, or null
+ */
+ public String getAttributeValue(QName qname);
+
+ /**
+ * Adds an attribute to this element.
+ * <p/>
+ * <p>There is no order implied by added attributes.</p>
+ *
+ * @param attr The attribute to add.
+ * @return Returns the passed in attribute.
+ */
+ public OMAttribute addAttribute(OMAttribute attr);
+
+ /**
+ * Adds an attribute to the current element.
+ * <p/>
+ * <p>This function does not check to make sure that the given attribute value can be serialized directly
+ * as an XML value. The caller may, for example, pass a string with the character 0x01.
+ *
+ * @param attributeName The "local name" for the attribute.
+ * @param value The string value of the attribute.
+ * @param ns The namespace has to be one of the in scope namespace. i.e. the passed namespace
+ * must be declared in the parent element of this attribute or ancestors of the parent element of the attribute.
+ * @return Returns the added attribute.
+ */
+ public OMAttribute addAttribute(String attributeName, String value,
+ OMNamespace ns);
+
+ /**
+ * Method removeAttribute
+ *
+ * @param attr
+ */
+ public void removeAttribute(OMAttribute attr);
+
+ /**
+ * Method setBuilder.
+ *
+ * @param wrapper
+ */
+ public void setBuilder(OMXMLParserWrapper wrapper);
+
+ /**
+ * Returns the builder object.
+ *
+ * @return Returns the builder object used to construct the underlying XML infoset on the fly.
+ */
+ public OMXMLParserWrapper getBuilder();
+
+ /**
+ * Sets the first child.
+ *
+ * @param node
+ */
+ public void setFirstChild(OMNode node);
+
+ /**
+ * Returns the first child element of the element.
+ *
+ * @return Returns the first child element of the element, or <tt>null</tt> if none was found.
+ */
+
+ public OMElement getFirstElement();
+
+
+ /**
+ * Returns the pull parser that will generate the pull
+ * events relevant to THIS element.
+ * <p/>
+ * <p>Caching is on.</p>
+ *
+ * @return Returns an XMLStreamReader relative to this element.
+ */
+ public XMLStreamReader getXMLStreamReader();
+
+ /**
+ * Returns the pull parser that will generate the pull
+ * events relevant to THIS element.
+ * <p/>
+ * <p>Caching is off.</p>
+ *
+ * @return Returns an XMLStreamReader relative to this element, with no caching.
+ */
+ public XMLStreamReader getXMLStreamReaderWithoutCaching();
+
+ /**
+ * @param text
+ */
+ public void setText(String text);
+ public void setText(QName text);
+
+ /**
+ * Returns the non-empty text children as a String.
+ *
+ * @return Returns a String representing the concatenation of the child text nodes.
+ */
+ public String getText();
+ public QName getTextAsQName();
+
+ /**
+ * Returns the local name of the element.
+ *
+ * @return Returns the local name of the element.
+ */
+ public String getLocalName();
+
+ /**
+ * Method setLocalName
+ *
+ * @param localName
+ */
+ public void setLocalName(String localName);
+
+ /**
+ * @return Returns the OMNamespace object associated with this element
+ * @throws OMException
+ */
+ public OMNamespace getNamespace() throws OMException;
+
+ /**
+ * Sets the Namespace. This will first search for a namespace in the current scope with the given
+ * namespace. If no namespace is found with the given details, then it will declare a new one. Then
+ * that namespace will be assigned to this element.
+ *
+ * @param namespace
+ */
+ public void setNamespace(OMNamespace namespace);
+
+ /**
+ * This will not search the namespace in the scope nor will declare in the current element, as
+ * in setNamespace(OMNamespace). This will just assign the given namespace to the element.
+ * @param namespace
+ */
+ public void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace);
+
+
+ /**
+ * Gets the QName of this node.
+ *
+ * @return Returns the {@link QName} for the element.
+ */
+ public QName getQName();
+
+ /**
+ * This is a convenience method only. This will basically serialize the given OMElement
+ * to a String but will build the OMTree in the memory
+ */
+ public String toString();
+
+ /**
+ * This is a convenience method only. This basically serializes the given OMElement
+ * to a String but will NOT build the OMTree in the memory. So you are at your own risk of
+ * losing information.
+ */
+ public String toStringWithConsume() throws XMLStreamException;
+
+
+ /**
+ * Turns a prefix:local qname string into a proper QName, evaluating it in the OMElement context.
+ * Unprefixed qnames resolve to the local namespace.
+ *
+ * @param qname prefixed qname string to resolve
+ * @return Returns null for any failure to extract a qname.
+ */
+ QName resolveQName(String qname);
+
+ /**
+ * Clones this element. Since both elements are build compleletely, you will
+ * lose the differed building capability.
+ * @return Returns OMElement.
+ */
+ public OMElement cloneOMElement();
+
+ public void setLineNumber(int lineNumber);
+ public int getLineNumber();
+}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMSerializer.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMSerializer.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMSerializer.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/OMSerializer.java Tue Apr 4 02:33:33 2006
@@ -1,36 +1,36 @@
-/*
- * 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.axiom.om;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- * Interface OMSerializer
- */
-public interface OMSerializer {
- /**
- * Method serializeAndConsume
- *
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- void serialize(XMLStreamReader reader, XMLStreamWriter writer)
- throws XMLStreamException;
-}
+/*
+ * 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.axiom.om;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * Interface OMSerializer
+ */
+public interface OMSerializer {
+ /**
+ * Method serialize
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ void serialize(XMLStreamReader reader, XMLStreamWriter writer)
+ throws XMLStreamException;
+}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/OMNodeEx.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/OMNodeEx.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/OMNodeEx.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/OMNodeEx.java Tue Apr 4 02:33:33 2006
@@ -21,6 +21,7 @@
import org.apache.axiom.om.OMNode;
import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
/**
* Interface OMNodeEx
@@ -44,9 +45,8 @@
*
* @param omOutput
* @throws javax.xml.stream.XMLStreamException
- * @see #serialize(org.apache.axiom.om.impl.OMOutputImpl)
*/
- public void serialize(org.apache.axiom.om.impl.OMOutputImpl omOutput)
+ public void internalSerialize(OMOutputImpl omOutput)
throws XMLStreamException;
/**
@@ -55,5 +55,5 @@
* @param omOutput
* @throws XMLStreamException
*/
- public void serializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException;
+ public void internalSerializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException;
}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/AttrImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/AttrImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/AttrImpl.java Tue Apr 4 02:33:33 2006
@@ -196,11 +196,8 @@
/**
* This is not supported since attributes serialization is handled by the
* serialization of the owner nodes.
- *
- * @see org.apache.axiom.om.impl.OMNodeEx#serialize
- * (org.apache.axiom.om.impl.OMOutputImpl)
*/
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
throw new UnsupportedOperationException("Not supported");
}
@@ -208,10 +205,10 @@
* This is not supported since attributes serialization is handled by the
* serialization of the owner nodes.
*
- * @see org.apache.axiom.om.impl.OMNodeEx#serializeAndConsume
+ * @see org.apache.axiom.om.impl.OMNodeEx#internalSerializeAndConsume
* (org.apache.axiom.om.impl.OMOutputImpl)
*/
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
throw new UnsupportedOperationException("Not supported");
}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/CommentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/CommentImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/CommentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/CommentImpl.java Tue Apr 4 02:33:33 2006
@@ -64,14 +64,14 @@
"You should not set the node type of a comment");
}
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
XMLStreamWriter writer = omOutput.getXmlStreamWriter();
writer.writeComment(this.textValue.toString());
}
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
- serialize(omOutput);
+ internalSerialize(omOutput);
}
}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentFragmentimpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentFragmentimpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentFragmentimpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentFragmentimpl.java Tue Apr 4 02:33:33 2006
@@ -70,23 +70,7 @@
// DO Nothing :-?
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axiom.om.OMNode#serializeWithCache(org.apache.axiom.om.OMOutput)
- */
- public void serializeWithCache(OMOutputImpl omOutput)
- throws XMLStreamException {
- // TODO
- throw new UnsupportedOperationException("TODO");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axiom.om.OMNode#serialize(org.apache.axiom.om.OMOutput)
- */
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
// TODO
throw new UnsupportedOperationException("TODO");
}
@@ -96,7 +80,7 @@
throw new UnsupportedOperationException("TODO");
}
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
// TODO
throw new UnsupportedOperationException("TODO");
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/DocumentImpl.java Tue Apr 4 02:33:33 2006
@@ -90,7 +90,7 @@
"In OM Document object doesn't have a type");
}
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
// TODO Auto-generated method stub
}
@@ -339,7 +339,7 @@
throw new UnsupportedOperationException("TODO");
}
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
// TODO
throw new UnsupportedOperationException("TODO");
@@ -363,18 +363,6 @@
}
public String isStandalone() {
- // TODO
- throw new UnsupportedOperationException("TODO");
- }
-
- public void serialize(OMOutputImpl omOutput, boolean includeXMLDeclaration)
- throws XMLStreamException {
- // TODO
- throw new UnsupportedOperationException("TODO");
- }
-
- public void serializeAndConsume(OMOutputImpl omOutput,
- boolean includeXMLDeclaration) throws XMLStreamException {
// TODO
throw new UnsupportedOperationException("TODO");
}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/ElementImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/ElementImpl.java Tue Apr 4 02:33:33 2006
@@ -1042,22 +1042,17 @@
throw new UnsupportedOperationException();
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axiom.om.OMNode#serialize(org.apache.axiom.om.OMOutput)
- */
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- serialize(omOutput, true);
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
+ internalSerialize(omOutput, true);
}
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
- this.serialize(omOutput, false);
+ this.internalSerialize(omOutput, false);
}
- protected void serialize(org.apache.axiom.om.impl.OMOutputImpl omOutput,
- boolean cache) throws XMLStreamException {
+ protected void internalSerialize(org.apache.axiom.om.impl.OMOutputImpl omOutput,
+ boolean cache) throws XMLStreamException {
XMLStreamWriter writer = omOutput.getXmlStreamWriter();
if (!cache) {
// in this case we don't care whether the elements are built or not
@@ -1066,7 +1061,7 @@
// serilize children
Iterator children = this.getChildren();
while (children.hasNext()) {
- ((OMNodeEx) children.next()).serialize(omOutput);
+ ((OMNodeEx) children.next()).internalSerialize(omOutput);
}
OMSerializerUtil.serializeEndpart(writer);
@@ -1080,7 +1075,7 @@
while (child != null
&& ((!(child instanceof OMElement)) || child
.isComplete())) {
- child.serializeAndConsume(omOutput);
+ child.internalSerializeAndConsume(omOutput);
child = child.nextSibling;
}
if (child != null) {
@@ -1102,7 +1097,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.axiom.om.OMElement#getXMLStreamReaderWithoutCaching()
*/
public XMLStreamReader getXMLStreamReaderWithoutCaching() {
@@ -1111,7 +1106,7 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.apache.axiom.om.OMElement#getXMLStreamReader()
*/
public XMLStreamReader getXMLStreamReader() {
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/NodeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/NodeImpl.java Tue Apr 4 02:33:33 2006
@@ -397,9 +397,9 @@
/**
* There no concept of caching in this OM-DOM implementation.
*/
- public void serializeWithCache(OMOutputImpl omOutput)
+ public void internalSerializeWithCache(OMOutputImpl omOutput)
throws XMLStreamException {
- this.serialize(omOutput);
+ this.internalSerialize(omOutput);
}
/*
@@ -480,14 +480,14 @@
public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
OMOutputImpl omOutput = new OMOutputImpl(xmlWriter);
- serialize(omOutput);
+ internalSerialize(omOutput);
omOutput.flush();
}
public void serializeAndConsume(XMLStreamWriter xmlWriter)
throws XMLStreamException {
OMOutputImpl omOutput = new OMOutputImpl(xmlWriter);
- serializeAndConsume(omOutput);
+ internalSerializeAndConsume(omOutput);
omOutput.flush();
}
@@ -580,7 +580,7 @@
public void serialize(OutputStream output, OMOutputFormat format)
throws XMLStreamException {
OMOutputImpl omOutput = new OMOutputImpl(output, format);
- serialize(omOutput);
+ internalSerialize(omOutput);
omOutput.flush();
}
@@ -589,14 +589,14 @@
OMOutputImpl omOutput = new OMOutputImpl(XMLOutputFactory.newInstance()
.createXMLStreamWriter(writer));
omOutput.setOutputFormat(format);
- serialize(omOutput);
+ internalSerialize(omOutput);
omOutput.flush();
}
public void serializeAndConsume(OutputStream output, OMOutputFormat format)
throws XMLStreamException {
OMOutputImpl omOutput = new OMOutputImpl(output, format);
- serializeAndConsume(omOutput);
+ internalSerializeAndConsume(omOutput);
omOutput.flush();
}
@@ -605,7 +605,7 @@
OMOutputImpl omOutput = new OMOutputImpl(XMLOutputFactory.newInstance()
.createXMLStreamWriter(writer));
omOutput.setOutputFormat(format);
- serializeAndConsume(omOutput);
+ internalSerializeAndConsume(omOutput);
omOutput.flush();
}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/TextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/TextImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/TextImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/dom/TextImpl.java Tue Apr 4 02:33:33 2006
@@ -235,18 +235,13 @@
// Its not clear why we should let someone change the type of a node
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.axiom.om.OMNode#serialize(org.apache.axiom.om.OMOutput)
- */
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- serializeLocal(omOutput);
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
+ internalSerializeLocal(omOutput);
}
- public void serializeAndConsume(OMOutputImpl omOutput)
+ public void internalSerializeAndConsume(OMOutputImpl omOutput)
throws XMLStreamException {
- serializeLocal(omOutput);
+ internalSerializeLocal(omOutput);
}
public boolean isOptimized() {
@@ -268,11 +263,10 @@
/**
* Writes the relevant output.
*
- * @param omOutput
+ * @param writer
* @throws XMLStreamException
*/
- private void writeOutput(OMOutputImpl omOutput) throws XMLStreamException {
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ private void writeOutput(XMLStreamWriter writer) throws XMLStreamException {
int type = getType();
if (type == Node.TEXT_NODE || type == SPACE_NODE) {
writer.writeCharacters(this.getText());
@@ -365,10 +359,11 @@
}
}
- private void serializeLocal(OMOutputImpl omOutput)
+ private void internalSerializeLocal(OMOutputImpl omOutput)
throws XMLStreamException {
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
if (!this.isBinary) {
- writeOutput(omOutput);
+ writeOutput(writer);
} else {
if (omOutput.isOptimized()) {
if (contentID == null) {
@@ -379,11 +374,11 @@
new NamespaceImpl("", "", this.factory),
"cid:" + getContentID(),
this.factory);
- this.serializeStartpart(omOutput);
+ this.serializeStartpart(writer);
omOutput.writeOptimized(this);
- omOutput.getXmlStreamWriter().writeEndElement();
+ writer.writeEndElement();
} else {
- omOutput.getXmlStreamWriter().writeCharacters(this.getText());
+ writer.writeCharacters(this.getText());
}
}
}
@@ -391,12 +386,11 @@
/*
* Methods to copy from OMSerialize utils.
*/
- private void serializeStartpart(OMOutputImpl omOutput)
+ private void serializeStartpart(XMLStreamWriter writer)
throws XMLStreamException {
String nameSpaceName;
String writer_prefix;
String prefix;
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
if (this.ns != null) {
nameSpaceName = this.ns.getName();
writer_prefix = writer.getPrefix(nameSpaceName);
@@ -427,9 +421,9 @@
writer.writeStartElement(this.getLocalName());
}
// add the elements attribute "href"
- serializeAttribute(this.attribute, omOutput);
+ serializeAttribute(this.attribute, writer);
// add the namespace
- serializeNamespace(this.ns, omOutput);
+ serializeNamespace(this.ns, writer);
}
/**
@@ -439,9 +433,8 @@
* @param omOutput
* @throws XMLStreamException
*/
- static void serializeAttribute(OMAttribute attr, OMOutputImpl omOutput)
+ static void serializeAttribute(OMAttribute attr, XMLStreamWriter writer)
throws XMLStreamException {
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
// first check whether the attribute is associated with a namespace
OMNamespace ns = attr.getNamespace();
String prefix;
@@ -468,12 +461,11 @@
* Method serializeNamespace.
*
* @param namespace
- * @param omOutput
+ * @param writer
* @throws XMLStreamException
*/
- static void serializeNamespace(OMNamespace namespace, OMOutputImpl omOutput)
+ static void serializeNamespace(OMNamespace namespace, XMLStreamWriter writer)
throws XMLStreamException {
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
if (namespace != null) {
String uri = namespace.getName();
String ns_prefix = namespace.getPrefix();
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMCommentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMCommentImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMCommentImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMCommentImpl.java Tue Apr 4 02:33:33 2006
@@ -1,109 +1,108 @@
-/*
- * 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.axiom.om.impl.llom;
-
-import org.apache.axiom.om.OMComment;
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.impl.OMOutputImpl;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-public class OMCommentImpl extends OMNodeImpl implements OMComment {
- protected String value;
-
- /**
- * Constructor OMCommentImpl.
- *
- * @param parentNode
- * @param contentText
- */
- public OMCommentImpl(OMContainer parentNode, String contentText,
- OMFactory factory) {
- super(parentNode, factory);
- this.value = contentText;
- nodeType = OMNode.COMMENT_NODE;
- this.done = true;
- }
-
- /**
- * Constructor OMCommentImpl.
- *
- * @param parentNode
- */
- public OMCommentImpl(OMContainer parentNode, OMFactory factory) {
- this(parentNode, null, factory);
- }
-
- /**
- * Serializes the node with caching.
- *
- * @param omOutput
- * @throws XMLStreamException
- * @see #serialize(org.apache.axiom.om.impl.OMOutputImpl)
- */
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
- writer.writeComment(this.value);
- }
-
- /**
- * Serializes the node without caching.
- *
- * @param omOutput
- * @throws XMLStreamException
- * @see #serializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl)
- */
- public void serializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException {
- serialize(omOutput);
- }
-
- /**
- * Gets the value of this comment.
- *
- * @return Returns String.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of this comment.
- *
- * @param text
- */
- public void setValue(String text) {
- this.value = text;
- }
-
- /**
- * Discards this node.
- *
- * @throws OMException
- */
- public void discard() throws OMException {
- if (done) {
- this.detach();
- } else {
- builder.discard((OMElement) this.parent);
- }
- }
-}
+/*
+ * 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.axiom.om.impl.llom;
+
+import org.apache.axiom.om.OMComment;
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.impl.OMOutputImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class OMCommentImpl extends OMNodeImpl implements OMComment {
+ protected String value;
+
+ /**
+ * Constructor OMCommentImpl.
+ *
+ * @param parentNode
+ * @param contentText
+ */
+ public OMCommentImpl(OMContainer parentNode, String contentText,
+ OMFactory factory) {
+ super(parentNode, factory);
+ this.value = contentText;
+ nodeType = OMNode.COMMENT_NODE;
+ this.done = true;
+ }
+
+ /**
+ * Constructor OMCommentImpl.
+ *
+ * @param parentNode
+ */
+ public OMCommentImpl(OMContainer parentNode, OMFactory factory) {
+ this(parentNode, null, factory);
+ }
+
+ /**
+ * Serializes the node with caching.
+ *
+ * @param omOutput
+ * @throws XMLStreamException
+ */
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ writer.writeComment(this.value);
+ }
+
+ /**
+ * Serializes the node without caching.
+ *
+ * @param omOutput
+ * @throws XMLStreamException
+ * @see #internalSerializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl)
+ */
+ public void internalSerializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException {
+ internalSerialize(omOutput);
+ }
+
+ /**
+ * Gets the value of this comment.
+ *
+ * @return Returns String.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of this comment.
+ *
+ * @param text
+ */
+ public void setValue(String text) {
+ this.value = text;
+ }
+
+ /**
+ * Discards this node.
+ *
+ * @throws OMException
+ */
+ public void discard() throws OMException {
+ if (done) {
+ this.detach();
+ } else {
+ builder.discard((OMElement) this.parent);
+ }
+ }
+}
Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java?rev=391260&r1=391259&r2=391260&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java Tue Apr 4 02:33:33 2006
@@ -1,108 +1,107 @@
-/*
- * 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.axiom.om.impl.llom;
-
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMDocType;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.impl.OMOutputImpl;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-public class OMDocTypeImpl extends OMNodeImpl implements OMDocType {
- protected String value;
-
- /**
- * Constructor OMDocTypeImpl.
- *
- * @param parentNode
- * @param contentText
- */
- public OMDocTypeImpl(OMContainer parentNode, String contentText,
- OMFactory factory) {
- super(parentNode, factory);
- this.value = contentText;
- nodeType = OMNode.DTD_NODE;
- }
-
- /**
- * Constructor OMDocTypeImpl.
- *
- * @param parentNode
- */
- public OMDocTypeImpl(OMContainer parentNode, OMFactory factory) {
- this(parentNode, null, factory);
- }
-
- /**
- * Serializes the node with caching.
- *
- * @param omOutput
- * @throws XMLStreamException
- * @see #serialize(org.apache.axiom.om.impl.OMOutputImpl)
- */
- public void serialize(OMOutputImpl omOutput) throws XMLStreamException {
- XMLStreamWriter writer = omOutput.getXmlStreamWriter();
- writer.writeDTD(this.value);
- }
-
- /**
- * Serializes the node without caching.
- *
- * @param omOutput
- * @throws XMLStreamException
- * @see #serializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl)
- */
- public void serializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
- serialize(omOutput);
- }
-
- /**
- * Gets the value of this DocType.
- *
- * @return Returns String.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of this DocType.
- *
- * @param text
- */
- public void setValue(String text) {
- this.value = text;
- }
-
- /**
- * Discards this node.
- *
- * @throws OMException
- */
- public void discard() throws OMException {
- if (done) {
- this.detach();
- } else {
- builder.discard((OMElement) this.parent);
- }
- }
-}
+/*
+ * 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.axiom.om.impl.llom;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDocType;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.impl.OMOutputImpl;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+public class OMDocTypeImpl extends OMNodeImpl implements OMDocType {
+ protected String value;
+
+ /**
+ * Constructor OMDocTypeImpl.
+ *
+ * @param parentNode
+ * @param contentText
+ */
+ public OMDocTypeImpl(OMContainer parentNode, String contentText,
+ OMFactory factory) {
+ super(parentNode, factory);
+ this.value = contentText;
+ nodeType = OMNode.DTD_NODE;
+ }
+
+ /**
+ * Constructor OMDocTypeImpl.
+ *
+ * @param parentNode
+ */
+ public OMDocTypeImpl(OMContainer parentNode, OMFactory factory) {
+ this(parentNode, null, factory);
+ }
+
+ /**
+ * Serializes the node with caching.
+ *
+ * @param omOutput
+ * @throws XMLStreamException
+ */
+ public void internalSerialize(OMOutputImpl omOutput) throws XMLStreamException {
+ XMLStreamWriter writer = omOutput.getXmlStreamWriter();
+ writer.writeDTD(this.value);
+ }
+
+ /**
+ * Serializes the node without caching.
+ *
+ * @param omOutput
+ * @throws XMLStreamException
+ * @see #internalSerializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl)
+ */
+ public void internalSerializeAndConsume(org.apache.axiom.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
+ internalSerialize(omOutput);
+ }
+
+ /**
+ * Gets the value of this DocType.
+ *
+ * @return Returns String.
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of this DocType.
+ *
+ * @param text
+ */
+ public void setValue(String text) {
+ this.value = text;
+ }
+
+ /**
+ * Discards this node.
+ *
+ * @throws OMException
+ */
+ public void discard() throws OMException {
+ if (done) {
+ this.detach();
+ } else {
+ builder.discard((OMElement) this.parent);
+ }
+ }
+}