You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by da...@apache.org on 2007/03/07 21:20:15 UTC
svn commit: r515734 [2/11] - in /incubator/cxf/trunk/rt: ./
core/src/main/java/org/apache/cxf/endpoint/ databinding/aegis/
databinding/aegis/src/ databinding/aegis/src/main/
databinding/aegis/src/main/java/ databinding/aegis/src/main/java/org/
databind...
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,95 @@
+/**
+ * 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.aegis.databinding;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Logger;
+
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.validation.Schema;
+
+import org.apache.cxf.aegis.Aegis;
+import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.Type;
+import org.apache.cxf.aegis.xml.MessageWriter;
+import org.apache.cxf.aegis.xml.stax.ElementWriter;
+import org.apache.cxf.common.i18n.Message;
+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;
+
+public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> {
+
+ private static final Logger LOG = Logger.getLogger(XMLStreamDataReader.class.getName());
+
+ private AegisDatabinding databinding;
+
+ private Collection<Attachment> attachments;
+
+ public XMLStreamDataWriter(AegisDatabinding databinding) {
+ this.databinding = databinding;
+ }
+
+ public void setAttachments(Collection<Attachment> attachments) {
+ this.attachments = attachments;
+ }
+
+ public void setSchema(Schema s) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
+ Type type = databinding.getType(part);
+
+ if (type == null) {
+ throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG));
+ }
+
+ Context context = new Context();
+ // I'm not sure that this is the right type mapping
+ context.setTypeMapping(type.getTypeMapping());
+ context.put(Aegis.OVERRIDE_TYPES_KEY,
+ databinding.getOverrideTypes());
+ context.setAttachments(attachments);
+ type = Aegis.getWriteType(context, obj, type);
+
+ try {
+ ElementWriter writer = new ElementWriter(output);
+ MessageWriter w2 = writer.getElementWriter(part.getConcreteName());
+ if (type.isNillable() && obj == null) {
+ w2.writeXsiNil();
+ return;
+ }
+
+ type.writeObject(obj, w2, context);
+ w2.close();
+ } catch (DatabindingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void write(Object obj, XMLStreamWriter output) {
+ write(obj, null, output);
+ }
+
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/XMLStreamDataWriter.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,462 @@
+/**
+ * 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.aegis.type;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
+
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.basic.ArrayType;
+import org.apache.cxf.aegis.type.basic.ObjectType;
+import org.apache.cxf.aegis.type.collection.CollectionType;
+import org.apache.cxf.aegis.type.collection.MapType;
+import org.apache.cxf.aegis.util.NamespaceHelper;
+import org.apache.cxf.aegis.util.ServiceUtils;
+
+/**
+ * @author Hani Suleiman Date: Jun 14, 2005 Time: 11:59:57 PM
+ */
+public abstract class AbstractTypeCreator implements TypeCreator {
+ protected TypeMapping tm;
+
+ protected AbstractTypeCreator nextCreator;
+
+ private Configuration typeConfiguration;
+
+ public TypeMapping getTypeMapping() {
+ return tm;
+ }
+
+ public void setTypeMapping(TypeMapping typeMapping) {
+ this.tm = typeMapping;
+
+ if (nextCreator != null) {
+ nextCreator.setTypeMapping(tm);
+ }
+ }
+
+ public void setNextCreator(AbstractTypeCreator creator) {
+ this.nextCreator = creator;
+ }
+
+ protected TypeClassInfo createClassInfo(Field f) {
+ TypeClassInfo info = createBasicClassInfo(f.getType());
+ info.setDescription("field " + f.getName() + " in " + f.getDeclaringClass());
+ return info;
+ }
+
+ protected TypeClassInfo createBasicClassInfo(Class typeClass) {
+ TypeClassInfo info = new TypeClassInfo();
+ info.setDescription("class '" + typeClass.getName() + '\'');
+ info.setTypeClass(typeClass);
+
+ return info;
+ }
+
+ protected Type createTypeForClass(TypeClassInfo info) {
+ Class javaType = info.getTypeClass();
+ Type result = null;
+ boolean newType = true;
+
+ if (info.getType() != null) {
+ result = createUserType(info);
+ } else if (isArray(javaType)) {
+ result = createArrayType(info);
+ } else if (isMap(javaType)) {
+ result = createMapType(info);
+ } else if (isHolder(javaType)) {
+ result = createHolderType(info);
+ } else if (isCollection(javaType)) {
+ result = createCollectionType(info);
+ } else if (isEnum(javaType)) {
+ result = createEnumType(info);
+ } else {
+ Type type = getTypeMapping().getType(javaType);
+ if (type == null) {
+ type = createDefaultType(info);
+ } else {
+ newType = false;
+ }
+
+ result = type;
+ }
+
+ if (newType && !getConfiguration().isDefaultNillable()) {
+ result.setNillable(false);
+ }
+
+ return result;
+ }
+
+
+ protected boolean isHolder(Class javaType)
+ {
+ return javaType.equals(Holder.class);
+ }
+
+ protected Type createHolderType(TypeClassInfo info)
+ {
+ if (info.getGenericType() == null)
+ {
+ throw new UnsupportedOperationException("To use holder types "
+ + "you must have an XML descriptor declaring the component type.");
+ }
+
+ Class heldCls = (Class) info.getGenericType();
+ info.setTypeClass(heldCls);
+
+ return createType(heldCls);
+ }
+
+
+ protected boolean isArray(Class javaType) {
+ return javaType.isArray() && !javaType.equals(byte[].class);
+ }
+
+ protected Type createUserType(TypeClassInfo info) {
+ try {
+ Type type = (Type)info.getType().newInstance();
+
+ QName name = info.getTypeName();
+ if (name == null) {
+ name = createQName(info.getTypeClass());
+ }
+
+ type.setSchemaType(name);
+ type.setTypeClass(info.getTypeClass());
+ type.setTypeMapping(getTypeMapping());
+
+ return type;
+ } catch (InstantiationException e) {
+ throw new DatabindingException("Couldn't instantiate type classs " + info.getType().getName(), e);
+ } catch (IllegalAccessException e) {
+ throw new DatabindingException("Couldn't access type classs " + info.getType().getName(), e);
+ }
+ }
+
+ protected Type createArrayType(TypeClassInfo info) {
+ ArrayType type = new ArrayType();
+ type.setTypeMapping(getTypeMapping());
+ type.setTypeClass(info.getTypeClass());
+ type.setSchemaType(createCollectionQName(info, type.getComponentType()));
+
+ if (info.getMinOccurs() != -1) {
+ type.setMinOccurs(info.getMinOccurs());
+ }
+ if (info.getMaxOccurs() != -1) {
+ type.setMaxOccurs(info.getMaxOccurs());
+ }
+
+ type.setFlat(info.isFlat());
+
+ return type;
+ }
+
+ protected QName createQName(Class javaType) {
+ String clsName = javaType.getName();
+
+ String ns = NamespaceHelper.makeNamespaceFromClassName(clsName, "http");
+ String localName = ServiceUtils.makeServiceNameFromClassName(javaType);
+
+ return new QName(ns, localName);
+ }
+
+ protected boolean isCollection(Class javaType) {
+ return Collection.class.isAssignableFrom(javaType);
+ }
+
+ protected Type createCollectionTypeFromGeneric(TypeClassInfo info) {
+ Type component = getOrCreateGenericType(info);
+
+ CollectionType type = new CollectionType(component);
+ type.setTypeMapping(getTypeMapping());
+
+ QName name = info.getTypeName();
+ if (name == null) {
+ name = createCollectionQName(info, component);
+ }
+
+ type.setSchemaType(name);
+
+ type.setTypeClass(info.getTypeClass());
+
+ if (info.getMinOccurs() != -1) {
+ type.setMinOccurs(info.getMinOccurs());
+ }
+ if (info.getMaxOccurs() != -1) {
+ type.setMaxOccurs(info.getMaxOccurs());
+ }
+
+ type.setFlat(info.isFlat());
+
+ return type;
+ }
+
+ protected Type getOrCreateGenericType(TypeClassInfo info) {
+ return createObjectType();
+ }
+
+ protected Type getOrCreateMapKeyType(TypeClassInfo info) {
+ return createObjectType();
+ }
+
+ private Type createObjectType() {
+ ObjectType type = new ObjectType();
+ type.setSchemaType(DefaultTypeMappingRegistry.XSD_ANY);
+ type.setTypeClass(Object.class);
+ type.setTypeMapping(getTypeMapping());
+ return type;
+ }
+
+ protected Type getOrCreateMapValueType(TypeClassInfo info) {
+ return createObjectType();
+ }
+
+ protected Type createMapType(TypeClassInfo info, Type keyType, Type valueType) {
+ QName schemaType = createMapQName(info, keyType, valueType);
+ MapType type = new MapType(schemaType, keyType, valueType);
+ type.setTypeMapping(getTypeMapping());
+ type.setTypeClass(info.getTypeClass());
+
+ return type;
+ }
+
+ protected Type createMapType(TypeClassInfo info) {
+ Type keyType = getOrCreateMapKeyType(info);
+ Type valueType = getOrCreateMapValueType(info);
+
+ return createMapType(info, keyType, valueType);
+ }
+
+ protected QName createMapQName(TypeClassInfo info, Type keyType, Type valueType) {
+ String name = keyType.getSchemaType().getLocalPart() + '2' + valueType.getSchemaType().getLocalPart()
+ + "Map";
+
+ // TODO: Get namespace from XML?
+ return new QName(tm.getEncodingStyleURI(), name);
+ }
+
+ protected boolean isMap(Class javaType) {
+ return Map.class.isAssignableFrom(javaType);
+ }
+
+ public abstract TypeClassInfo createClassInfo(PropertyDescriptor pd);
+
+ protected boolean isEnum(Class javaType) {
+ return false;
+ }
+
+ public Type createEnumType(TypeClassInfo info) {
+ return null;
+ }
+
+ public abstract Type createCollectionType(TypeClassInfo info);
+
+ public abstract Type createDefaultType(TypeClassInfo info);
+
+ protected QName createCollectionQName(TypeClassInfo info, Type type) {
+ String ns;
+
+ if (type.isComplex()) {
+ ns = type.getSchemaType().getNamespaceURI();
+ } else {
+ ns = tm.getEncodingStyleURI();
+ }
+
+ String first = type.getSchemaType().getLocalPart().substring(0, 1);
+ String last = type.getSchemaType().getLocalPart().substring(1);
+ String localName = "ArrayOf" + first.toUpperCase() + last;
+
+ return new QName(ns, localName);
+ }
+
+ public abstract TypeClassInfo createClassInfo(Method m, int index);
+
+ /**
+ * Create a Type for a Method parameter.
+ *
+ * @param m the method to create a type for
+ * @param index The parameter index. If the index is less than zero, the
+ * return type is used.
+ */
+ public Type createType(Method m, int index) {
+ TypeClassInfo info = createClassInfo(m, index);
+ info.setDescription((index == -1 ? "return type" : "parameter " + index) + " of method "
+ + m.getName() + " in " + m.getDeclaringClass());
+ return createTypeForClass(info);
+ }
+
+ public QName getElementName(Method m, int index) {
+ TypeClassInfo info = createClassInfo(m, index);
+
+ return info.getMappedName();
+ }
+
+ /**
+ * Create type information for a PropertyDescriptor.
+ *
+ * @param pd the propertydescriptor
+ */
+ public Type createType(PropertyDescriptor pd) {
+ TypeClassInfo info = createClassInfo(pd);
+ info.setDescription("property " + pd.getName());
+ return createTypeForClass(info);
+ }
+
+ /**
+ * Create type information for a <code>Field</code>.
+ *
+ * @param f the field to create a type from
+ */
+ public Type createType(Field f) {
+ TypeClassInfo info = createClassInfo(f);
+ info.setDescription("field " + f.getName() + " in " + f.getDeclaringClass());
+ return createTypeForClass(info);
+ }
+
+ public Type createType(Class clazz) {
+ TypeClassInfo info = createBasicClassInfo(clazz);
+ info.setDescription(clazz.toString());
+ return createTypeForClass(info);
+ }
+
+ public Configuration getConfiguration() {
+ return typeConfiguration;
+ }
+
+ public void setConfiguration(Configuration typeConfiguration) {
+ this.typeConfiguration = typeConfiguration;
+ }
+
+ public static class TypeClassInfo {
+ Class typeClass;
+
+ Object[] annotations;
+
+ Object genericType;
+
+ Object keyType;
+
+ QName mappedName;
+
+ QName typeName;
+
+ Class type;
+
+ String description;
+
+ long minOccurs = -1;
+ long maxOccurs = -1;
+ boolean flat = false;
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Object[] getAnnotations() {
+ return annotations;
+ }
+
+ public void setAnnotations(Object[] annotations) {
+ this.annotations = annotations;
+ }
+
+ public Object getGenericType() {
+ return genericType;
+ }
+
+ public void setGenericType(Object genericType) {
+ this.genericType = genericType;
+ }
+
+ public Object getKeyType() {
+ return keyType;
+ }
+
+ public void setKeyType(Object keyType) {
+ this.keyType = keyType;
+ }
+
+ public Class getTypeClass() {
+ return typeClass;
+ }
+
+ public void setTypeClass(Class typeClass) {
+ this.typeClass = typeClass;
+ }
+
+ public QName getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(QName name) {
+ this.typeName = name;
+ }
+
+ public Class getType() {
+ return type;
+ }
+
+ public void setType(Class type) {
+ this.type = type;
+ }
+
+ public QName getMappedName() {
+ return mappedName;
+ }
+
+ public void setMappedName(QName mappedName) {
+ this.mappedName = mappedName;
+ }
+
+ public long getMaxOccurs() {
+ return maxOccurs;
+ }
+
+ public void setMaxOccurs(long maxOccurs) {
+ this.maxOccurs = maxOccurs;
+ }
+
+ public long getMinOccurs() {
+ return minOccurs;
+ }
+
+ public void setMinOccurs(long minOccurs) {
+ this.minOccurs = minOccurs;
+ }
+
+ public boolean isFlat() {
+ return flat;
+ }
+
+ public void setFlat(boolean flat) {
+ this.flat = flat;
+ }
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,61 @@
+/**
+ * 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.aegis.type;
+
+public class Configuration {
+ private boolean defaultExtensibleElements = false;
+
+ private boolean defaultExtensibleAttributes = false;
+
+ private boolean defaultNillable = true;
+
+ private int defaultMinOccurs = 0;
+
+ public boolean isDefaultExtensibleAttributes() {
+ return defaultExtensibleAttributes;
+ }
+
+ public void setDefaultExtensibleAttributes(boolean defaultExtensibleAttributes) {
+ this.defaultExtensibleAttributes = defaultExtensibleAttributes;
+ }
+
+ public boolean isDefaultExtensibleElements() {
+ return defaultExtensibleElements;
+ }
+
+ public void setDefaultExtensibleElements(boolean defaultExtensibleElements) {
+ this.defaultExtensibleElements = defaultExtensibleElements;
+ }
+
+ public int getDefaultMinOccurs() {
+ return defaultMinOccurs;
+ }
+
+ public void setDefaultMinOccurs(int defaultMinOccurs) {
+ this.defaultMinOccurs = defaultMinOccurs;
+ }
+
+ public boolean isDefaultNillable() {
+ return defaultNillable;
+ }
+
+ public void setDefaultNillable(boolean defaultNillable) {
+ this.defaultNillable = defaultNillable;
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,181 @@
+/**
+ * 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.aegis.type;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Contains type mappings for java/qname pairs.
+ *
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * @since Feb 21, 2004
+ */
+public class CustomTypeMapping implements TypeMapping {
+ private static final Log LOG = LogFactory.getLog(CustomTypeMapping.class);
+
+ private Map<Class, Type> class2Type;
+
+ private Map<QName, Type> xml2Type;
+
+ private Map<Class, QName> class2xml;
+
+ private TypeMapping defaultTM;
+
+ private String encodingStyleURI;
+
+ private TypeCreator typeCreator;
+
+ public CustomTypeMapping(TypeMapping defaultTM) {
+ this();
+
+ this.defaultTM = defaultTM;
+ }
+
+ public CustomTypeMapping() {
+ class2Type = Collections.synchronizedMap(new HashMap<Class, Type>());
+ class2xml = Collections.synchronizedMap(new HashMap<Class, QName>());
+ xml2Type = Collections.synchronizedMap(new HashMap<QName, Type>());
+ }
+
+ public boolean isRegistered(Class javaType) {
+ boolean registered = class2Type.containsKey(javaType);
+
+ if (!registered && defaultTM != null) {
+ registered = defaultTM.isRegistered(javaType);
+ }
+
+ return registered;
+ }
+
+ public boolean isRegistered(QName xmlType) {
+ boolean registered = xml2Type.containsKey(xmlType);
+
+ if (!registered && defaultTM != null) {
+ registered = defaultTM.isRegistered(xmlType);
+ }
+
+ return registered;
+ }
+
+ public void register(Class javaType, QName xmlType, Type type) {
+ type.setSchemaType(xmlType);
+ type.setTypeClass(javaType);
+
+ register(type);
+ }
+
+ public void register(Type type) {
+ type.setTypeMapping(this);
+ /*
+ * -- prb@codehaus.org; changing this to only register the type for
+ * actions that it supports, and it could be none.
+ */
+ if (type.getTypeClass() != null) {
+ class2xml.put(type.getTypeClass(), type.getSchemaType());
+ class2Type.put(type.getTypeClass(), type);
+ }
+ if (type.getSchemaType() != null) {
+ xml2Type.put(type.getSchemaType(), type);
+ }
+ if (type.getTypeClass() == null && type.getSchemaType() == null) {
+ LOG
+ .warn("The type "
+ + type.getClass().getName()
+ + " supports neither serialization (non-null TypeClass) nor deserialization (non-null SchemaType).");
+ }
+ }
+
+ public void removeType(Type type) {
+ if (!xml2Type.containsKey(type.getSchemaType())) {
+ defaultTM.removeType(type);
+ } else {
+ xml2Type.remove(type.getSchemaType());
+ class2Type.remove(type.getTypeClass());
+ class2xml.remove(type.getTypeClass());
+ }
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMapping#getType(java.lang.Class)
+ */
+ public Type getType(Class javaType) {
+ Type type = class2Type.get(javaType);
+
+ if (type == null && defaultTM != null) {
+ type = defaultTM.getType(javaType);
+ }
+
+ return type;
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMapping#getType(javax.xml.namespace.QName)
+ */
+ public Type getType(QName xmlType) {
+ Type type = xml2Type.get(xmlType);
+
+ if (type == null && defaultTM != null) {
+ type = defaultTM.getType(xmlType);
+ }
+
+ return type;
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMapping#getTypeQName(java.lang.Class)
+ */
+ public QName getTypeQName(Class clazz) {
+ QName qname = class2xml.get(clazz);
+
+ if (qname == null && defaultTM != null) {
+ qname = defaultTM.getTypeQName(clazz);
+ }
+
+ return qname;
+ }
+
+ public String getEncodingStyleURI() {
+ return encodingStyleURI;
+ }
+
+ public void setEncodingStyleURI(String encodingStyleURI) {
+ this.encodingStyleURI = encodingStyleURI;
+ }
+
+ public TypeCreator getTypeCreator() {
+ return typeCreator;
+ }
+
+ public void setTypeCreator(TypeCreator typeCreator) {
+ this.typeCreator = typeCreator;
+
+ typeCreator.setTypeMapping(this);
+ }
+
+ public TypeMapping getParent() {
+ return defaultTM;
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/CustomTypeMapping.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,78 @@
+/**
+ * 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.aegis.type;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.basic.BeanType;
+import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
+
+public class DefaultTypeCreator extends AbstractTypeCreator {
+ public DefaultTypeCreator() {
+ }
+
+ public DefaultTypeCreator(Configuration configuration) {
+ setConfiguration(configuration);
+ }
+
+ @Override
+ public TypeClassInfo createClassInfo(Method m, int index) {
+ TypeClassInfo info = new TypeClassInfo();
+
+ if (index >= 0) {
+ info.setTypeClass(m.getParameterTypes()[index]);
+ } else {
+ info.setTypeClass(m.getReturnType());
+ }
+
+ return info;
+ }
+
+ @Override
+ public TypeClassInfo createClassInfo(PropertyDescriptor pd) {
+ return createBasicClassInfo(pd.getPropertyType());
+ }
+
+ @Override
+ public Type createCollectionType(TypeClassInfo info) {
+ if (info.getGenericType() == null) {
+ throw new DatabindingException("Cannot create mapping for " + info.getTypeClass().getName()
+ + ", unspecified component type for " + info.getDescription());
+ }
+
+ return createCollectionTypeFromGeneric(info);
+ }
+
+ @Override
+ public Type createDefaultType(TypeClassInfo info) {
+ BeanType type = new BeanType();
+ type.setSchemaType(createQName(info.getTypeClass()));
+ type.setTypeClass(info.getTypeClass());
+ type.setTypeMapping(getTypeMapping());
+
+ BeanTypeInfo typeInfo = type.getTypeInfo();
+ typeInfo.setDefaultMinOccurs(getConfiguration().getDefaultMinOccurs());
+ typeInfo.setExtensibleAttributes(getConfiguration().isDefaultExtensibleAttributes());
+ typeInfo.setExtensibleElements(getConfiguration().isDefaultExtensibleElements());
+
+ return type;
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,457 @@
+/**
+ * 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.aegis.type;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URI;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+
+import org.w3c.dom.Document;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.basic.Base64Type;
+import org.apache.cxf.aegis.type.basic.BigDecimalType;
+import org.apache.cxf.aegis.type.basic.BigIntegerType;
+import org.apache.cxf.aegis.type.basic.BooleanType;
+import org.apache.cxf.aegis.type.basic.CalendarType;
+import org.apache.cxf.aegis.type.basic.CharacterType;
+import org.apache.cxf.aegis.type.basic.DateTimeType;
+import org.apache.cxf.aegis.type.basic.DoubleType;
+import org.apache.cxf.aegis.type.basic.FloatType;
+import org.apache.cxf.aegis.type.basic.IntType;
+import org.apache.cxf.aegis.type.basic.LongType;
+import org.apache.cxf.aegis.type.basic.ObjectType;
+import org.apache.cxf.aegis.type.basic.ShortType;
+import org.apache.cxf.aegis.type.basic.SqlDateType;
+import org.apache.cxf.aegis.type.basic.StringType;
+import org.apache.cxf.aegis.type.basic.TimeType;
+import org.apache.cxf.aegis.type.basic.TimestampType;
+import org.apache.cxf.aegis.type.basic.URIType;
+import org.apache.cxf.aegis.type.mtom.DataHandlerType;
+import org.apache.cxf.aegis.type.mtom.DataSourceType;
+import org.apache.cxf.aegis.type.xml.DocumentType;
+import org.apache.cxf.aegis.type.xml.JDOMDocumentType;
+import org.apache.cxf.aegis.type.xml.JDOMElementType;
+import org.apache.cxf.aegis.type.xml.SourceType;
+import org.apache.cxf.aegis.type.xml.XMLStreamReaderType;
+import org.apache.cxf.aegis.util.XmlConstants;
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.jdom.Element;
+
+/**
+ * The default implementation of TypeMappingRegistry.
+ *
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * @since Feb 22, 2004
+ */
+public class DefaultTypeMappingRegistry implements TypeMappingRegistry {
+ private static final Log logger = LogFactory.getLog(DefaultTypeMappingRegistry.class);
+
+ protected static final QName XSD_STRING = new QName(XmlConstants.XSD, "string", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_LONG = new QName(XmlConstants.XSD, "long", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_FLOAT = new QName(XmlConstants.XSD, "float", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_DOUBLE = new QName(XmlConstants.XSD, "double", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_INT = new QName(XmlConstants.XSD, "int", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_SHORT = new QName(XmlConstants.XSD, "short", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_BOOLEAN = new QName(XmlConstants.XSD, "boolean", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_DATETIME = new QName(XmlConstants.XSD, "dateTime",
+ XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_TIME = new QName(XmlConstants.XSD, "dateTime", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_BASE64 = new QName(XmlConstants.XSD, "base64Binary",
+ XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_DECIMAL = new QName(XmlConstants.XSD, "decimal", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_INTEGER = new QName(XmlConstants.XSD, "integer", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_URI = new QName(XmlConstants.XSD, "anyURI", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_ANY = new QName(XmlConstants.XSD, "anyType", XmlConstants.XSD_PREFIX);
+
+ protected static final QName XSD_DATE = new QName(XmlConstants.XSD, "date", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_DURATION = new QName(XmlConstants.XSD, "duration",
+ XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_G_YEAR_MONTH = new QName(XmlConstants.XSD, "gYearMonth",
+ XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_G_MONTH_DAY = new QName(XmlConstants.XSD, "gMonthDay",
+ XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_G_YEAR = new QName(XmlConstants.XSD, "gYear", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_G_MONTH = new QName(XmlConstants.XSD, "gMonth", XmlConstants.XSD_PREFIX);
+ protected static final QName XSD_G_DAY = new QName(XmlConstants.XSD, "gDay", XmlConstants.XSD_PREFIX);
+
+ protected static final String ENCODED_NS = Soap11.getInstance().getSoapEncodingStyle();
+ protected static final QName ENCODED_STRING = new QName(ENCODED_NS, "string");
+ protected static final QName ENCODED_LONG = new QName(ENCODED_NS, "long");
+ protected static final QName ENCODED_FLOAT = new QName(ENCODED_NS, "float");
+ protected static final QName ENCODED_CHAR = new QName(ENCODED_NS, "char");
+ protected static final QName ENCODED_DOUBLE = new QName(ENCODED_NS, "double");
+ protected static final QName ENCODED_INT = new QName(ENCODED_NS, "int");
+ protected static final QName ENCODED_SHORT = new QName(ENCODED_NS, "short");
+ protected static final QName ENCODED_BOOLEAN = new QName(ENCODED_NS, "boolean");
+ protected static final QName ENCODED_DATETIME = new QName(ENCODED_NS, "dateTime");
+ protected static final QName ENCODED_BASE64 = new QName(ENCODED_NS, "base64Binary");
+ protected static final QName ENCODED_DECIMAL = new QName(ENCODED_NS, "decimal");
+ protected static final QName ENCODED_INTEGER = new QName(ENCODED_NS, "integer");
+
+ private Map<String, TypeMapping> registry;
+
+ private TypeMapping defaultTM;
+
+ private TypeCreator typeCreator;
+
+ private Configuration typeConfiguration;
+
+ public DefaultTypeMappingRegistry() {
+ this(false);
+ }
+
+ public DefaultTypeMappingRegistry(boolean createDefault) {
+ this(null, createDefault);
+ }
+
+ public DefaultTypeMappingRegistry(TypeCreator typeCreator, boolean createDefault) {
+ registry = Collections.synchronizedMap(new HashMap<String, TypeMapping>());
+
+ this.typeCreator = typeCreator;
+ this.typeConfiguration = new Configuration();
+
+ if (createDefault) {
+ createDefaultMappings();
+ }
+ }
+
+ public TypeMapping register(String encodingStyleURI, TypeMapping mapping) {
+ TypeMapping previous = registry.get(encodingStyleURI);
+
+ mapping.setEncodingStyleURI(encodingStyleURI);
+
+ registry.put(encodingStyleURI, mapping);
+
+ return previous;
+ }
+
+ public void registerDefault(TypeMapping mapping) {
+ defaultTM = mapping;
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#getDefaultTypeMapping()
+ */
+ public TypeMapping getDefaultTypeMapping() {
+ return defaultTM;
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#getRegisteredEncodingStyleURIs()
+ */
+ public String[] getRegisteredEncodingStyleURIs() {
+ return registry.keySet().toArray(new String[registry.size()]);
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#getTypeMapping(java.lang.String)
+ */
+ public TypeMapping getTypeMapping(String encodingStyleURI) {
+ return registry.get(encodingStyleURI);
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#createTypeMapping(boolean)
+ */
+ public TypeMapping createTypeMapping(boolean autoTypes) {
+ return createTypeMapping(getDefaultTypeMapping(), autoTypes);
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#createTypeMapping(String,
+ * boolean)
+ */
+ public TypeMapping createTypeMapping(String parentNamespace, boolean autoTypes) {
+ return createTypeMapping(getTypeMapping(parentNamespace), autoTypes);
+ }
+
+ protected TypeMapping createTypeMapping(TypeMapping parent, boolean autoTypes) {
+ CustomTypeMapping tm = new CustomTypeMapping(parent);
+
+ if (autoTypes) {
+ tm.setTypeCreator(createTypeCreator());
+ }
+
+ return tm;
+ }
+
+ public TypeCreator getTypeCreator() {
+ if (typeCreator == null) {
+ typeCreator = createTypeCreator();
+ }
+
+ return typeCreator;
+ }
+
+ public void setTypeCreator(TypeCreator typeCreator) {
+ this.typeCreator = typeCreator;
+ }
+
+ protected TypeCreator createTypeCreator() {
+ AbstractTypeCreator xmlCreator = createRootTypeCreator();
+ xmlCreator.setNextCreator(createDefaultTypeCreator());
+
+ if (isJDK5andAbove()) {
+ try {
+ String j5TC = "org.apache.cxf.aegis.type.java5.Java5TypeCreator";
+
+ Class clazz = ClassLoaderUtils.loadClass(j5TC, getClass());
+
+ AbstractTypeCreator j5Creator = (AbstractTypeCreator)clazz.newInstance();
+ j5Creator.setNextCreator(createDefaultTypeCreator());
+ j5Creator.setConfiguration(getConfiguration());
+ xmlCreator.setNextCreator(j5Creator);
+ } catch (Throwable t) {
+ logger
+ .info("Couldn't find Java 5 module on classpath. Annotation mappings will not be supported.");
+
+ if (!(t instanceof ClassNotFoundException)) {
+ logger.debug("Error loading Java 5 module", t);
+ }
+ }
+ }
+
+ return xmlCreator;
+ }
+
+ boolean isJDK5andAbove() {
+ String v = System.getProperty("java.class.version", "44.0");
+ return ("49.0".compareTo(v) <= 0);
+ }
+
+ protected AbstractTypeCreator createRootTypeCreator() {
+ AbstractTypeCreator creator = new XMLTypeCreator();
+ creator.setConfiguration(getConfiguration());
+ return creator;
+ }
+
+ protected AbstractTypeCreator createDefaultTypeCreator() {
+ AbstractTypeCreator creator = new DefaultTypeCreator();
+ creator.setConfiguration(getConfiguration());
+ return creator;
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#unregisterTypeMapping(java.lang.String)
+ */
+ public TypeMapping unregisterTypeMapping(String encodingStyleURI) {
+ TypeMapping tm = registry.get(encodingStyleURI);
+ registry.remove(encodingStyleURI);
+ return tm;
+ }
+
+ public boolean removeTypeMapping(TypeMapping mapping) {
+ int n = 0;
+
+ for (Iterator itr = registry.values().iterator(); itr.hasNext();) {
+ if (itr.next().equals(mapping)) {
+ itr.remove();
+ n++;
+ }
+ }
+
+ return (n > 0);
+ }
+
+ /**
+ * @see org.apache.cxf.aegis.type.TypeMappingRegistry#clear()
+ */
+ public void clear() {
+ registry.clear();
+ }
+
+ public TypeMapping createDefaultMappings() {
+ TypeMapping tm = createTypeMapping(false);
+
+ createDefaultMappings(tm);
+
+ // Create a Type Mapping for SOAP 1.1 Encoding
+ TypeMapping soapTM = createTypeMapping(tm, false);
+
+ register(soapTM, boolean.class, ENCODED_BOOLEAN, new BooleanType());
+ register(soapTM, int.class, ENCODED_INT, new IntType());
+ register(soapTM, short.class, ENCODED_SHORT, new ShortType());
+ register(soapTM, double.class, ENCODED_DOUBLE, new DoubleType());
+ register(soapTM, float.class, ENCODED_FLOAT, new FloatType());
+ register(soapTM, long.class, ENCODED_LONG, new LongType());
+ register(soapTM, char.class, ENCODED_CHAR, new CharacterType());
+ register(soapTM, Character.class, ENCODED_CHAR, new CharacterType());
+ register(soapTM, String.class, ENCODED_STRING, new StringType());
+ register(soapTM, Boolean.class, ENCODED_BOOLEAN, new BooleanType());
+ register(soapTM, Integer.class, ENCODED_INT, new IntType());
+ register(soapTM, Short.class, ENCODED_SHORT, new ShortType());
+ register(soapTM, Double.class, ENCODED_DOUBLE, new DoubleType());
+ register(soapTM, Float.class, ENCODED_FLOAT, new FloatType());
+ register(soapTM, Long.class, ENCODED_LONG, new LongType());
+ register(soapTM, Date.class, ENCODED_DATETIME, new DateTimeType());
+ register(soapTM, java.sql.Date.class, ENCODED_DATETIME, new SqlDateType());
+ register(soapTM, Calendar.class, ENCODED_DATETIME, new CalendarType());
+ register(soapTM, byte[].class, ENCODED_BASE64, new Base64Type());
+ register(soapTM, BigDecimal.class, ENCODED_DECIMAL, new BigDecimalType());
+ register(soapTM, BigInteger.class, ENCODED_INTEGER, new BigIntegerType());
+
+ register(soapTM, boolean.class, XSD_BOOLEAN, new BooleanType());
+ register(soapTM, int.class, XSD_INT, new IntType());
+ register(soapTM, short.class, XSD_SHORT, new ShortType());
+ register(soapTM, double.class, XSD_DOUBLE, new DoubleType());
+ register(soapTM, float.class, XSD_FLOAT, new FloatType());
+ register(soapTM, long.class, XSD_LONG, new LongType());
+ register(soapTM, String.class, XSD_STRING, new StringType());
+ register(soapTM, Boolean.class, XSD_BOOLEAN, new BooleanType());
+ register(soapTM, Integer.class, XSD_INT, new IntType());
+ register(soapTM, Short.class, XSD_SHORT, new ShortType());
+ register(soapTM, Double.class, XSD_DOUBLE, new DoubleType());
+ register(soapTM, Float.class, XSD_FLOAT, new FloatType());
+ register(soapTM, Long.class, XSD_LONG, new LongType());
+ register(soapTM, Date.class, XSD_DATETIME, new DateTimeType());
+ register(soapTM, java.sql.Date.class, XSD_DATETIME, new SqlDateType());
+ register(soapTM, Time.class, XSD_TIME, new TimeType());
+ register(soapTM, Timestamp.class, XSD_DATETIME, new TimestampType());
+ register(soapTM, Calendar.class, XSD_DATETIME, new CalendarType());
+ register(soapTM, byte[].class, XSD_BASE64, new Base64Type());
+ register(soapTM, BigDecimal.class, XSD_DECIMAL, new BigDecimalType());
+ register(soapTM, URI.class, XSD_URI, new URIType());
+ register(soapTM, Document.class, XSD_ANY, new DocumentType());
+ register(soapTM, Source.class, XSD_ANY, new SourceType());
+ register(soapTM, XMLStreamReader.class, XSD_ANY, new XMLStreamReaderType());
+ register(soapTM, Element.class, XSD_ANY, new JDOMElementType());
+ register(soapTM, org.jdom.Document.class, XSD_ANY, new JDOMDocumentType());
+ register(soapTM, Object.class, XSD_ANY, new ObjectType());
+ register(soapTM, DataSource.class, XSD_BASE64, new DataSourceType());
+ register(soapTM, DataHandler.class, XSD_BASE64, new DataHandlerType());
+ register(soapTM, BigInteger.class, XSD_INTEGER, new BigIntegerType());
+
+ register(ENCODED_NS, soapTM);
+
+ register(XmlConstants.XSD, tm);
+ registerDefault(tm);
+
+ return tm;
+ }
+
+ protected void createDefaultMappings(TypeMapping tm) {
+ register(tm, boolean.class, XSD_BOOLEAN, new BooleanType());
+ register(tm, int.class, XSD_INT, new IntType());
+ register(tm, short.class, XSD_SHORT, new ShortType());
+ register(tm, double.class, XSD_DOUBLE, new DoubleType());
+ register(tm, float.class, XSD_FLOAT, new FloatType());
+ register(tm, long.class, XSD_LONG, new LongType());
+ register(tm, char.class, XSD_STRING, new CharacterType());
+ register(tm, Character.class, XSD_STRING, new CharacterType());
+ register(tm, String.class, XSD_STRING, new StringType());
+ register(tm, Boolean.class, XSD_BOOLEAN, new BooleanType());
+ register(tm, Integer.class, XSD_INT, new IntType());
+ register(tm, Short.class, XSD_SHORT, new ShortType());
+ register(tm, Double.class, XSD_DOUBLE, new DoubleType());
+ register(tm, Float.class, XSD_FLOAT, new FloatType());
+ register(tm, Long.class, XSD_LONG, new LongType());
+ register(tm, Date.class, XSD_DATETIME, new DateTimeType());
+ register(tm, java.sql.Date.class, XSD_DATETIME, new SqlDateType());
+ register(tm, Time.class, XSD_TIME, new TimeType());
+ register(tm, Timestamp.class, XSD_DATETIME, new TimestampType());
+ register(tm, Calendar.class, XSD_DATETIME, new CalendarType());
+ register(tm, byte[].class, XSD_BASE64, new Base64Type());
+ register(tm, BigDecimal.class, XSD_DECIMAL, new BigDecimalType());
+ register(tm, BigInteger.class, XSD_INTEGER, new BigIntegerType());
+ register(tm, URI.class, XSD_URI, new URIType());
+ register(tm, Document.class, XSD_ANY, new DocumentType());
+ register(tm, Source.class, XSD_ANY, new SourceType());
+ register(tm, XMLStreamReader.class, XSD_ANY, new XMLStreamReaderType());
+ register(tm, Element.class, XSD_ANY, new JDOMElementType());
+ register(tm, org.jdom.Document.class, XSD_ANY, new JDOMDocumentType());
+ register(tm, Object.class, XSD_ANY, new ObjectType());
+ register(tm, DataSource.class, XSD_BASE64, new DataSourceType());
+ register(tm, DataHandler.class, XSD_BASE64, new DataHandlerType());
+
+ if (isJDK5andAbove()) {
+ registerIfAvailable(tm, "javax.xml.datatype.Duration", XSD_DURATION,
+ "org.codehaus.xfire.aegis.type.java5.DurationType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_DATE,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_TIME,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_DAY,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_MONTH,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_MONTH_DAY,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_YEAR,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_G_YEAR_MONTH,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ registerIfAvailable(tm, "javax.xml.datatype.XMLGregorianCalendar", XSD_DATETIME,
+ "org.codehaus.xfire.aegis.type.java5.XMLGregorianCalendarType");
+ }
+ }
+
+ protected void registerIfAvailable(TypeMapping tm, String className, QName typeName, String typeClassName) {
+ try {
+ Class cls = ClassLoaderUtils.loadClass(className, getClass());
+ Class typeCls = ClassLoaderUtils.loadClass(typeClassName, getClass());
+ try {
+ Type type = (Type)typeCls.newInstance();
+
+ register(tm, cls, typeName, type);
+ } catch (InstantiationException e) {
+ throw new DatabindingException("Couldn't instantiate Type ", e);
+ } catch (IllegalAccessException e) {
+ throw new DatabindingException("Couldn't instantiate Type ", e);
+ }
+ } catch (ClassNotFoundException e) {
+ logger.debug("Could not find optional Type " + className + ". Skipping.");
+ }
+
+ }
+
+ protected void register(TypeMapping tm, Class class1, QName name, Type type) {
+ if (!getConfiguration().isDefaultNillable()) {
+ type.setNillable(false);
+ }
+
+ tm.register(class1, name, type);
+ }
+
+ public Configuration getConfiguration() {
+ return typeConfiguration;
+ }
+
+ public void setConfiguration(Configuration typeConfiguration) {
+ this.typeConfiguration = typeConfiguration;
+ }
+
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,211 @@
+/**
+ * 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.aegis.type;
+
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.aegis.Context;
+import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.xml.MessageReader;
+import org.apache.cxf.aegis.xml.MessageWriter;
+import org.jdom.Element;
+
+/**
+ * A Type reads and writes XML fragments to create and write objects.
+ *
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ */
+public abstract class Type {
+
+ protected Class typeClass;
+
+ private QName schemaType;
+
+ private TypeMapping typeMapping;
+
+ private boolean abstrct = true;
+
+ private boolean nillable = true;
+
+ private boolean writeOuter = true;
+
+ public Type() {
+ }
+
+ /**
+ * Read in the XML fragment and create an object.
+ *
+ * @param reader
+ * @param context
+ * @return
+ * @throws DatabindingException
+ */
+ public abstract Object readObject(MessageReader reader, Context context) throws DatabindingException;
+
+ /**
+ * Writes the object to the MessageWriter.
+ *
+ * @param object
+ * @param writer
+ * @param context
+ * @throws DatabindingException
+ */
+ public abstract void writeObject(Object object, MessageWriter writer, Context context)
+ throws DatabindingException;
+
+ public void writeSchema(Element root) {
+ }
+
+ /**
+ * @return Returns the typeMapping.
+ */
+ public TypeMapping getTypeMapping() {
+ return typeMapping;
+ }
+
+ /**
+ * @param typeMapping The typeMapping to set.
+ */
+ public void setTypeMapping(TypeMapping typeMapping) {
+ this.typeMapping = typeMapping;
+ }
+
+ /**
+ * @return Returns the typeClass.
+ */
+ public Class getTypeClass() {
+ return typeClass;
+ }
+
+ /**
+ * @param typeClass The typeClass to set.
+ */
+ public void setTypeClass(Class typeClass) {
+ this.typeClass = typeClass;
+
+ if (typeClass.isPrimitive()) {
+ setNillable(false);
+ }
+ }
+
+ /**
+ * @return True if a complex type schema must be written.
+ */
+ public boolean isComplex() {
+ return false;
+ }
+
+ public boolean isAbstract() {
+ return abstrct;
+ }
+
+ public void setAbstract(boolean abstrct) {
+ this.abstrct = abstrct;
+ }
+
+ public boolean isNillable() {
+ return nillable;
+ }
+
+ public void setNillable(boolean nillable) {
+ this.nillable = nillable;
+ }
+
+ /**
+ * Return a set of Type dependencies. Returns null if this type has no
+ * dependencies.
+ *
+ * @return Set of <code>Type</code> dependencies
+ */
+ public Set<Type> getDependencies() {
+ return null;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (obj instanceof Type) {
+ Type type = (Type)obj;
+
+ if (type.getSchemaType().equals(getSchemaType()) && type.getTypeClass().equals(getTypeClass())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashcode = 0;
+
+ if (getTypeClass() != null) {
+ hashcode ^= getTypeClass().hashCode();
+ }
+
+ if (getSchemaType() != null) {
+ hashcode ^= getSchemaType().hashCode();
+ }
+
+ return hashcode;
+ }
+
+ /**
+ * @return Get the schema type.
+ */
+ public QName getSchemaType() {
+ return schemaType;
+ }
+
+ /**
+ * @param name The qName to set.
+ */
+ public void setSchemaType(QName name) {
+ schemaType = name;
+ }
+
+ public boolean isWriteOuter() {
+ return writeOuter;
+ }
+
+ public void setWriteOuter(boolean writeOuter) {
+ this.writeOuter = writeOuter;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer(getClass().getName());
+ sb.append("[class=");
+ Class c = getTypeClass();
+ sb.append((c == null) ? ("<null>") : (c.getName()));
+ sb.append(",\nQName=");
+ QName q = getSchemaType();
+ sb.append((q == null) ? ("<null>") : (q.toString()));
+ sb.append("]");
+ return sb.toString();
+ }
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Type.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,49 @@
+/**
+ * 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.aegis.type;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ */
+public interface TypeCreator {
+ /**
+ * Get the mapped name of a method parameter.
+ *
+ * @param m
+ * @param index
+ * @return
+ */
+ QName getElementName(Method m, int index);
+
+ Type createType(Method m, int index);
+
+ Type createType(PropertyDescriptor pd);
+
+ Type createType(Field f);
+
+ Type createType(Class clazz);
+
+ void setTypeMapping(TypeMapping typeMapping);
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeCreator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,59 @@
+/**
+ * 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.aegis.type;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * @since Feb 18, 2004
+ */
+public interface TypeMapping {
+ /**
+ * Checks whether or not type mapping between specified XML type and Java
+ * type is registered.
+ *
+ * @param javaType Class of the Java type
+ * @param xmlType Qualified name of the XML data type
+ * @return boolean; <code>true</code> if type mapping between the
+ * specified XML type and Java type is registered; otherwise
+ * <code>false</code>
+ */
+ public boolean isRegistered(Class javaType);
+
+ public boolean isRegistered(QName xmlType);
+
+ public void register(Class javaType, QName xmlType, Type type);
+
+ public void register(Type type);
+
+ public void removeType(Type type);
+
+ public Type getType(Class javaType);
+
+ public Type getType(QName xmlType);
+
+ public QName getTypeQName(Class clazz);
+
+ public String getEncodingStyleURI();
+
+ public void setEncodingStyleURI(String encodingStyleURI);
+
+ public TypeCreator getTypeCreator();
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMapping.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java?view=auto&rev=515734
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java (added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java Wed Mar 7 12:20:07 2007
@@ -0,0 +1,117 @@
+/**
+ * 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.aegis.type;
+
+/**
+ * The TypeMappingRegistry provides access to the type mappings within XFire.
+ *
+ * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
+ * @since Feb 18, 2004
+ */
+public interface TypeMappingRegistry {
+ String ROLE = TypeMappingRegistry.class.getName();
+
+ /**
+ */
+ public TypeMapping register(String encodingStyleURI, TypeMapping mapping);
+
+ /**
+ */
+ public void registerDefault(TypeMapping mapping);
+
+ /**
+ * Gets the registered default <code>TypeMapping</code> instance. This
+ * method returns <code>null</code> if there is no registered default
+ * TypeMapping in the registry.
+ *
+ * @return The registered default <code>TypeMapping</code> instance or
+ * <code>null</code>.
+ */
+ public TypeMapping getDefaultTypeMapping();
+
+ /**
+ * Returns a list of registered encodingStyle URIs in this
+ * <code>TypeMappingRegistry</code> instance.
+ *
+ * @return Array of the registered encodingStyle URIs
+ */
+ public String[] getRegisteredEncodingStyleURIs();
+
+ /**
+ * Returns the registered <code>TypeMapping</code> for the specified
+ * encodingStyle URI. If there is no registered <code>TypeMapping</code>
+ * for the specified <code>encodingStyleURI</code>, this method returns
+ * <code>null</code>.
+ *
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return TypeMapping for the specified encodingStyleURI or
+ * <code>null</code>
+ */
+ public TypeMapping getTypeMapping(String encodingStyleURI);
+
+ /**
+ * Creates a new empty <code>TypeMapping</code> object.
+ *
+ * @return TypeMapping instance.
+ */
+ public TypeMapping createTypeMapping(boolean autoTypes);
+
+ /**
+ * Create a type mapping with the specified encodying style.
+ *
+ * @param parentEncodingStyleURI Encoding style of the parent
+ * <code>TypeMapping</code> specified as an URI
+ * @param autoTypes Should this mapping auto-generate types where possible
+ * @return TypeMapping instance
+ */
+ public TypeMapping createTypeMapping(String parentEncodingStyleURI, boolean autoTypes);
+
+ /**
+ * Unregisters a TypeMapping instance, if present, from the specified
+ * encodingStyleURI.
+ *
+ * @param encodingStyleURI Encoding style specified as an URI
+ * @return <code>TypeMapping</code> instance that has been unregistered or
+ * <code>null</code> if there was no TypeMapping registered for
+ * the specified <code>encodingStyleURI</code>
+ */
+ public TypeMapping unregisterTypeMapping(String encodingStyleURI);
+
+ /**
+ * Removes a <code>TypeMapping</code> from the TypeMappingRegistry. A
+ * <code>TypeMapping</code> is associated with 1 or more
+ * encodingStyleURIs. This method unregisters the specified
+ * <code>TypeMapping</code> instance from all associated
+ * <code>encodingStyleURIs</code> and then removes this TypeMapping
+ * instance from the registry.
+ *
+ * @param mapping TypeMapping to remove
+ * @return <code>true</code> if specified <code>TypeMapping</code> is
+ * removed from the TypeMappingRegistry; <code>false</code> if the
+ * specified <code>TypeMapping</code> was not in the
+ * <code>TypeMappingRegistry</code>
+ */
+ public boolean removeTypeMapping(TypeMapping mapping);
+
+ /**
+ * Removes all registered TypeMappings and encodingStyleURIs from this
+ * TypeMappingRegistry.
+ */
+ public void clear();
+}
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/TypeMappingRegistry.java
------------------------------------------------------------------------------
svn:keywords = Rev Date