Revision: 15085
          http://gate.svn.sourceforge.net/gate/?rev=15085&view=rev
Author:   ian_roberts
Date:     2012-01-16 17:30:12 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
Allow java.lang.Boolean as a type of feature value in GATE XML.  The *reading*
code has always been able to cope with

<Feature>
  <Name className="java.lang.String">exists</Name>
  <Value className="java.lang.Boolean">true</Value>
</Feature>

but the writing code refused to write any such features.

Modified Paths:
--------------
    gate/trunk/src/gate/corpora/DocumentStaxUtils.java

Modified: gate/trunk/src/gate/corpora/DocumentStaxUtils.java
===================================================================
--- gate/trunk/src/gate/corpora/DocumentStaxUtils.java  2012-01-16 16:51:10 UTC 
(rev 15084)
+++ gate/trunk/src/gate/corpora/DocumentStaxUtils.java  2012-01-16 17:30:12 UTC 
(rev 15085)
@@ -1320,9 +1320,10 @@
         // Test value if it is String, Number or Collection
         if(value instanceof java.lang.String
                 || value instanceof java.lang.Number
+                || value instanceof java.lang.Boolean
                 || value instanceof java.util.Collection)
           valueClassName = value.getClass().getName();
-        // Features and values that are not Strings, Numbers or
+        // Features and values that are not Strings, Numbers, Booleans or
         // collections
         // will be discarded.
         if(keyClassName == null || valueClassName == null) continue;
@@ -1353,7 +1354,8 @@
           Iterator iter = ((Collection)value).iterator();
           if(iter.hasNext()) {
             item = iter.next();
-            if(item instanceof java.lang.Number)
+            if(item instanceof java.lang.Number 
+                || item instanceof java.lang.Boolean)
               valueItemClassName = item.getClass().getName();
             else valueItemClassName = String.class.getName();
             valueStrBuff.append(item.toString());

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to