wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From el...@apache.org
Subject svn commit: r813260 - in /incubator/wink/trunk/wink-common/src: main/java/org/apache/wink/common/internal/model/ main/java/org/apache/wink/common/model/ main/java/org/apache/wink/common/model/app/ main/java/org/apache/wink/common/model/atom/ main/java/...
Date Thu, 10 Sep 2009 06:50:32 GMT
Author: elman
Date: Thu Sep 10 06:50:31 2009
New Revision: 813260

URL: http://svn.apache.org/viewvc?rev=813260&view=rev
Log:
JAXBNamespacePrefixMapper is not used anymore. See [WINK-169]

Removed:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/model/NamespacePrefixMapperProvider.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/JAXBNamespacePrefixMapper.java
Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppCategories.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppService.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomEntry.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomFeed.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/opensearch/OpenSearchDescription.java
    incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/model/atom/AtomTest.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppCategories.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppCategories.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppCategories.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppCategories.java
Thu Sep 10 06:50:31 2009
@@ -42,12 +42,9 @@
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.wink.common.RestConstants;
 import org.apache.wink.common.RestException;
 import org.apache.wink.common.internal.model.ModelUtils;
-import org.apache.wink.common.internal.model.NamespacePrefixMapperProvider;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 import org.apache.wink.common.model.atom.AtomCategory;
 
 /**
@@ -108,7 +105,7 @@
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "appCategories", propOrder = {"category"})
-public class AppCategories implements NamespacePrefixMapperProvider {
+public class AppCategories {
 
     @XmlElement(namespace = "http://www.w3.org/2005/Atom")
     protected List<AtomCategory>     category;
@@ -159,13 +156,6 @@
         }
     }
 
-    public JAXBNamespacePrefixMapper getNamespacePrefixMapper() {
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_APP);
-        mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-        return mapper;
-    }
-
     // ============================
 
     /**

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppService.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppService.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppService.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/app/AppService.java
Thu Sep 10 06:50:31 2009
@@ -44,12 +44,9 @@
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.wink.common.RestConstants;
 import org.apache.wink.common.RestException;
 import org.apache.wink.common.internal.model.ModelUtils;
-import org.apache.wink.common.internal.model.NamespacePrefixMapperProvider;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 import org.apache.wink.common.model.atom.AtomCommonAttributes;
 import org.w3c.dom.Element;
 
@@ -76,7 +73,7 @@
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlAccessorOrder(XmlAccessOrder.UNDEFINED)
 @XmlType(name = "appService", propOrder = {"workspace", "any"})
-public class AppService extends AtomCommonAttributes implements NamespacePrefixMapperProvider
{
+public class AppService extends AtomCommonAttributes {
 
     @XmlElement(required = true)
     protected List<AppWorkspace>     workspace;
@@ -117,13 +114,6 @@
         }
     }
 
-    public JAXBNamespacePrefixMapper getNamespacePrefixMapper() {
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_APP);
-        mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-        return mapper;
-    }
-
     // ============================
 
     /**

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomEntry.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomEntry.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomEntry.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomEntry.java
Thu Sep 10 06:50:31 2009
@@ -48,12 +48,9 @@
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.datatype.XMLGregorianCalendar;
 
-import org.apache.wink.common.RestConstants;
 import org.apache.wink.common.RestException;
 import org.apache.wink.common.internal.model.ModelUtils;
-import org.apache.wink.common.internal.model.NamespacePrefixMapperProvider;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 import org.apache.wink.common.model.synd.SyndCategory;
 import org.apache.wink.common.model.synd.SyndContent;
 import org.apache.wink.common.model.synd.SyndEntry;
@@ -139,7 +136,7 @@
 @XmlAccessorOrder(XmlAccessOrder.UNDEFINED)
 @XmlType(name = "atomEntry", propOrder = {"id", "updated", "title", "summary", "published",
"link",
                                           "author", "contributor", "category", "any", "content"})
-public class AtomEntry extends AtomCommonAttributes implements NamespacePrefixMapperProvider
{
+public class AtomEntry extends AtomCommonAttributes {
 
     private static final String      MATCH_ANY_PATTERN = ".*";
 
@@ -195,13 +192,6 @@
         ModelUtils.marshal(marshaller, entryElement, os);
     }
 
-    public JAXBNamespacePrefixMapper getNamespacePrefixMapper() {
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_ATOM);
-        mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-        return mapper;
-    }
-
     public AtomEntry() {
     }
 

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomFeed.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomFeed.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomFeed.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/atom/AtomFeed.java
Thu Sep 10 06:50:31 2009
@@ -53,9 +53,7 @@
 import org.apache.wink.common.RestConstants;
 import org.apache.wink.common.RestException;
 import org.apache.wink.common.internal.model.ModelUtils;
-import org.apache.wink.common.internal.model.NamespacePrefixMapperProvider;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 import org.apache.wink.common.model.opensearch.OpenSearchDescription;
 import org.apache.wink.common.model.opensearch.OpenSearchQuery;
 import org.apache.wink.common.model.synd.SyndCategory;
@@ -146,7 +144,7 @@
                                          "author", "contributor", "category", "generator",
"icon",
                                          "logo", "rights", "any", "entry"})
 @XmlSeeAlso(value = {OpenSearchQuery.class})
-public class AtomFeed extends AtomCommonAttributes implements NamespacePrefixMapperProvider
{
+public class AtomFeed extends AtomCommonAttributes {
 
     @XmlElement(required = true)
     protected String                                                id;
@@ -265,20 +263,6 @@
         ModelUtils.marshal(marshaller, feedElement, os);
     }
 
-    public JAXBNamespacePrefixMapper getNamespacePrefixMapper() {
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_ATOM);
-        if (!openSearchElementsExist()) {
-            mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-        }
-        return mapper;
-    }
-
-    private boolean openSearchElementsExist() {
-        return (totalResults != null || itemsPerPage != null || startIndex != null || (opensearchQuery
!= null && opensearchQuery
-            .size() > 0));
-    }
-
     private List<SyndPerson> getAuthorsAsSynd() {
         List<SyndPerson> authors = new ArrayList<SyndPerson>();
         for (AtomPerson value : getAuthors()) {

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/opensearch/OpenSearchDescription.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/opensearch/OpenSearchDescription.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/opensearch/OpenSearchDescription.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/opensearch/OpenSearchDescription.java
Thu Sep 10 06:50:31 2009
@@ -39,16 +39,12 @@
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAnyAttribute;
 import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.namespace.QName;
 
-import org.apache.wink.common.RestConstants;
 import org.apache.wink.common.RestException;
-import org.apache.wink.common.internal.model.NamespacePrefixMapperProvider;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 
 /**
  * The "OpenSearchDescription" element per OpenSearch specification
@@ -347,14 +343,15 @@
  *      &lt;OutputEncoding&gt;UTF-8&lt;/OutputEncoding&gt;
  * </pre>
  */
-//@XmlRootElement(namespace = "http://a9.com/-/spec/opensearch/1.1/", name = "Contact")
+// @XmlRootElement(namespace = "http://a9.com/-/spec/opensearch/1.1/", name =
+// "Contact")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "OpenSearchDescription", propOrder = {"shortName", "description", "tags",
                                                       "contact", "url", "longName", "image",
                                                       "query", "developer", "attribution",
                                                       "syndicationRight", "adultContent",
                                                       "language", "outputEncoding", "inputEncoding"})
-public class OpenSearchDescription implements NamespacePrefixMapperProvider {
+public class OpenSearchDescription {
 
     @XmlElement(name = "ShortName", required = true)
     protected String                 shortName;
@@ -410,12 +407,6 @@
         return JAXBUtils.createUnmarshaller(context);
     }
 
-    public JAXBNamespacePrefixMapper getNamespacePrefixMapper() {
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_OPENSEARCH);
-        return mapper;
-    }
-
     // ============================
 
     /**

Modified: incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/model/atom/AtomTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/model/atom/AtomTest.java?rev=813260&r1=813259&r2=813260&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/model/atom/AtomTest.java
(original)
+++ incubator/wink/trunk/wink-common/src/test/java/org/apache/wink/common/model/atom/AtomTest.java
Thu Sep 10 06:50:31 2009
@@ -60,7 +60,6 @@
 import org.apache.wink.common.internal.runtime.AbstractRuntimeContext;
 import org.apache.wink.common.internal.runtime.RuntimeContextTLS;
 import org.apache.wink.common.internal.utils.JAXBUtils;
-import org.apache.wink.common.model.JAXBNamespacePrefixMapper;
 import org.apache.wink.common.model.opensearch.OpenSearchQuery;
 import org.apache.wink.test.mock.TestUtils;
 
@@ -330,10 +329,6 @@
         text.setBase("http://title/base");
         text.setLang("en-us");
 
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_ATOM);
-        mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-
         // test type TEXT
         text.setType(AtomTextType.text);
         text.setValue("title");
@@ -435,10 +430,6 @@
     public void testAtomContentMarshal() throws Exception {
         Marshaller m = JAXBUtils.createMarshaller(ctx);
 
-        JAXBNamespacePrefixMapper mapper =
-            new JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_ATOM);
-        mapper.omitNamespace(RestConstants.NAMESPACE_OPENSEARCH);
-
         AtomContent content = new AtomContent();
         content.setBase("http://title/base");
         content.setLang("en-us");
@@ -477,7 +468,7 @@
         ModelUtils.marshal(m, element, os);
         msg = TestUtils.diffIgnoreUpdateWithAttributeQualifier(ATOM_CONTENT_XML, os.toString());
         assertNull(msg, msg);
-        
+
         content.setValue("<x xmlns=\"http://x/\">title</x>");
         element = (new ObjectFactory()).createContent(content);
         os = new ByteArrayOutputStream();
@@ -706,7 +697,8 @@
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         ModelUtils.marshal(m, element, os);
         String msg =
-            TestUtils.diffIgnoreUpdateWithAttributeQualifier(ATOM_FEED_1.getBytes("UTF-8"),
os.toByteArray());
+            TestUtils.diffIgnoreUpdateWithAttributeQualifier(ATOM_FEED_1.getBytes("UTF-8"),
os
+                .toByteArray());
         assertNull(msg, msg);
     }
 
@@ -722,7 +714,8 @@
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         ModelUtils.marshal(m, element, os);
         String msg =
-            TestUtils.diffIgnoreUpdateWithAttributeQualifier(ATOM_FEED_2.getBytes("UTF-8"),
os.toByteArray());
+            TestUtils.diffIgnoreUpdateWithAttributeQualifier(ATOM_FEED_2.getBytes("UTF-8"),
os
+                .toByteArray());
         assertNull(msg, msg);
     }
 
@@ -968,7 +961,8 @@
             os = new ByteArrayOutputStream();
             ModelUtils.marshal(marshaller, element, os);
             String msg =
-                TestUtils.diffIgnoreUpdateWithAttributeQualifier(defaultContent, new String(os.toByteArray(),
enc));
+                TestUtils.diffIgnoreUpdateWithAttributeQualifier(defaultContent, new String(os
+                    .toByteArray(), enc));
             assertNull(msg, msg);
         }
     }



Mime
View raw message