cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r792604 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/model/wadl/ main/java/org/apache/cxf/jaxrs/provider/ test/java/org/apache/cxf/jaxrs/provider/ test/java/org/apache/cxf/jaxrs/resources/
Date Thu, 09 Jul 2009 16:51:06 GMT
Author: sergeyb
Date: Thu Jul  9 16:51:06 2009
New Revision: 792604

URL: http://svn.apache.org/viewvc?rev=792604&view=rev
Log:
JAXRS : support for JSON unwrapped style

Added:
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java 
 (with props)
Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/Tags.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=792604&r1=792603&r2=792604&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Thu Jul  9 16:51:06 2009
@@ -41,6 +41,7 @@
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
+import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLStreamException;
@@ -85,6 +86,8 @@
     public static final String WADL_NS = "http://research.sun.com/wadl/2006/10";    
     
     private static final Logger LOG = LogUtils.getL7dLogger(WadlGenerator.class);
+    private static final String JAXB_DEFAULT_NAMESPACE = "##default";
+    private static final String JAXB_DEFAULT_NAME = "##default";
     
     public Response handleRequest(Message m, ClassResourceInfo resource) {
         
@@ -373,13 +376,10 @@
             writeQName(sb, typeQName);
             return;
         }
-        JAXBBeanInfo info = JAXBUtils.getBeanInfo(jaxbProxy, type);
-        if (info == null) {
-            return;
-        }
-        QName qname = getQName(info, type, clsMap);
         
-        if (qname != null && qname.getNamespaceURI().length() > 0) {
+        QName qname = getQName(jaxbProxy, type, clsMap);
+        
+        if (qname != null) {
             writeQName(sb, qname);
             clsMap.put(type, qname);
         }
@@ -417,35 +417,43 @@
         return xmlSchemaCollection;
     }
     
-    private QName getQName(JAXBBeanInfo jaxbInfo, Class<?> type, Map<Class<?>,
QName> clsMap) {
+    private QName getQName(JAXBContextProxy jaxbProxy, Class<?> type, Map<Class<?>,
QName> clsMap) {
+        
+        XmlRootElement root = type.getAnnotation(XmlRootElement.class);
+        if (root != null) {
+            return getQNameFromParts(root.name(), root.namespace(), clsMap);
+        }
+        
         try {
-            Object instance = type.newInstance();
-            String localName = jaxbInfo.getElementLocalName(instance);
-            String ns = jaxbInfo.getElementNamespaceURI(instance);
-            if (localName != null) {
-                if (ns != null && ns.length() > 0) {
-                    String prefix = null;
-                    for (QName name : clsMap.values()) {
-                        if (name.getNamespaceURI().equals(ns)) {
-                            prefix = name.getPrefix();
-                            break;
-                        }
-                    }    
-                    if (prefix == null) {
-                        int size = new HashSet<QName>(clsMap.values()).size();
-                        prefix = "prefix" + (size + 1);
-                    }
-                    return new QName(ns, localName, prefix);
-                } else {
-                    return new QName("", localName);
-                }
+            JAXBBeanInfo jaxbInfo = JAXBUtils.getBeanInfo(jaxbProxy, type);
+            if (jaxbInfo == null) {
+                return null;
             }
+            Object instance = type.newInstance();
+            return getQNameFromParts(jaxbInfo.getElementLocalName(instance), 
+                                     jaxbInfo.getElementNamespaceURI(instance),
+                                     clsMap);
         } catch (Exception ex) {
             // ignore    
         }
         return null;
     }
     
+    private String getPrefix(String ns, Map<Class<?>, QName> clsMap) {
+        String prefix = null;
+        for (QName name : clsMap.values()) {
+            if (name.getNamespaceURI().equals(ns)) {
+                prefix = name.getPrefix();
+                break;
+            }
+        }    
+        if (prefix == null) {
+            int size = new HashSet<QName>(clsMap.values()).size();
+            prefix = "prefix" + (size + 1);
+        }
+        return prefix;
+    }
+    
     private Set<Class<?>> getAllJaxbTypes(List<ClassResourceInfo> cris)
{
         Set<Class<?>> types = new HashSet<Class<?>>();
         for (ClassResourceInfo root : cris) {
@@ -575,4 +583,19 @@
         }
         return doc;
     }
+    
+    
+    private QName getQNameFromParts(String name, String namespace, Map<Class<?>,
QName> clsMap) {
+        if (name == null || JAXB_DEFAULT_NAME.equals(name) || name.length() == 0) {
+            return null; 
+        }
+        if (namespace == null || JAXB_DEFAULT_NAMESPACE.equals(namespace) || namespace.length()
== 0) {
+            return null;
+        }
+        
+        String prefix = getPrefix(namespace, clsMap);
+        return new QName(namespace, name, prefix);
+    }
+    
+    
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=792604&r1=792603&r2=792604&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Thu Jul  9 16:51:06 2009
@@ -20,12 +20,15 @@
 package org.apache.cxf.jaxrs.provider;
 
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
+import java.io.SequenceInputStream;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -37,14 +40,20 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.cxf.common.util.ReflectionInvokationHandler;
+import org.apache.cxf.jaxb.JAXBBeanInfo;
+import org.apache.cxf.jaxb.JAXBContextProxy;
+import org.apache.cxf.jaxb.JAXBUtils;
 import org.apache.cxf.jaxrs.ext.MessageContext;
 import org.apache.cxf.jaxrs.utils.schemas.SchemaHandler;
 import org.codehaus.jettison.AbstractXMLStreamWriter;
@@ -64,12 +73,27 @@
     private Map<String, String> namespaceMap = new HashMap<String, String>();
     private boolean serializeAsArray;
     private List<String> arrayKeys;
+    private boolean unwrapped;
+    private String wrapperName;
+    private Map<String, String> wrapperMap;
     
     @Context
     public void setMessageContext(MessageContext mc) {
         super.setContext(mc);
     }
     
+    public void setSupportUnwrapped(boolean unwrap) {
+        this.unwrapped = unwrap;
+    }
+    
+    public void setWrapperName(String wName) {
+        wrapperName = wName;
+    }
+    
+    public void setWrapperMap(Map<String, String> map) {
+        wrapperMap = map;
+    }
+    
     public void setEnableBuffering(boolean enableBuf) {
         super.setEnableBuffering(enableBuf);
     }
@@ -111,8 +135,10 @@
             
             Unmarshaller unmarshaller = createUnmarshaller(theType, genericType);
             
+            InputStream realStream = getInputStream(type, genericType, is);
             MappedXMLInputFactory factory = new MappedXMLInputFactory(namespaceMap);
-            XMLStreamReader xsw = factory.createXMLStreamReader(is);
+            XMLStreamReader xsw = factory.createXMLStreamReader(realStream);
+            
             Object response = null;
             if (JAXBElement.class.isAssignableFrom(type)) {
                 response = unmarshaller.unmarshal(xsw, theType);
@@ -135,6 +161,56 @@
         return null;
     }
 
+    protected InputStream getInputStream(Class<Object> cls, Type type, InputStream
is) throws Exception {
+        if (unwrapped) {
+            String rootName = getRootName(cls, type);
+            InputStream isBefore = new ByteArrayInputStream(rootName.getBytes());
+            InputStream isAfter = new ByteArrayInputStream("}".getBytes());
+            final InputStream[] streams = new InputStream[]{isBefore, is, isAfter};
+            
+            Enumeration<InputStream> list = new Enumeration<InputStream>() {
+                private int index; 
+                public boolean hasMoreElements() {
+                    return index < streams.length;
+                }
+
+                public InputStream nextElement() {
+                    return streams[index++];
+                }  
+                
+            };
+            return new SequenceInputStream(list);
+        } else {
+            return is;
+        }
+                 
+    }
+    
+    protected String getRootName(Class<Object> cls, Type type) throws Exception {
+        String name = null;
+        if (wrapperName != null) {
+            name = wrapperName;
+        } else if (wrapperMap != null) {
+            name = wrapperMap.get(cls.getName());
+        }
+        if (name == null) {
+            QName qname = getQName(cls, type, null, false);
+            if (qname != null) {
+                name = qname.getLocalPart();
+                String prefix = qname.getPrefix();
+                if (prefix.length() > 0) {
+                    name = prefix + "." + name;
+                }
+            }
+        }
+        
+        if (name == null) {
+            throw new WebApplicationException(500);
+        }
+        
+        return "{\"" + name + "\":";
+    }
+    
     public void writeTo(Object obj, Class<?> cls, Type genericType, Annotation[] anns,
 
         MediaType m, MultivaluedMap<String, Object> headers, OutputStream os)
         throws IOException {
@@ -151,6 +227,7 @@
             }
             Marshaller ms = createMarshaller(actualObject, actualClass, genericType, encoding);
 
+            QName qname = getQName(actualClass, genericType, actualObject, true);
             Configuration c = new Configuration(namespaceMap);
             MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
             AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
@@ -162,7 +239,7 @@
                         xsw.seriliazeAsArray(key);
                     }
                 } else {
-                    String key = getKey(convention, cls);
+                    String key = getKey(convention, qname);
                     xsw.seriliazeAsArray(key);
                 }
             }
@@ -179,33 +256,73 @@
         }
     }
 
-    private String getKey(MappedNamespaceConvention convention, Class<?> cls) {
-        String key = null;
+    private String getKey(MappedNamespaceConvention convention, QName qname) throws Exception
{
+        return convention.createKey(qname.getPrefix(), 
+                                    qname.getNamespaceURI(),
+                                    qname.getLocalPart());
+            
         
+    }
+    
+    private QName getQName(Class<?> cls, Type type, Object object, boolean allocatePrefix)

+        throws Exception {
+        //try the easy way first
         XmlRootElement root = cls.getAnnotation(XmlRootElement.class);
+        QName qname = null;
         if (root != null) {
-            
-            String namespace = root.namespace();
-            if (JAXB_DEFAULT_NAMESPACE.equals(namespace)) {
-                namespace = "";
-            }
-            
-            String prefix = namespaceMap.get(namespace);
-            if (prefix == null) {
-                prefix = "";
+            String namespace = getNamespace(root.namespace());
+            String name = getLocalName(root.name(), cls.getSimpleName());
+            String prefix = getPrefix(namespace, allocatePrefix);
+            qname = new QName(namespace, name, prefix);
+        } else {
+            JAXBContext context = getJAXBContext(cls, type);
+            JAXBContextProxy proxy = ReflectionInvokationHandler.createProxyWrapper(context,
+                                                                                    JAXBContextProxy.class);
+            JAXBBeanInfo info = JAXBUtils.getBeanInfo(proxy, cls);
+            if (info != null) {
+                try {
+                    Object instance = object == null ? cls.newInstance() : object;
+                    String name = getLocalName(info.getElementLocalName(instance), cls.getSimpleName());
+                    String namespace = getNamespace(info.getElementNamespaceURI(instance));
+                    String prefix = getPrefix(namespace, allocatePrefix);
+                    qname = new QName(namespace, name, prefix);
+                } catch (Exception ex) {
+                    // ignore
+                }
             }
-            
-            String name = root.name();
-            if (JAXB_DEFAULT_NAME.equals(name)) {
-                name = cls.getSimpleName();
+        }
+        return qname;
+    }
+    
+    private String getLocalName(String name, String clsName) {
+        if (JAXB_DEFAULT_NAME.equals(name)) {
+            name = clsName;
+            if (name.length() > 1) {
+                name = name.substring(0, 1).toLowerCase() + name.substring(1); 
+            } else {
+                name = name.toLowerCase();
             }
-            key = convention.createKey(prefix, namespace, name);
-            
-        } else {
-            key = convention.createKey("", "", cls.getSimpleName());
         }
-        return key;
+        return name;
     }
     
+    private String getNamespace(String namespace) {
+        if (JAXB_DEFAULT_NAMESPACE.equals(namespace)) {
+            return "";
+        }
+        return namespace;
+    }
     
+    private String getPrefix(String namespace, boolean allocatePrefix) {
+        String prefix = namespaceMap.get(namespace);
+        if (prefix == null) {
+            if (allocatePrefix && namespace.length() > 0) {
+                prefix = "ns" + (namespaceMap.size() + 1);
+                namespaceMap.put(namespace, prefix);
+            } else {
+                prefix = "";
+            }
+        }
+        return prefix;
+    }
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java?rev=792604&r1=792603&r2=792604&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JSONProviderTest.java
Thu Jul  9 16:51:06 2009
@@ -19,20 +19,162 @@
 
 package org.apache.cxf.jaxrs.provider;
 
+import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.ext.MessageBodyReader;
 
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.resources.ManyTags;
 import org.apache.cxf.jaxrs.resources.TagVO;
+import org.apache.cxf.jaxrs.resources.TagVO2;
 import org.apache.cxf.jaxrs.resources.Tags;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class JSONProviderTest extends Assert {
 
+    
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testReadFromTags() throws Exception {
+        MessageBodyReader<Object> p = new JSONProvider();
+        byte[] bytes = 
+            "{\"Tags\":{\"list\":[{\"group\":\"b\",\"name\":\"a\"},{\"group\":\"d\",\"name\":\"c\"}]}}"
+            .getBytes();
+        Object tagsObject = p.readFrom((Class)Tags.class, null, null, 
+                                          null, null, new ByteArrayInputStream(bytes));
+        Tags tags = (Tags)tagsObject;
+        List<TagVO> list = tags.getTags();
+        assertEquals(2, list.size());
+        assertEquals("a", list.get(0).getName());
+        assertEquals("b", list.get(0).getGroup());
+        assertEquals("c", list.get(1).getName());
+        assertEquals("d", list.get(1).getGroup());
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testReadFromTag() throws Exception {
+        MessageBodyReader<Object> p = new JSONProvider();
+        byte[] bytes = "{\"tagVO\":{\"group\":\"b\",\"name\":\"a\"}}"
+            .getBytes();
+        Object tagsObject = p.readFrom((Class)TagVO.class, null, null, 
+                                          null, null, new ByteArrayInputStream(bytes));
+        TagVO tag = (TagVO)tagsObject;
+        assertEquals("a", tag.getName());
+        assertEquals("b", tag.getGroup());
+    }
+    
+    @Test
+    public void testReadFromUnwrappedTagWrapperName() throws Exception {
+        JSONProvider p = new JSONProvider();
+        p.setSupportUnwrapped(true);
+        p.setWrapperName("tagVO");
+        readUnwrapped(p);
+    }
+    
+    @Test
+    public void testReadFromUnwrappedTagMap() throws Exception {
+        JSONProvider p = new JSONProvider();
+        p.setSupportUnwrapped(true);
+        
+        Map<String, String> map = new HashMap<String, String>();
+        map.put(TagVO.class.getName(), "tagVO");
+        p.setWrapperMap(map);
+        readUnwrapped(p);
+    }
+    
+    @Test
+    public void testReadFromUnwrappedTagRoot() throws Exception {
+        JSONProvider p = new JSONProvider();
+        p.setSupportUnwrapped(true);
+        readUnwrapped(p);
+    }
+    
+    @Test
+    @SuppressWarnings("unchecked")
+    public void testReadFromUnwrappedQualifiedTagRoot() throws Exception {
+        JSONProvider p = new JSONProvider();
+        p.setSupportUnwrapped(true);
+        Map<String, String> namespaceMap = new HashMap<String, String>();
+        namespaceMap.put("http://tags", "ns1");
+        p.setNamespaceMap(namespaceMap);
+        
+        byte[] bytes = "{\"group\":\"b\",\"name\":\"a\"}"
+            .getBytes();
+        Object tagsObject = p.readFrom((Class)TagVO2.class, null, null, 
+                                          null, null, new ByteArrayInputStream(bytes));
+        TagVO2 tag = (TagVO2)tagsObject;
+        assertEquals("a", tag.getName());
+        assertEquals("b", tag.getGroup());
+    }
+    
+    @SuppressWarnings("unchecked")
+    private void readUnwrapped(JSONProvider p) throws Exception {
+        byte[] bytes = "{\"group\":\"b\",\"name\":\"a\"}"
+            .getBytes();
+        Object tagsObject = p.readFrom((Class)TagVO.class, null, null, 
+                                          null, null, new ByteArrayInputStream(bytes));
+        TagVO tag = (TagVO)tagsObject;
+        assertEquals("a", tag.getName());
+        assertEquals("b", tag.getGroup());
+    }
+    
+    @Test
+    public void testWriteToSingleTag() throws Exception {
+        JSONProvider p = new JSONProvider();
+        TagVO tag = createTag("a", "b");
+        
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        
+        p.writeTo(tag, (Class)TagVO.class, TagVO.class, TagVO.class.getAnnotations(), 
+                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(),
os);
+        
+        String s = os.toString();
+        assertEquals("{\"tagVO\":{\"group\":\"b\",\"name\":\"a\"}}", s);
+        
+    }
+    
+    @Test
+    public void testWriteToSingleQualifiedTag() throws Exception {
+        JSONProvider p = new JSONProvider();
+        Map<String, String> namespaceMap = new HashMap<String, String>();
+        namespaceMap.put("http://tags", "ns1");
+        p.setNamespaceMap(namespaceMap);
+        TagVO2 tag = createTag2("a", "b");
+        
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        
+        p.writeTo(tag, (Class)TagVO2.class, TagVO2.class, TagVO2.class.getAnnotations(),

+                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(),
os);
+        
+        String s = os.toString();
+        assertEquals("{\"ns1.thetag\":{\"group\":\"b\",\"name\":\"a\"}}", s);
+        
+    }
+    
+    @Test
+    public void testWriteToSingleQualifiedTag2() throws Exception {
+        JSONProvider p = new JSONProvider();
+        TagVO2 tag = createTag2("a", "b");
+        
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        
+        p.writeTo(tag, (Class)TagVO2.class, TagVO2.class, TagVO2.class.getAnnotations(),

+                  MediaType.APPLICATION_JSON_TYPE, new MetadataMap<String, Object>(),
os);
+        
+        String s = os.toString();
+        assertEquals("{\"ns1.thetag\":{\"group\":\"b\",\"name\":\"a\"}}", s);
+        
+    }
+    
     @Test
     public void testWriteToListWithManyValues() throws Exception {
         JSONProvider p = new JSONProvider();
@@ -95,4 +237,8 @@
     private TagVO createTag(String name, String group) {
         return new TagVO(name, group);
     }
+    
+    private TagVO2 createTag2(String name, String group) {
+        return new TagVO2(name, group);
+    }
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java?rev=792604&r1=792603&r2=792604&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java Thu
Jul  9 16:51:06 2009
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.jaxrs.resources;
 
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
 public class TagVO {
     private String name;
     private String group;

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java?rev=792604&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java Thu
Jul  9 16:51:06 2009
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxrs.resources;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "thetag", namespace = "http://tags")
+public class TagVO2 extends TagVO {
+    
+    public TagVO2() {
+        
+    }
+    
+    public TagVO2(String name, String group) {
+        super(name, group);
+    }
+}

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/Tags.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/Tags.java?rev=792604&r1=792603&r2=792604&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/Tags.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/Tags.java Thu
Jul  9 16:51:06 2009
@@ -40,4 +40,8 @@
     public void addTag(TagVO tag) {
         list.add(tag);
     }
+    
+    public List<TagVO> getTags() {
+        return list;
+    }
 }



Mime
View raw message