cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r752357 - in /cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ rt/databinding/xmlbeans/src/main/java/org/apache/c...
Date Wed, 11 Mar 2009 02:40:36 GMT
Author: bimargulies
Date: Wed Mar 11 02:40:36 2009
New Revision: 752357

URL: http://svn.apache.org/viewvc?rev=752357&view=rev
Log:
Finish out the modularity to allow Aegis validation at some point. If this much is in 2.2.0,
2.2.x can
fill in the rest when msv is ready.

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/BaseDataWriter.java   (with props)
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBindingValidation2.java
      - copied, changed from r752223, cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReaderValidation2.java
Removed:
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReaderValidation2.java
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java

Added: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/BaseDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/BaseDataWriter.java?rev=752357&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/BaseDataWriter.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/BaseDataWriter.java Wed Mar 11
02:40:36 2009
@@ -0,0 +1,51 @@
+/**
+ * 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.databinding;
+
+import java.util.Collection;
+
+import javax.xml.validation.Schema;
+
+import org.apache.cxf.message.Attachment;
+
+/**
+ * The 'write' side of the data binding abstraction of CXF.
+ */
+public interface BaseDataWriter {
+    String ENDPOINT = DataWriter.class.getName() + "Endpoint";
+    
+    /**
+     * Attach a schema to the writer. If the binding supports validation, it will
+     * validate the XML that it produces (assuming that it produces XML). 
+     * @param s the schema.
+     */
+    void setSchema(Schema s);
+    /**
+     * Attach a collection of attachments to this writer.
+     * @param attachments
+     */
+    void setAttachments(Collection<Attachment> attachments);
+    /**
+     * Set a property for the writer.
+     * @param key property key 
+     * @param value property value.
+     */
+    void setProperty(String key, Object value);
+}

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

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

Copied: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBindingValidation2.java
(from r752223, cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReaderValidation2.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBindingValidation2.java?p2=cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBindingValidation2.java&p1=cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReaderValidation2.java&r1=752223&r2=752357&rev=752357&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataReaderValidation2.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataBindingValidation2.java Wed
Mar 11 02:40:36 2009
@@ -25,7 +25,7 @@
  * If a DataReader<T> implements this interface, it prefers to be supplied with schema
  * for validation via an XmlSchemaCollection instead of via a packaged Schema object.
  */
-public interface DataReaderValidation2 {
+public interface DataBindingValidation2 {
     /**
      * 
      * @param schema

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/DataWriter.java Wed Mar 11 02:40:36
2009
@@ -19,11 +19,6 @@
 
 package org.apache.cxf.databinding;
 
-import java.util.Collection;
-
-import javax.xml.validation.Schema;
-
-import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
 
 /**
@@ -31,7 +26,7 @@
  * objects to a 'sink' of type T.
  * @param <T> The type of sink. Each data binding defines the set of sink types that
it supports.
  */
-public interface DataWriter<T> {
+public interface DataWriter<T> extends BaseDataWriter {
     String ENDPOINT = DataWriter.class.getName() + "Endpoint";
     
     /**
@@ -48,21 +43,4 @@
      * @param output the output sink.
      */
     void write(Object obj, MessagePartInfo part, T output);
-    /**
-     * Attach a schema to the writer. If the binding supports validation, it will
-     * validate the XML that it produces (assuming that it produces XML). 
-     * @param s the schema.
-     */
-    void setSchema(Schema s);
-    /**
-     * Attach a collection of attachments to this writer.
-     * @param attachments
-     */
-    void setAttachments(Collection<Attachment> attachments);
-    /**
-     * Set a property for the writer.
-     * @param key property key 
-     * @param value property value.
-     */
-    void setProperty(String key, Object value);
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Wed Mar 11 02:40:36 2009
@@ -30,8 +30,8 @@
 import org.w3c.dom.Node;
 
 import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
-import org.apache.cxf.databinding.DataReaderValidation2;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -107,8 +107,8 @@
             /* This might be a reader that wants to grab the schema from the
              * service info. 
              */
-            if (reader instanceof DataReaderValidation2) {
-                ((DataReaderValidation2)reader).setSchema(service.getServiceInfos().get(0)
+            if (reader instanceof DataBindingValidation2) {
+                ((DataBindingValidation2)reader).setSchema(service.getServiceInfos().get(0)
                                                           .getXmlSchemaCollection().getXmlSchemaCollection());
             }
         }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataReader.java
Wed Mar 11 02:40:36 2009
@@ -28,15 +28,17 @@
 
 import org.apache.cxf.aegis.AegisElementDataReader;
 import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
 
 /**
  * 
  */
-public class ElementDataReader implements DataReader<Element> {
+public class ElementDataReader implements DataReader<Element>, DataBindingValidation2
{
     
     private AegisElementDataReader reader;
     private AegisDatabinding databinding;
@@ -91,4 +93,9 @@
     public void setSchema(Schema s) {
         reader.setSchema(s);
     }
+
+    public void setSchema(XmlSchemaCollection schema) {
+        // TODO Auto-generated method stub
+        
+    }
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ElementDataWriter.java
Wed Mar 11 02:40:36 2009
@@ -36,13 +36,15 @@
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
 
-public class ElementDataWriter implements DataWriter<Element> {
+public class ElementDataWriter implements DataWriter<Element>, DataBindingValidation2
{
 
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
 
@@ -112,5 +114,10 @@
         return properties.get(key);
     }
 
+    public void setSchema(XmlSchemaCollection schema) {
+        // TODO Auto-generated method stub
+        
+    }
+
 
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataReader.java
Wed Mar 11 02:40:36 2009
@@ -27,15 +27,15 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.aegis.AegisXMLStreamDataReader;
 import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
-import org.apache.cxf.databinding.DataReaderValidation2;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.staxutils.StaxValidationManager;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 
-public class XMLStreamDataReader implements DataReader<XMLStreamReader>, DataReaderValidation2
{
+public class XMLStreamDataReader implements DataReader<XMLStreamReader>, DataBindingValidation2
{
 
     private AegisDatabinding databinding;
     private AegisXMLStreamDataReader reader;

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
Wed Mar 11 02:40:36 2009
@@ -34,13 +34,15 @@
 import org.apache.cxf.aegis.xml.stax.ElementWriter;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 
-public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> {
+public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter>, DataBindingValidation2
{
 
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
 
@@ -116,5 +118,10 @@
         return properties.get(key);
     }
 
+    public void setSchema(XmlSchemaCollection schema) {
+        // TODO Auto-generated method stub
+        
+    }
+
 
 }

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java?rev=752357&r1=752356&r2=752357&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/DataReaderImpl.java
Wed Mar 11 02:40:36 2009
@@ -30,8 +30,8 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.databinding.DataBindingValidation2;
 import org.apache.cxf.databinding.DataReader;
-import org.apache.cxf.databinding.DataReaderValidation2;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -42,7 +42,7 @@
 import org.apache.xmlbeans.XmlOptions;
 
 
-public class DataReaderImpl implements DataReader<XMLStreamReader> , DataReaderValidation2
{
+public class DataReaderImpl implements DataReader<XMLStreamReader> , DataBindingValidation2
{
     private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
     private XmlSchemaCollection schemas;
     



Mime
View raw message