Author: thilina
Date: Tue Aug 29 05:34:42 2006
New Revision: 438060

URL: http://svn.apache.org/viewvc?rev=438060&view=rev
Log:
addition of new method "buildWithAttachments"to the
OMNode. This addresses the issue
https://issues.apache.org/jira/browse/WSCOMMONS-5


Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
 Tue Aug 29 05:34:42 2006
@@ -24,256 +24,284 @@
 
 /**
  * Defines the base interface used by most of the XML object model within Axis.
- *
- * <p>This tree model for XML captures the idea of deferring the construction 
of child nodes
- * until they are needed.  The <code>isComplete</code> function identifies 
whether or not
- * a particular node has been fully parsed.  A node may not be fully parsed, 
for example, if
- * all of the children of an element have not yet been parsed.</p>
- *
- * <p>In comparison to DOM, in this model, you will not find document 
fragments, or entities.
- * In addition, while [EMAIL PROTECTED] OMDocument} and [EMAIL PROTECTED] 
OMAttribute} exist, neither is an extension
- * of <code>OMNode</code>.
+ * 
+ * <p>
+ * This tree model for XML captures the idea of deferring the construction of
+ * child nodes until they are needed. The <code>isComplete</code> function
+ * identifies whether or not a particular node has been fully parsed. A node 
may
+ * not be fully parsed, for example, if all of the children of an element have
+ * not yet been parsed.
+ * </p>
+ * 
+ * <p>
+ * In comparison to DOM, in this model, you will not find document fragments, 
or
+ * entities. In addition, while [EMAIL PROTECTED] OMDocument} and [EMAIL 
PROTECTED] OMAttribute}
+ * exist, neither is an extension of <code>OMNode</code>.
  * </p>
  */
 public interface OMNode {
-    /**
-     * The node is an <code>Element</code>.
-     *
-     * @see #getType()
-     */
-    public static final short ELEMENT_NODE = 1;
-
-    /**
-     * The node is a <code>Text</code> node.
-     *
-     * @see #getType()
-     */
-    public static final short TEXT_NODE = XMLStreamConstants.CHARACTERS;
-
-    /**
-     * The node is a <code>CDATASection</code>.
-     *
-     * @see #getType()
-     */
-    public static final short CDATA_SECTION_NODE = XMLStreamConstants.CDATA;
-
-    /**
-     * The node is a <code>Comment</code>.
-     *
-     * @see #getType()
-     */
-    public static final short COMMENT_NODE = XMLStreamConstants.COMMENT;
-
-    /**
-     * This node is a <code>DTD</code>.
-     *
-     * @see #getType()
-     */
-    public static final short DTD_NODE = XMLStreamConstants.DTD;
-
-    /**
-     * This node is a <code>ProcessingInstruction</code>.
-     *
-     * @see #getType()
-     */
-    public static final short PI_NODE = 
XMLStreamConstants.PROCESSING_INSTRUCTION;
-
-    /**
-     * This node is an <code>Entity Reference</code>.
-     *
-     * @see #getType()
-     */
-    public static final short ENTITY_REFERENCE_NODE = 
XMLStreamConstants.ENTITY_REFERENCE;
-
-    /**
-     * This node is an <code>Entity Reference</code>.
-     *
-     * @see #getType()
-     */
-    public static final short SPACE_NODE = XMLStreamConstants.SPACE;
-
-    /**
-     * Returns the parent containing node.
-     *
-     * <p>Returns the parent container, which may be either an [EMAIL 
PROTECTED] OMDocument} or [EMAIL PROTECTED] OMElement}.
-     *
-     * @return The [EMAIL PROTECTED] OMContainer} of the node.
-     */
-    public OMContainer getParent();
-
-    /**
-     * Returns the next sibling in document order.
-     *
-     * @return Returns the next sibling in document order.
-     */
-    public OMNode getNextOMSibling() throws OMException;
-
-    /**
-     * Indicates whether parser has parsed this information item completely or 
not.
-     * If some info are not available in the item, one has to check this 
attribute to make sure that, this
-     * item has been parsed completely or not.
-     *
-     * @return Returns boolean.
-     */
-    public boolean isComplete();
-
-    /**
-     * Removes a node (and all of its children) from its containing parent.
-     *
-     * <p>Removes a node from its parent.  Partially complete nodes will be 
completed before
-     * they are detached from the model.  A node cannot be detached until its 
next sibling
-     * has been identified, so that the next sibling and parent can be updated 
appropriately.
-     * Please note that this will not handle the namespaces. For example, if 
there you have used a
-     * namespace within the detaching node and which is defined outside the 
detaching node, user has
-     * to handle it manually.
-     * </p>
-     *
-     * @throws OMException If a node is not complete, the detach can trigger 
further
-     * parsing, which may cause an exception.
-     */
-    public OMNode detach() throws OMException;
-
-    /**
-     * Discards a node.
-     *
-     * <p>Discard goes to the parser level and if the element is not 
completely built, then it will be
-     * completely skipped at the parser level.</p>
-     *
-     * @throws OMException
-     */
-    public void discard() throws OMException;
-
-    /**
-     * Inserts a new sibling after the current node.
-     *
-     * @param sibling The node that will be added after the current node.
-     *
-     * @throws OMException
-     */
-    public void insertSiblingAfter(OMNode sibling) throws OMException;
-
-    /**
-     * Inserts a sibling just before the current node.
-     *
-     * @param sibling The node that will be added before the current node.
-     * @throws OMException
-     */
-    public void insertSiblingBefore(OMNode sibling) throws OMException;
-
-    /**
-     * Returns the type of node.
-     *
-     * @return Returns one of [EMAIL PROTECTED] #ELEMENT_NODE}, [EMAIL 
PROTECTED] #TEXT_NODE}, [EMAIL PROTECTED] #CDATA_SECTION_NODE}, [EMAIL 
PROTECTED] #COMMENT_NODE},
-     *  [EMAIL PROTECTED] #DTD_NODE}, [EMAIL PROTECTED] #PI_NODE}, [EMAIL 
PROTECTED] #ENTITY_REFERENCE_NODE}, [EMAIL PROTECTED] #SPACE_NODE},
-     * or [EMAIL PROTECTED] #TEXT_NODE}.
-     */
-    public int getType();
-
-    /**
-     * Gets the previous sibling.
-     *
-     * @return Returns node.
-     */
-    public OMNode getPreviousOMSibling();
-
-    /**
-     * Serializes the node with caching.
-     *
-     * @param xmlWriter
-     * @throws XMLStreamException
-     */
-    public void serialize(XMLStreamWriter xmlWriter)
-            throws XMLStreamException;
-
-    /**
-     * Serializes the node with caching.
-     *
-     * @param output
-     * @throws XMLStreamException
-     */
-    public void serialize(OutputStream output)
-            throws XMLStreamException;
-
-    /**
-     * Serializes the node with caching.
-     *
-     * @param writer
-     * @throws XMLStreamException
-     */
-    public void serialize(Writer writer)
-            throws XMLStreamException;
-
-    /**
-     * Serializes the node with caching.
-     *
-     * @param output
-     * @param format
-     * @throws XMLStreamException
-     */
-    public void serialize(OutputStream output, OMOutputFormat format)
-            throws XMLStreamException;
-
-    /**
-     * Serializes the node with caching.
-     *
-     * @param writer
-     * @param format
-     * @throws XMLStreamException
-     */
-    public void serialize(Writer writer, OMOutputFormat format)
-            throws XMLStreamException;
-    
-    /**
-     * Serializes the node without caching.
-     *
-     * @param xmlWriter
-     * @throws XMLStreamException
-     */
-    public void serializeAndConsume(XMLStreamWriter xmlWriter) throws 
XMLStreamException;
-
-    /**
-     * Serializes the node without caching.
-     *
-     * @param output
-     * @throws XMLStreamException
-     */
-    public void serializeAndConsume(OutputStream output) throws 
XMLStreamException;
-
-    /**
-     * Serializes the node without caching.
-     *
-     * @param writer
-     * @throws XMLStreamException
-     */
-    public void serializeAndConsume(Writer writer) throws XMLStreamException;
-
-    /**
-     * Serializes the node without caching.
-     *
-     * @param output
-     * @param format
-     * @throws XMLStreamException
-     */
-    public void serializeAndConsume(OutputStream output, OMOutputFormat 
format) throws XMLStreamException;
-
-    /**
-     * Serializes the node without caching.
-     *
-     * @param writer
-     * @param format
-     * @throws XMLStreamException
-     */
-    public void serializeAndConsume(Writer writer, OMOutputFormat format) 
throws XMLStreamException;
-
-    /**
-     * Builds itself.
-     */
-    public void build();
-    
-    /**
-     * Returns the OMFactory that created this object
-     * @return
-     */
-    public OMFactory getOMFactory();
-    
+       /**
+        * The node is an <code>Element</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short ELEMENT_NODE = 1;
+
+       /**
+        * The node is a <code>Text</code> node.
+        * 
+        * @see #getType()
+        */
+       public static final short TEXT_NODE = XMLStreamConstants.CHARACTERS;
+
+       /**
+        * The node is a <code>CDATASection</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short CDATA_SECTION_NODE = XMLStreamConstants.CDATA;
+
+       /**
+        * The node is a <code>Comment</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short COMMENT_NODE = XMLStreamConstants.COMMENT;
+
+       /**
+        * This node is a <code>DTD</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short DTD_NODE = XMLStreamConstants.DTD;
+
+       /**
+        * This node is a <code>ProcessingInstruction</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short PI_NODE = 
XMLStreamConstants.PROCESSING_INSTRUCTION;
+
+       /**
+        * This node is an <code>Entity Reference</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short ENTITY_REFERENCE_NODE = 
XMLStreamConstants.ENTITY_REFERENCE;
+
+       /**
+        * This node is an <code>Entity Reference</code>.
+        * 
+        * @see #getType()
+        */
+       public static final short SPACE_NODE = XMLStreamConstants.SPACE;
+
+       /**
+        * Returns the parent containing node.
+        * 
+        * <p>
+        * Returns the parent container, which may be either an [EMAIL 
PROTECTED] OMDocument}
+        * or [EMAIL PROTECTED] OMElement}.
+        * 
+        * @return The [EMAIL PROTECTED] OMContainer} of the node.
+        */
+       public OMContainer getParent();
+
+       /**
+        * Returns the next sibling in document order.
+        * 
+        * @return Returns the next sibling in document order.
+        */
+       public OMNode getNextOMSibling() throws OMException;
+
+       /**
+        * Indicates whether parser has parsed this information item completely 
or
+        * not. If some info are not available in the item, one has to check 
this
+        * attribute to make sure that, this item has been parsed completely or 
not.
+        * 
+        * @return Returns boolean.
+        */
+       public boolean isComplete();
+
+       /**
+        * Removes a node (and all of its children) from its containing parent.
+        * 
+        * <p>
+        * Removes a node from its parent. Partially complete nodes will be
+        * completed before they are detached from the model. A node cannot be
+        * detached until its next sibling has been identified, so that the next
+        * sibling and parent can be updated appropriately. Please note that 
this
+        * will not handle the namespaces. For example, if there you have used a
+        * namespace within the detaching node and which is defined outside the
+        * detaching node, user has to handle it manually.
+        * </p>
+        * 
+        * @throws OMException
+        *             If a node is not complete, the detach can trigger further
+        *             parsing, which may cause an exception.
+        */
+       public OMNode detach() throws OMException;
+
+       /**
+        * Discards a node.
+        * 
+        * <p>
+        * Discard goes to the parser level and if the element is not completely
+        * built, then it will be completely skipped at the parser level.
+        * </p>
+        * 
+        * @throws OMException
+        */
+       public void discard() throws OMException;
+
+       /**
+        * Inserts a new sibling after the current node.
+        * 
+        * @param sibling
+        *            The node that will be added after the current node.
+        * 
+        * @throws OMException
+        */
+       public void insertSiblingAfter(OMNode sibling) throws OMException;
+
+       /**
+        * Inserts a sibling just before the current node.
+        * 
+        * @param sibling
+        *            The node that will be added before the current node.
+        * @throws OMException
+        */
+       public void insertSiblingBefore(OMNode sibling) throws OMException;
+
+       /**
+        * Returns the type of node.
+        * 
+        * @return Returns one of [EMAIL PROTECTED] #ELEMENT_NODE}, [EMAIL 
PROTECTED] #TEXT_NODE},
+        *         [EMAIL PROTECTED] #CDATA_SECTION_NODE}, [EMAIL PROTECTED] 
#COMMENT_NODE},
+        *         [EMAIL PROTECTED] #DTD_NODE}, [EMAIL PROTECTED] #PI_NODE},
+        *         [EMAIL PROTECTED] #ENTITY_REFERENCE_NODE}, [EMAIL PROTECTED] 
#SPACE_NODE}, or
+        *         [EMAIL PROTECTED] #TEXT_NODE}.
+        */
+       public int getType();
+
+       /**
+        * Gets the previous sibling.
+        * 
+        * @return Returns node.
+        */
+       public OMNode getPreviousOMSibling();
+
+       /**
+        * Serializes the node with caching.
+        * 
+        * @param xmlWriter
+        * @throws XMLStreamException
+        */
+       public void serialize(XMLStreamWriter xmlWriter) throws 
XMLStreamException;
+
+       /**
+        * Serializes the node with caching.
+        * 
+        * @param output
+        * @throws XMLStreamException
+        */
+       public void serialize(OutputStream output) throws XMLStreamException;
+
+       /**
+        * Serializes the node with caching.
+        * 
+        * @param writer
+        * @throws XMLStreamException
+        */
+       public void serialize(Writer writer) throws XMLStreamException;
+
+       /**
+        * Serializes the node with caching.
+        * 
+        * @param output
+        * @param format
+        * @throws XMLStreamException
+        */
+       public void serialize(OutputStream output, OMOutputFormat format)
+                       throws XMLStreamException;
+
+       /**
+        * Serializes the node with caching.
+        * 
+        * @param writer
+        * @param format
+        * @throws XMLStreamException
+        */
+       public void serialize(Writer writer, OMOutputFormat format)
+                       throws XMLStreamException;
+
+       /**
+        * Serializes the node without caching.
+        * 
+        * @param xmlWriter
+        * @throws XMLStreamException
+        */
+       public void serializeAndConsume(XMLStreamWriter xmlWriter)
+                       throws XMLStreamException;
+
+       /**
+        * Serializes the node without caching.
+        * 
+        * @param output
+        * @throws XMLStreamException
+        */
+       public void serializeAndConsume(OutputStream output)
+                       throws XMLStreamException;
+
+       /**
+        * Serializes the node without caching.
+        * 
+        * @param writer
+        * @throws XMLStreamException
+        */
+       public void serializeAndConsume(Writer writer) throws 
XMLStreamException;
+
+       /**
+        * Serializes the node without caching.
+        * 
+        * @param output
+        * @param format
+        * @throws XMLStreamException
+        */
+       public void serializeAndConsume(OutputStream output, OMOutputFormat 
format)
+                       throws XMLStreamException;
+
+       /**
+        * Serializes the node without caching.
+        * 
+        * @param writer
+        * @param format
+        * @throws XMLStreamException
+        */
+       public void serializeAndConsume(Writer writer, OMOutputFormat format)
+                       throws XMLStreamException;
+
+       /**
+        * Builds itself.
+        */
+       public void build();
+
+       /**
+        * Builds itself with the OMText binary content. AXIOM supports two 
levels
+        * of deffered building. First is deffered building of AXIOM using StAX.
+        * Second level is the deffered building of attachments. AXIOM reads in 
the
+        * attachements from the stream only when user asks by calling
+        * getDataHandler(). build() method builds the OM without the 
attachments.
+        * buildAll() builds the OM together with attachement data. This becomes
+        * handy when user wants to free the input stream.
+        */
+       public void buildWithAttachments();
+
+       /**
+        * Returns the OMFactory that created this object
+        * 
+        * @return
+        */
+       public OMFactory getOMFactory();
+
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
 Tue Aug 29 05:34:42 2006
@@ -1460,4 +1460,20 @@
         // TODO TODO
         throw new UnsupportedOperationException("TODO");
     }
+    
+       /* (non-Javadoc)
+        * @see org.apache.axiom.om.OMNode#buildAll()
+        */
+       public void buildWithAttachments() {
+               if (!done)
+               {
+                       this.build();
+               }
+               Iterator iterator = getChildren();
+               while(iterator.hasNext())
+               {
+                       OMNode node = (OMNode)iterator.next();
+                       node.buildWithAttachments();
+               }
+       }
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
 Tue Aug 29 05:34:42 2006
@@ -468,6 +468,21 @@
             this.builder.next();
     }
 
+       /**
+        * Parses this node and builds the object structure in memory. AXIOM
+        * supports two levels of deffered building. First is deffered building 
of
+        * AXIOM using StAX. Second level is the deffered building of 
attachments.
+        * AXIOM reads in the attachements from the stream only when user asks 
by
+        * calling getDataHandler(). build() method builds the OM without the
+        * attachments. buildAll() builds the OM together with attachement data.
+        * This becomes handy when user wants to free the input stream.
+        */
+       public void buildWithAttachments() {
+               if (!this.done) {
+                       this.build();
+               }
+       }
+       
     /**
      * Sets the owner document.
      * 

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
 Tue Aug 29 05:34:42 2006
@@ -495,5 +495,15 @@
     public String toString() {
         return (this.textValue != null) ? textValue.toString() : "";
     }
-
+    
+       /* (non-Javadoc)
+        * @see org.apache.axiom.om.OMNode#buildAll()
+        */
+       public void buildWithAttachments() {
+               this.build();
+               if (isOptimized())
+               {
+                       this.getDataHandler();
+               }
+       }
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
 Tue Aug 29 05:34:42 2006
@@ -936,4 +936,19 @@
         return lineNumber;
     }
 
+       /* (non-Javadoc)
+        * @see org.apache.axiom.om.OMNode#buildAll()
+        */
+       public void buildWithAttachments() {
+               if (!done)
+               {
+                       this.build();
+               }
+               Iterator iterator = getChildren();
+               while(iterator.hasNext())
+               {
+                       OMNode node = (OMNode)iterator.next();
+                       node.buildWithAttachments();
+               }
+       }
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
 Tue Aug 29 05:34:42 2006
@@ -285,7 +285,6 @@
         this.previousSibling = (OMNodeImpl) previousSibling;
     }
 
-
     /**
      * Parses this node and builds the object structure in memory.
      * However a node, created programmatically, will have done set to true by
@@ -298,6 +297,21 @@
             builder.next();
         }
     }
+    
+       /**
+        * Parses this node and builds the object structure in memory. AXIOM
+        * supports two levels of deffered building. First is deffered building 
of
+        * AXIOM using StAX. Second level is the deffered building of 
attachments.
+        * AXIOM reads in the attachements from the stream only when user asks 
by
+        * calling getDataHandler(). build() method builds the OM without the
+        * attachments. buildAll() builds the OM together with attachement data.
+        * This becomes handy when user wants to free the input stream.
+        */
+       public void buildWithAttachments() {
+               if (!this.done) {
+                       this.build();
+               }
+       }
 
     /**
      * Serializes the node with caching.

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
 Tue Aug 29 05:34:42 2006
@@ -708,4 +708,20 @@
         forceExpand();
         return super.toString();
     }
+    
+       /* (non-Javadoc)
+        * @see org.apache.axiom.om.OMNode#buildAll()
+        */
+       public void buildWithAttachments() {
+               if (!done)
+               {
+                       this.build();
+               }
+               Iterator iterator = getChildren();
+               while(iterator.hasNext())
+               {
+                       OMNode node = (OMNode)iterator.next();
+                       node.buildWithAttachments();
+               }
+       }
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?rev=438060&r1=438059&r2=438060&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
 Tue Aug 29 05:34:42 2006
@@ -517,4 +517,16 @@
         }
     }
 
+       /* (non-Javadoc)
+        * @see org.apache.axiom.om.OMNode#buildAll()
+        */
+       public void buildWithAttachments() {
+               if (!this.done) {
+                       this.build();
+               }
+               if (isOptimized()) {
+                       this.getDataHandler();
+               }
+       }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to