cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r803954 - in /cxf/trunk: api/src/main/java/org/apache/cxf/annotations/ api/src/main/java/org/apache/cxf/tools/common/ rt/core/src/main/java/org/apache/cxf/service/factory/ rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/ rt/databi...
Date Thu, 13 Aug 2009 17:33:56 GMT
Author: dkulp
Date: Thu Aug 13 17:33:48 2009
New Revision: 803954

URL: http://svn.apache.org/viewvc?rev=803954&view=rev
Log:
Add DataBinding annotation to set the databinding for a service without
needing config.

Allow wsdl2java to output DataBinding annotation if appropriate.

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java   (with props)
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
    cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/SDODatabinding.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java

Added: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java?rev=803954&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java Thu Aug 13 17:33:48
2009
@@ -0,0 +1,42 @@
+/**
+ * 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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies the DataBinding to use with the service
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface DataBinding {
+    Class<? extends org.apache.cxf.databinding.DataBinding> value();
+    
+    /**
+     * Bean reference to lookup in configuration.  Bean must be castable 
+     * to the Class set above
+     * @return
+     */
+    String ref() default "";
+}
+

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java Thu Aug 13
17:33:48 2009
@@ -217,6 +217,7 @@
     // Tools framework
     public static final String FRONTEND_PLUGIN = "frontend";
     public static final String DATABINDING_PLUGIN = "databinding";
+    public static final String RUNTIME_DATABINDING_CLASS = "databinding-class";
 
     public static final String CFG_WSDL_VERSION = "wsdlversion";
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java
Thu Aug 13 17:33:48 2009
@@ -80,7 +80,10 @@
     }
 
     public DataBinding getDataBinding() {
-        if (dataBinding == null) {
+        return getDataBinding(true);
+    }
+    public DataBinding getDataBinding(boolean create) {
+        if (dataBinding == null && create) {
             dataBinding = createDefaultDataBinding();
         }
         return dataBinding;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java
Thu Aug 13 17:33:48 2009
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.annotations.DataBinding;
 import org.apache.cxf.annotations.FastInfoset;
 import org.apache.cxf.annotations.GZIP;
 import org.apache.cxf.annotations.Logging;
@@ -32,6 +33,7 @@
 import org.apache.cxf.annotations.WSDLDocumentation.Placement;
 import org.apache.cxf.annotations.WSDLDocumentationCollection;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.feature.AbstractFeature;
@@ -41,6 +43,7 @@
 import org.apache.cxf.interceptor.FIStaxOutInterceptor;
 import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.FaultInfo;
@@ -59,15 +62,17 @@
     public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args)
{
         switch (ev) {
         case INTERFACE_CREATED: {
+            InterfaceInfo ii = (InterfaceInfo)args[0];
             Class<?> cls = (Class<?>)args[1];
             WSDLDocumentation doc = cls.getAnnotation(WSDLDocumentation.class);
             if (doc != null) {
-                addDocumentation((InterfaceInfo)args[0], WSDLDocumentation.Placement.PORT_TYPE,
doc);
+                addDocumentation(ii, WSDLDocumentation.Placement.PORT_TYPE, doc);
             }
             WSDLDocumentationCollection col = cls.getAnnotation(WSDLDocumentationCollection.class);
             if (col != null) {
-                addDocumentation((InterfaceInfo)args[0], WSDLDocumentation.Placement.PORT_TYPE,
col.value());
+                addDocumentation(ii, WSDLDocumentation.Placement.PORT_TYPE, col.value());
             }
+            setDataBinding(factory, cls.getAnnotation(DataBinding.class));
             break;
         }
         case ENDPOINT_SELECTED: {
@@ -124,6 +129,22 @@
         }
     }
 
+    private void setDataBinding(AbstractServiceFactoryBean factory,
+                                DataBinding annotation) {
+        if (annotation != null && factory.getDataBinding(false) == null) { 
+            try {
+                if (!StringUtils.isEmpty(annotation.ref())) {
+                    factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class)
+                        .resolveResource(annotation.ref(), annotation.value()));
+                }
+
+                factory.setDataBinding(annotation.value().newInstance());
+            } catch (Exception e) {
+                //REVISIT - log a warning
+            }
+        }
+    }
+
     private void addLoggingSupport(Endpoint endpoint, Bus bus, Logging annotation) {
         if (annotation != null) {
             LoggingFeature lf = new LoggingFeature(annotation);

Modified: cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/SDODatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/SDODatabinding.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/SDODatabinding.java
(original)
+++ cxf/trunk/rt/databinding/sdo/src/main/java/org/apache/cxf/sdo/tools/SDODatabinding.java
Thu Aug 13 17:33:48 2009
@@ -77,6 +77,8 @@
     private EPackage.Registry packageRegistry;
     
     public void initialize(ToolContext context) throws ToolException {
+        context.put(ToolConstants.RUNTIME_DATABINDING_CLASS,
+                    "org.apache.cxf.sdo.SDODataBinding.class");
         String databinding = (String)context.get(ToolConstants.CFG_DATABINDING);
         if (DATABINDING_DYNAMIC_SDO.equalsIgnoreCase(databinding)) {
             dynamic = true;

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
Thu Aug 13 17:33:48 2009
@@ -91,6 +91,9 @@
     StscState state;
     
     public void initialize(ToolContext context) throws ToolException {
+        context.put(ToolConstants.RUNTIME_DATABINDING_CLASS,
+            "org.apache.cxf.xmlbeans.XmlBeansDataBinding.class");
+        
         String wsdl = (String)context.get(ToolConstants.CFG_WSDLURL);
         String catalog = (String)context.get(ToolConstants.CFG_CATALOG);
         Object o = context.get(ToolConstants.CFG_BINDING);

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
Thu Aug 13 17:33:48 2009
@@ -77,11 +77,11 @@
     }
 
     protected void applyExtraClass() {
-        DataBinding dataBinding = getServiceFactory().getDataBinding();
-        if (dataBinding instanceof JAXBDataBinding) {
-            Map props = this.getProperties();
-            if (props != null && props.get("jaxb.additionalContextClasses") != null)
{
-                Class[] extraClass = (Class[])this.getProperties().get("jaxb.additionalContextClasses");
+        Map props = this.getProperties();
+        if (props != null && props.get("jaxb.additionalContextClasses") != null)
{
+            Class[] extraClass = (Class[])this.getProperties().get("jaxb.additionalContextClasses");
+            DataBinding dataBinding = getServiceFactory().getDataBinding();
+            if (dataBinding instanceof JAXBDataBinding) {
                 ((JAXBDataBinding)dataBinding).setExtraClass(extraClass);
             }
         }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
Thu Aug 13 17:33:48 2009
@@ -208,11 +208,11 @@
     }
 
     protected void applyExtraClass() {
-        DataBinding dataBinding = getServiceFactory().getDataBinding();
-        if (dataBinding instanceof JAXBDataBinding) {
-            Map props = this.getProperties();
-            if (props != null && props.get("jaxb.additionalContextClasses") != null)
{
-                Class[] extraClass = (Class[])this.getProperties().get("jaxb.additionalContextClasses");
+        Map props = this.getProperties();
+        if (props != null && props.get("jaxb.additionalContextClasses") != null)
{
+            Class[] extraClass = (Class[])this.getProperties().get("jaxb.additionalContextClasses");
+            DataBinding dataBinding = getServiceFactory().getDataBinding();
+            if (dataBinding instanceof JAXBDataBinding) {
                 ((JAXBDataBinding)dataBinding).setExtraClass(extraClass);
             }
         }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Aug 13 17:33:48 2009
@@ -83,6 +83,7 @@
 import org.apache.cxf.interceptor.FaultOutInterceptor;
 import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.message.Exchange;
+import org.apache.cxf.resource.ResourceManager;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.ServiceImpl;
 import org.apache.cxf.service.ServiceModelSchemaValidator;
@@ -186,6 +187,22 @@
     
      
     protected DataBinding createDefaultDataBinding() {
+        if (getServiceClass() != null) {
+            org.apache.cxf.annotations.DataBinding db 
+                = getServiceClass().getAnnotation(org.apache.cxf.annotations.DataBinding.class);
+            if (db != null) {
+                try {
+                    if (!StringUtils.isEmpty(db.ref())) {
+                        return getBus().getExtension(ResourceManager.class).resolveResource(db.ref(),
+                                                                                        
   db.value());
+                    }
+                    return db.value().newInstance();
+                } catch (Exception e) {
+                    LOG.log(Level.WARNING, "Could not create databinding " 
+                            + db.value().getName(), e);
+                }
+            }
+        }
         return new JAXBDataBinding(getQualifyWrapperSchema());
     }
     

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf.xml Thu Aug 13 17:33:48
2009
@@ -33,9 +33,9 @@
         <!-- jaxws:properties>
             <entry key="schema-validation-enabled" value="true" />
         </jaxws:properties-->
-        <jaxws:dataBinding>
+        <!-- jaxws:dataBinding>
         	<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
-        </jaxws:dataBinding>
+        </jaxws:dataBinding-->
     </jaxws:client>
 
     <jaxws:endpoint name="{http://apache.org/hello_world_soap_http/xmlbeans}SoapPort"
@@ -44,9 +44,9 @@
         <jaxws:properties>
             <entry key="schema-validation-enabled" value="true" />
         </jaxws:properties>
-        <jaxws:dataBinding>
+        <!-- jaxws:dataBinding>
         	<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
-        </jaxws:dataBinding>
+        </jaxws:dataBinding-->
     </jaxws:endpoint>
 
 </beans>

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/xmlbeans/cxf_no_wsdl.xml Thu Aug
13 17:33:48 2009
@@ -33,9 +33,9 @@
         <!-- jaxws:properties>
             <entry key="schema-validation-enabled" value="true" />
         </jaxws:properties-->
-        <jaxws:dataBinding>
+        <!-- jaxws:dataBinding>
         	<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
-        </jaxws:dataBinding>
+        </jaxws:dataBinding-->
     </jaxws:client>
 
     <jaxws:endpoint name="{http://apache.org/hello_world_soap_http/xmlbeans}SoapPort"
@@ -43,9 +43,9 @@
         <jaxws:properties>
             <entry key="schema-validation-enabled" value="true" />
         </jaxws:properties>
-        <jaxws:dataBinding>
+        <!-- jaxws:dataBinding>
         	<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding"/>
-        </jaxws:dataBinding>
+        </jaxws:dataBinding-->
     </jaxws:endpoint>
 
 </beans>

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JAnnotationElement.java
Thu Aug 13 17:33:48 2009
@@ -91,7 +91,11 @@
 
     private void appendValue(final StringBuffer sb, final Object obj) {
         if (obj instanceof String) {
-            getStringValue(sb, obj);
+            if (isPrimitive) {
+                sb.append(obj);
+            } else {
+                getStringValue(sb, obj);
+            }
         } else if (obj instanceof Class) {
             Class clz = (Class) obj;
             if (containsSameClassName(clz) && !imports.contains(clz.getName())) {

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java Thu
Aug 13 17:33:48 2009
@@ -97,7 +97,8 @@
             String lastToken = tokens.get(tokens.size() - 1);
             idx = lastToken.lastIndexOf('.');
             if (idx > 0) {
-                lastToken = lastToken.substring(0, idx);
+                //lastToken = lastToken.substring(0, idx);
+                lastToken = lastToken.replace('.', '_');
                 tokens.set(tokens.size() - 1, lastToken);
             }
         }

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?rev=803954&r1=803953&r2=803954&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
Thu Aug 13 17:33:48 2009
@@ -23,12 +23,14 @@
 
 import javax.jws.HandlerChain;
 
+import org.apache.cxf.annotations.DataBinding;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.common.model.JAnnotation;
+import org.apache.cxf.tools.common.model.JAnnotationElement;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaModel;
 import org.apache.cxf.tools.util.ClassCollector;
@@ -104,6 +106,15 @@
                     }
                 }
             }
+            if (penv.containsKey(ToolConstants.RUNTIME_DATABINDING_CLASS)) {
+                JAnnotation ann = new JAnnotation(DataBinding.class);
+                JAnnotationElement el 
+                    = new JAnnotationElement(null,
+                                             penv.get(ToolConstants.RUNTIME_DATABINDING_CLASS),
+                                             true);
+                ann.addElement(el);
+                intf.addAnnotation(ann);
+            }
             clearAttributes();
             setAttributes("intf", intf);
             setCommonAttributes();



Mime
View raw message