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 th...@apache.org on 2007/04/04 10:33:07 UTC

svn commit: r525455 - /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java

Author: thilina
Date: Wed Apr  4 01:33:06 2007
New Revision: 525455

URL: http://svn.apache.org/viewvc?view=rev&rev=525455
Log:
implementing the getProperty() for the OMStaxWrapper

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java?view=diff&rev=525455&r1=525454&r2=525455
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMStAXWrapper.java Wed Apr  4 01:33:06 2007
@@ -16,8 +16,22 @@
 
 package org.apache.axiom.om.impl.llom;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Stack;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMComment;
+import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
@@ -29,18 +43,6 @@
 import org.apache.axiom.om.impl.exception.OMStreamingException;
 import org.apache.axiom.om.impl.llom.util.NamespaceContextImpl;
 
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Stack;
-
 /**
  * Note  - This class also implements the streaming constants interface to get access to the StAX
  * constants
@@ -917,14 +919,31 @@
      * @throws IllegalArgumentException
      */
     public Object getProperty(String s) throws IllegalArgumentException {
-        throw new IllegalArgumentException();
+        if (OMConstants.IS_DATA_HANDLERS_AWARE.equals(s)) {
+            return Boolean.TRUE;
+        }
+        if (OMConstants.IS_BINARY.equals(s)) {
+            if (lastNode instanceof OMText) {
+                OMText text = (OMText) lastNode;
+                return new Boolean(text.isBinary());
+            }
+            return Boolean.FALSE;
+        } else if (OMConstants.DATA_HANDLER.equals(s)) {
+            if (lastNode instanceof OMText) {
+                OMText text = (OMText) lastNode;    
+                if (text.isBinary())
+                    return text.getDataHandler();
+            }
+        }
+        return null;
     }
 
     /**
-     * This is a very important method. It keeps the navigator one step ahead and pushes it one
-     * event ahead. If the nextNode is null then navigable is set to false. At the same time the
-     * parser and builder are set up for the upcoming event generation.
-     *
+     * This is a very important method. It keeps the navigator one step ahead
+     * and pushes it one event ahead. If the nextNode is null then navigable is
+     * set to false. At the same time the parser and builder are set up for the
+     * upcoming event generation.
+     * 
      * @throws XMLStreamException
      */
     private void updateLastNode() throws XMLStreamException {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org