Author: andreasmyth
Date: Fri Sep 8 08:16:35 2006
New Revision: 441529
URL: http://svn.apache.org/viewvc?view=rev&rev=441529
Log:
[JIRA CXF-23] Ported JAXB based property editors (used to handle child elements of a value element) to Spring 2.0.
Registration of same to take place by configuring Spring's PropertyEditorRegistrar and CustomEditorConfigurer.
Added:
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java (with props)
incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/
- copied from r441033, incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/impl/
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml (with props)
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml (with props)
incubator/cxf/trunk/common/src/test/resources/schemas/
incubator/cxf/trunk/common/src/test/resources/schemas/configuration/
incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd (with props)
Removed:
incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/impl/
Modified:
incubator/cxf/trunk/common/pom.xml
incubator/cxf/trunk/pom.xml
Modified: incubator/cxf/trunk/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/pom.xml?view=diff&rev=441529&r1=441528&r2=441529
==============================================================================
--- incubator/cxf/trunk/common/pom.xml (original)
+++ incubator/cxf/trunk/common/pom.xml Fri Sep 8 08:16:35 2006
@@ -34,8 +34,29 @@
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
+ <!--
+ use the 2.0.1 version of jaxb.impl because that is the version used by the codegenerator
+ (maven xjc plugin) as opposed to codegen-plugin
+ -->
+ <jaxb.impl.version.test>2.0.1</jaxb.impl.version.test>
+ <!--
+ see comment on build element below
+ -->
+ <checkstyle.excludes>**/build/**/*.java,**/foo/*.java</checkstyle.excludes>
+ <pmd.excludes>**/build/**/*.java,**/foo/*.java</pmd.excludes>
</properties>
+ <!--
+ <pluginRepositories>
+ <pluginRepository>
+ <id>java.net</id>
+ <name>java.net Maven Repository</name>
+ <url>https://maven-repository.dev.java.net/nonav/repository/</url>
+ <layout>legacy</layout>
+ </pluginRepository>
+ </pluginRepositories>
+ -->
+
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -55,9 +76,32 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+ <dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
@@ -72,6 +116,19 @@
</dependency>
<dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>${jaxb.impl.version.test}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>${jaxb.impl.version.test}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<scope>provided</scope>
@@ -92,5 +149,50 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>jaxme</groupId>
+ <artifactId>jaxme2</artifactId>
+ <version>0.5.1</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
+
+ <!--
+ asmyth: It seems we cannot code-generate here without extensions and subsequently
+ run the plugin with extensions in cxf-tools-xjc-dv-test, cxf-tools-xjc-cfg-test.
+ Looks like a bug in maven.
+ -->
+
+ <!--
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <configuration>
+ <generateDirectory>${basedir}/target/generated/src/test/java</generateDirectory>
+ <schemaDirectory>${basedir}/src/test/resources/schemas/configuration</schemaDirectory>
+ <includeSchema>*.xsd</includeSchema>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-xjc-dv</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ -->
+
</project>
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java Fri Sep 8 08:16:35 2006
@@ -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.configuration;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.i18n.UncheckedException;
+
+public class ConfigurationException extends UncheckedException {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * Constructs a <code>ConfigurationException</code> with the provided detail message.
+ */
+ public ConfigurationException(Message msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs a <code>ConfigurationException</code> with the detail message and cause
+ * provided.
+ */
+ public ConfigurationException(Message msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ /**
+ * Constructs a <code>ConfigurationException</code> with the provided cause.
+ */
+ public ConfigurationException(Throwable cause) {
+ super(cause);
+ }
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/ConfigurationException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,80 @@
+/**
+ * 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.configuration.spring;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.Configurable;
+import org.apache.cxf.configuration.Configurer;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.wiring.BeanConfigurerSupport;
+import org.springframework.beans.factory.wiring.BeanWiringInfo;
+import org.springframework.beans.factory.wiring.BeanWiringInfoResolver;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class ConfigurerImpl extends BeanConfigurerSupport implements Configurer {
+
+ private static final Logger LOG = LogUtils.getL7dLogger(ConfigurerImpl.class);
+ private static final String DEFAULT_USER_CFG_FILE = "cxf.xml";
+
+ public ConfigurerImpl() {
+ this(DEFAULT_USER_CFG_FILE);
+ }
+
+ public ConfigurerImpl(String cfgFile) {
+ ApplicationContext appContext = new ClassPathXmlApplicationContext(cfgFile);
+ setApplicationContext(appContext);
+ }
+
+ public ConfigurerImpl(ApplicationContext appContext) {
+ setApplicationContext(appContext);
+ }
+
+ public void configureBean(Configurable beanInstance) {
+
+ final String beanName = beanInstance.getBeanName();
+
+ setBeanWiringInfoResolver(new BeanWiringInfoResolver() {
+ public BeanWiringInfo resolveWiringInfo(Object instance) {
+ if (null != beanName && !"".equals(beanName)) {
+ return new BeanWiringInfo(beanName);
+ }
+ return null;
+ }
+ });
+
+ try {
+ super.configureBean(beanInstance);
+ LOG.fine("Successfully performed injection.");
+ } catch (NoSuchBeanDefinitionException ex) {
+ // users often wonder why the settings in their configuration files seem
+ // to have no effect - the most common cause is that they have been using
+ // incorrect bean ids
+ LOG.log(Level.INFO, "NO_MATCHING_BEAN", beanName);
+ }
+ }
+
+ private void setApplicationContext(ApplicationContext appContext) {
+ setBeanFactory(appContext.getAutowireCapableBeanFactory());
+ }
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/ConfigurerImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,36 @@
+/**
+ * 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.configuration.spring;
+
+import org.w3c.dom.Element;
+
+import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
+import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
+import org.springframework.beans.factory.xml.XmlReaderContext;
+
+public class JaxbBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
+
+ @Override
+ protected BeanDefinitionParserDelegate createHelper(XmlReaderContext readerContext, Element root) {
+ BeanDefinitionParserDelegate delegate = new JaxbBeanDefinitionParserDelegate(readerContext);
+ delegate.initDefaults(root);
+ return delegate;
+ }
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionDocumentReader.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java Fri Sep 8 08:16:35 2006
@@ -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.configuration.spring;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
+import org.springframework.beans.factory.xml.XmlReaderContext;
+
+public class JaxbBeanDefinitionParserDelegate extends BeanDefinitionParserDelegate {
+
+ public JaxbBeanDefinitionParserDelegate(XmlReaderContext readerContext) {
+ super(readerContext);
+ }
+
+ public Object parsePropertySubElement(Element elem, String defaultTypeClassName) {
+
+ if (elem.getTagName().equals(VALUE_ELEMENT)) {
+ for (Node nd = elem.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
+ if (Node.ELEMENT_NODE == nd.getNodeType()) {
+ return nd;
+ }
+ }
+ }
+ return super.parsePropertySubElement(elem, defaultTypeClassName);
+ }
+
+
+
+
+
+
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbBeanDefinitionParserDelegate.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,48 @@
+/**
+ * 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.configuration.spring;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class JaxbClassPathXmlApplicationContext extends ClassPathXmlApplicationContext {
+
+ public JaxbClassPathXmlApplicationContext(String configLocation) throws BeansException {
+ super(configLocation);
+ }
+
+ public JaxbClassPathXmlApplicationContext(String[] configLocations) throws BeansException {
+ super(configLocations);
+ }
+
+
+
+ @Override
+ protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) {
+ reader.setDocumentReaderClass(JaxbBeanDefinitionDocumentReader.class);
+ // TODO: check why VALIDATION_XSD complains about mixed content in
+ // value elements - this should be legal according to the xsd
+ reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
+ reader.setNamespaceAware(true);
+
+ }
+
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbClassPathXmlApplicationContext.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,124 @@
+/**
+ * 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.configuration.spring;
+
+import java.beans.PropertyEditorSupport;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.ConfigurationException;
+
+public class JaxbPropertyEditor extends PropertyEditorSupport {
+
+ private static final Logger LOG = LogUtils.getL7dLogger(JaxbPropertyEditor.class);
+ private String packageName;
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public Object getValue() {
+ Object o = super.getValue();
+ if (o instanceof Element) {
+ Element el = (Element)o;
+
+ try {
+ return unmarshal(el);
+ } catch (JAXBException ex) {
+ Message msg = new Message("JAXB_PROPERTY_EDITOR_EXC", LOG,
+ new QName(el.getNamespaceURI(), el.getLocalName()));
+ throw new ConfigurationException(msg, ex);
+ }
+ }
+
+ return o;
+ }
+
+ public String getAsText() {
+ Object o = super.getValue();
+ if (null == o) {
+ return null;
+ } else if (o instanceof Element) {
+ return ((Element)o).getTextContent();
+ }
+ return super.getAsText();
+ }
+
+ public void setAsText(String text) {
+ Object o = super.getValue();
+ if (null == o) {
+ super.setValue(text);
+ } else {
+ super.setAsText(text);
+ }
+ }
+
+ private Object unmarshal(Element data) throws JAXBException {
+ return unmarshal(data, true);
+ }
+
+ private Object unmarshal(Element data, boolean doValidate) throws JAXBException {
+
+ if (LOG.isLoggable(Level.FINE)) {
+ LOG.fine("unmarshalling: element namespaceURI: " + data.getNamespaceURI() + "\n"
+ + " localName: " + data.getLocalName() + "\n");
+ }
+
+ JAXBContext context = null;
+ Object obj = null;
+
+ context = JAXBContext.newInstance(packageName, getClass().getClassLoader());
+ Unmarshaller u = context.createUnmarshaller();
+ /*
+ * if (doValidate) { u.setSchema(schema); }
+ */
+
+ obj = u.unmarshal(data);
+ if (obj instanceof JAXBElement<?>) {
+ JAXBElement<?> el = (JAXBElement<?>)obj;
+ obj = el.getValue();
+ /*
+ * if (el.getName().equals(type)) { obj = el.getValue(); }
+ */
+ }
+
+
+ if (null != obj && LOG.isLoggable(Level.FINE)) {
+ LOG.fine("Unmarshaled value into object of type: " + obj.getClass().getName()
+ + " value: " + obj);
+
+ }
+ return obj;
+ }
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,72 @@
+/**
+ * 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.configuration.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.springframework.beans.PropertyEditorRegistrar;
+import org.springframework.beans.PropertyEditorRegistry;
+
+public class JaxbPropertyEditorRegistrar implements PropertyEditorRegistrar {
+ private String packageName;
+ private List<String> propertyClassNames;
+
+ public JaxbPropertyEditorRegistrar() {
+ propertyClassNames = new ArrayList<String>();
+ }
+
+ public List<String> getPropertyClassNames() {
+ return propertyClassNames;
+ }
+
+ public void setPropertyClassNames(List<String> propertyClassNames) {
+ this.propertyClassNames = propertyClassNames;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ public void registerCustomEditors(PropertyEditorRegistry registry) {
+ if (null != propertyClassNames && propertyClassNames.size() > 0) {
+ JaxbPropertyEditor editor = new JaxbPropertyEditor();
+ editor.setPackageName(packageName);
+ for (String s : propertyClassNames) {
+ String fullClassName = packageName + "." + s;
+ Class cls = null;
+ try {
+ cls = ClassLoaderUtils.loadClass(fullClassName, this.getClass());
+ } catch (ClassNotFoundException ex) {
+ // TODO
+ ex.printStackTrace();
+ }
+ if (null != cls) {
+ registry.registerCustomEditor(cls, editor);
+ }
+ }
+ }
+ }
+}
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorRegistrar.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties (added)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties Fri Sep 8 08:16:35 2006
@@ -0,0 +1,2 @@
+NO_MATCHING_BEAN = Could not find a definition for bean with id {0} - no injection will be performed."
+JAXB_PROPERTY_EDITOR_EXC = Property editor failed to bind element {0}.
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/configuration/spring/Messages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt Fri Sep 8 08:16:35 2006
@@ -0,0 +1,7 @@
+NOTE: subdirectory foo contains code generated from src/test/resources/schemas/configuration/foo.xsd
+using Sun's maven2 jxc plugin.
+The code is checked in to avoid using the maven xjc plugin here as this conflicts with its subsequent
+use in modules where it will be run with extensions, and the dependency on these cannot (and should not)
+be declared here.
+It seems that the classpath for the first execution is used for all subsequent executions.
+
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,143 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2006.09.08 at 03:31:32 PM IST
+//
+
+
+package org.apache.cxf.configuration.foo;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for address complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="address">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="city" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="zip" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="nr" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "address", propOrder = {
+ "city",
+ "zip",
+ "street",
+ "nr"
+})
+public class Address {
+
+ @XmlElement(required = true)
+ protected String city;
+ protected int zip;
+ @XmlElement(required = true)
+ protected String street;
+ protected Integer nr;
+
+ /**
+ * Gets the value of the city property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * Sets the value of the city property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCity(String value) {
+ this.city = value;
+ }
+
+ /**
+ * Gets the value of the zip property.
+ *
+ */
+ public int getZip() {
+ return zip;
+ }
+
+ /**
+ * Sets the value of the zip property.
+ *
+ */
+ public void setZip(int value) {
+ this.zip = value;
+ }
+
+ /**
+ * Gets the value of the street property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getStreet() {
+ return street;
+ }
+
+ /**
+ * Sets the value of the street property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setStreet(String value) {
+ this.street = value;
+ }
+
+ /**
+ * Gets the value of the nr property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getNr() {
+ return nr;
+ }
+
+ /**
+ * Sets the value of the nr property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setNr(Integer value) {
+ this.nr = value;
+ }
+
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Address.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,177 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2006.09.08 at 03:31:32 PM IST
+//
+
+
+package org.apache.cxf.configuration.foo;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for foo complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="foo">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="position" type="{http://cxf.apache.org/configuration/foo}point" minOccurs="0"/>
+ * <element name="address" type="{http://cxf.apache.org/configuration/foo}address" minOccurs="0"/>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="intDefault" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ * <element name="intNoDefault" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "foo", propOrder = {
+ "position",
+ "address",
+ "name",
+ "intDefault",
+ "intNoDefault"
+})
+public class Foo {
+
+ protected Point position;
+ protected Address address;
+ protected String name;
+ @XmlElement(defaultValue = "22")
+ protected Integer intDefault;
+ protected Integer intNoDefault;
+
+ /**
+ * Gets the value of the position property.
+ *
+ * @return
+ * possible object is
+ * {@link Point }
+ *
+ */
+ public Point getPosition() {
+ return position;
+ }
+
+ /**
+ * Sets the value of the position property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Point }
+ *
+ */
+ public void setPosition(Point value) {
+ this.position = value;
+ }
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link Address }
+ *
+ */
+ public Address getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Address }
+ *
+ */
+ public void setAddress(Address value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the intDefault property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getIntDefault() {
+ return intDefault;
+ }
+
+ /**
+ * Sets the value of the intDefault property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setIntDefault(Integer value) {
+ this.intDefault = value;
+ }
+
+ /**
+ * Gets the value of the intNoDefault property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getIntNoDefault() {
+ return intNoDefault;
+ }
+
+ /**
+ * Sets the value of the intNoDefault property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setIntNoDefault(Integer value) {
+ this.intNoDefault = value;
+ }
+
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Foo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2006.09.08 at 03:31:32 PM IST
+//
+
+
+package org.apache.cxf.configuration.foo;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.apache.cxf.configuration.foo package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _Point_QNAME = new QName("http://cxf.apache.org/configuration/foo", "point");
+ private final static QName _Address_QNAME = new QName("http://cxf.apache.org/configuration/foo", "address");
+ private final static QName _Foo_QNAME = new QName("http://cxf.apache.org/configuration/foo", "foo");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.cxf.configuration.foo
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Address }
+ *
+ */
+ public Address createAddress() {
+ return new Address();
+ }
+
+ /**
+ * Create an instance of {@link Foo }
+ *
+ */
+ public Foo createFoo() {
+ return new Foo();
+ }
+
+ /**
+ * Create an instance of {@link Point }
+ *
+ */
+ public Point createPoint() {
+ return new Point();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Point }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "point")
+ public JAXBElement<Point> createPoint(Point value) {
+ return new JAXBElement<Point>(_Point_QNAME, Point.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Address }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "address")
+ public JAXBElement<Address> createAddress(Address value) {
+ return new JAXBElement<Address>(_Address_QNAME, Address.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Foo }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://cxf.apache.org/configuration/foo", name = "foo")
+ public JAXBElement<Foo> createFoo(Foo value) {
+ return new JAXBElement<Foo>(_Foo_QNAME, Foo.class, null, value);
+ }
+
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/ObjectFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,78 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2006.09.08 at 03:31:32 PM IST
+//
+
+
+package org.apache.cxf.configuration.foo;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for point complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="point">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="x" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="y" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "point", propOrder = {
+ "x",
+ "y"
+})
+public class Point {
+
+ protected int x;
+ protected int y;
+
+ /**
+ * Gets the value of the x property.
+ *
+ */
+ public int getX() {
+ return x;
+ }
+
+ /**
+ * Sets the value of the x property.
+ *
+ */
+ public void setX(int value) {
+ this.x = value;
+ }
+
+ /**
+ * Gets the value of the y property.
+ *
+ */
+ public int getY() {
+ return y;
+ }
+
+ /**
+ * Sets the value of the y property.
+ *
+ */
+ public void setY(int value) {
+ this.y = value;
+ }
+
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/Point.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.1-b01-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2006.09.08 at 03:31:32 PM IST
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://cxf.apache.org/configuration/foo", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.cxf.configuration.foo;
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/foo/package-info.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,315 @@
+/**
+ * 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.configuration.spring;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import javax.xml.bind.DatatypeConverter;
+import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.configuration.Configurable;
+import org.apache.ws.jaxme.impl.DatatypeConverterImpl;
+
+public class ConfigurerImplTest extends TestCase {
+
+ static {
+ DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());
+ }
+
+ public void testConfigureSimpleNoMatchingBean() {
+ SimpleBean sb = new SimpleBean("unknown");
+ ConfigurerImpl configurer =
+ new ConfigurerImpl("/org/apache/cxf/configuration/spring/test-beans.xml");
+ configurer.configureBean(sb);
+ assertEquals("Unexpected value for attribute stringAttr",
+ "hello", sb.getStringAttr());
+ assertTrue("Unexpected value for attribute booleanAttr",
+ sb.getBooleanAttr());
+ assertEquals("Unexpected value for attribute integerAttr",
+ BigInteger.ONE, sb.getIntegerAttr());
+ assertEquals("Unexpected value for attribute intAttr",
+ new Integer(2), sb.getIntAttr());
+ assertEquals("Unexpected value for attribute longAttr",
+ new Long(3L), sb.getLongAttr());
+ assertEquals("Unexpected value for attribute shortAttr",
+ new Short((short)4), sb.getShortAttr());
+ assertEquals("Unexpected value for attribute decimalAttr",
+ new BigDecimal("5"), sb.getDecimalAttr());
+ assertEquals("Unexpected value for attribute floatAttr",
+ new Float(6F), sb.getFloatAttr());
+ assertEquals("Unexpected value for attribute doubleAttr",
+ new Double(7D), sb.getDoubleAttr());
+ assertEquals("Unexpected value for attribute byteAttr",
+ new Byte((byte)8), sb.getByteAttr());
+
+ QName qn = sb.getQnameAttr();
+ assertEquals("Unexpected value for attribute qnameAttrNoDefault",
+ "schema", qn.getLocalPart());
+ assertEquals("Unexpected value for attribute qnameAttrNoDefault",
+ "http://www.w3.org/2001/XMLSchema", qn.getNamespaceURI());
+ byte[] expected = DatatypeConverter.parseBase64Binary("abcd");
+ byte[] val = sb.getBase64BinaryAttr();
+ assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected.length, val.length);
+ for (int i = 0; i < expected.length; i++) {
+ assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected[i], val[i]);
+ }
+ expected = new HexBinaryAdapter().unmarshal("aaaa");
+ val = sb.getHexBinaryAttr();
+ assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected.length, val.length);
+ for (int i = 0; i < expected.length; i++) {
+ assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected[i], val[i]);
+ }
+
+ assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
+ new Long(9L), sb.getUnsignedIntAttr());
+ assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
+ new Integer(10), sb.getUnsignedShortAttr());
+ assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
+ new Short((short)11), sb.getUnsignedByteAttr());
+ }
+
+ public void testConfigureSimple() {
+ SimpleBean sb = new SimpleBean("simple");
+ ConfigurerImpl configurer =
+ new ConfigurerImpl("/org/apache/cxf/configuration/spring/test-beans.xml");
+ configurer.configureBean(sb);
+ assertEquals("Unexpected value for attribute stringAttr",
+ "hallo", sb.getStringAttr());
+ assertTrue("Unexpected value for attribute booleanAttr",
+ !sb.getBooleanAttr());
+ assertEquals("Unexpected value for attribute integerAttr",
+ BigInteger.TEN, sb.getIntegerAttr());
+ assertEquals("Unexpected value for attribute intAttr",
+ new Integer(12), sb.getIntAttr());
+ assertEquals("Unexpected value for attribute longAttr",
+ new Long(13L), sb.getLongAttr());
+ assertEquals("Unexpected value for attribute shortAttr",
+ new Short((short)14), sb.getShortAttr());
+ assertEquals("Unexpected value for attribute decimalAttr",
+ new BigDecimal("15"), sb.getDecimalAttr());
+ assertEquals("Unexpected value for attribute floatAttr",
+ new Float(16F), sb.getFloatAttr());
+ assertEquals("Unexpected value for attribute doubleAttr",
+ new Double(17D), sb.getDoubleAttr());
+ assertEquals("Unexpected value for attribute byteAttr",
+ new Byte((byte)18), sb.getByteAttr());
+
+ /*
+ QName qn = sb.getQnameAttr();
+ assertEquals("Unexpected value for attribute qnameAttrNoDefault",
+ "string", qn.getLocalPart());
+ assertEquals("Unexpected value for attribute qnameAttrNoDefault",
+ "http://www.w3.org/2001/XMLSchema", qn.getNamespaceURI());
+ */
+
+ /*
+ byte[] expected = DatatypeConverter.parseBase64Binary("wxyz");
+ byte[] val = sb.getBase64BinaryAttr();
+ assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected.length, val.length);
+ for (int i = 0; i < expected.length; i++) {
+ assertEquals("Unexpected value for attribute base64BinaryAttrNoDefault", expected[i], val[i]);
+ }
+
+ expected = new HexBinaryAdapter().unmarshal("bbbb");
+ val = sb.getHexBinaryAttr();
+ assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected.length, val.length);
+ for (int i = 0; i < expected.length; i++) {
+ assertEquals("Unexpected value for attribute hexBinaryAttrNoDefault", expected[i], val[i]);
+ }
+ */
+
+ assertEquals("Unexpected value for attribute unsignedIntAttrNoDefault",
+ new Long(19L), sb.getUnsignedIntAttr());
+ assertEquals("Unexpected value for attribute unsignedShortAttrNoDefault",
+ new Integer(20), sb.getUnsignedShortAttr());
+ assertEquals("Unexpected value for attribute unsignedByteAttrNoDefault",
+ new Short((short)21), sb.getUnsignedByteAttr());
+ }
+
+ final class SimpleBean implements Configurable {
+
+ private String beanName;
+
+ private String stringAttr = "hello";
+ private Boolean booleanAttr = Boolean.TRUE;
+ private BigInteger integerAttr = BigInteger.ONE;
+ private Integer intAttr = new Integer(2);
+ private Long longAttr = new Long(3);
+ private Short shortAttr = new Short((short)4);
+ private BigDecimal decimalAttr = new BigDecimal("5");
+ private Float floatAttr = new Float(6F);
+ private Double doubleAttr = new Double(7D);
+ private Byte byteAttr = new Byte((byte)8);
+ private QName qnameAttr = new QName("http://www.w3.org/2001/XMLSchema", "schema", "xs");
+ private byte[] base64BinaryAttr = DatatypeConverter.parseBase64Binary("abcd");
+ private byte[] hexBinaryAttr = new HexBinaryAdapter().unmarshal("aaaa");
+ private Long unsignedIntAttr = new Long(9);
+ private Integer unsignedShortAttr = new Integer(10);
+ private Short unsignedByteAttr = new Short((short)11);
+
+
+ public SimpleBean(String bn) {
+ beanName = bn;
+ }
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+ public byte[] getBase64BinaryAttr() {
+ return base64BinaryAttr;
+ }
+
+ public void setBase64BinaryAttr(byte[] base64BinaryAttr) {
+ this.base64BinaryAttr = base64BinaryAttr;
+ }
+
+ public Boolean getBooleanAttr() {
+ return booleanAttr;
+ }
+
+ public void setBooleanAttr(Boolean booleanAttr) {
+ this.booleanAttr = booleanAttr;
+ }
+
+ public Byte getByteAttr() {
+ return byteAttr;
+ }
+
+ public void setByteAttr(Byte byteAttr) {
+ this.byteAttr = byteAttr;
+ }
+
+ public BigDecimal getDecimalAttr() {
+ return decimalAttr;
+ }
+
+ public void setDecimalAttr(BigDecimal decimalAttr) {
+ this.decimalAttr = decimalAttr;
+ }
+
+ public Double getDoubleAttr() {
+ return doubleAttr;
+ }
+
+ public void setDoubleAttr(Double doubleAttr) {
+ this.doubleAttr = doubleAttr;
+ }
+
+ public Float getFloatAttr() {
+ return floatAttr;
+ }
+
+ public void setFloatAttr(Float floatAttr) {
+ this.floatAttr = floatAttr;
+ }
+
+ public byte[] getHexBinaryAttr() {
+ return hexBinaryAttr;
+ }
+
+ public void setHexBinaryAttr(byte[] hexBinaryAttr) {
+ this.hexBinaryAttr = hexBinaryAttr;
+ }
+
+ public Integer getIntAttr() {
+ return intAttr;
+ }
+
+ public void setIntAttr(Integer intAttr) {
+ this.intAttr = intAttr;
+ }
+
+ public BigInteger getIntegerAttr() {
+ return integerAttr;
+ }
+
+ public void setIntegerAttr(BigInteger integerAttr) {
+ this.integerAttr = integerAttr;
+ }
+
+ public Long getLongAttr() {
+ return longAttr;
+ }
+
+ public void setLongAttr(Long longAttr) {
+ this.longAttr = longAttr;
+ }
+
+ public QName getQnameAttr() {
+ return qnameAttr;
+ }
+
+ public void setQnameAttr(QName qnameAttr) {
+ this.qnameAttr = qnameAttr;
+ }
+
+ public Short getShortAttr() {
+ return shortAttr;
+ }
+
+ public void setShortAttr(Short shortAttr) {
+ this.shortAttr = shortAttr;
+ }
+
+ public String getStringAttr() {
+ return stringAttr;
+ }
+
+ public void setStringAttr(String stringAttr) {
+ this.stringAttr = stringAttr;
+ }
+
+ public Short getUnsignedByteAttr() {
+ return unsignedByteAttr;
+ }
+
+ public void setUnsignedByteAttr(Short unsignedByteAttr) {
+ this.unsignedByteAttr = unsignedByteAttr;
+ }
+
+ public Long getUnsignedIntAttr() {
+ return unsignedIntAttr;
+ }
+
+ public void setUnsignedIntAttr(Long unsignedIntAttr) {
+ this.unsignedIntAttr = unsignedIntAttr;
+ }
+
+ public Integer getUnsignedShortAttr() {
+ return unsignedShortAttr;
+ }
+
+ public void setUnsignedShortAttr(Integer unsignedShortAttr) {
+ this.unsignedShortAttr = unsignedShortAttr;
+ }
+
+ public void setBeanName(String beanName) {
+ this.beanName = beanName;
+ }
+
+
+
+ }
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java Fri Sep 8 08:16:35 2006
@@ -0,0 +1,103 @@
+/**
+ * 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.configuration.spring;
+
+import javax.xml.bind.DatatypeConverter;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.configuration.Configurable;
+import org.apache.cxf.configuration.foo.Address;
+import org.apache.cxf.configuration.foo.Foo;
+import org.apache.cxf.configuration.foo.Point;
+import org.apache.ws.jaxme.impl.DatatypeConverterImpl;
+
+public class JaxbPropertyEditorTest extends TestCase {
+
+ public void testPerType() throws Exception {
+
+ DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());
+
+ JaxbClassPathXmlApplicationContext context = new JaxbClassPathXmlApplicationContext(new String[] {
+ "/org/apache/cxf/configuration/spring/test-jaxb-beans.xml",
+ "/org/apache/cxf/configuration/spring/cxf-property-editors.xml"
+ });
+
+ FooBean foo = (FooBean)context.getBean("complex");
+
+ Point point = foo.getPosition();
+ assertEquals("Unexpected value for point", 12, point.getX());
+ assertEquals("Unexpected value for point", 33, point.getY());
+
+ Address addr = foo.getAddress();
+ assertEquals("Unexpected value for address", "Dublin", addr.getCity());
+ assertEquals("Unexpected value for address", 4, addr.getZip());
+ assertEquals("Unexpected value for address", "Shelbourne Rd", addr.getStreet());
+ assertNull("Unexpected value for address", addr.getNr());
+
+ assertEquals("Unexpected value for name", "foam", foo.getName());
+ }
+
+ public void testPerPackage() throws Exception {
+
+ DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());
+
+ JaxbClassPathXmlApplicationContext context = new JaxbClassPathXmlApplicationContext(new String[] {
+ "/org/apache/cxf/configuration/spring/test-jaxb-beans.xml",
+ "/org/apache/cxf/configuration/spring/cxf.xml",
+ "/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml",
+
+ });
+
+ FooBean foo = (FooBean)context.getBean("complex");
+
+ Point point = foo.getPosition();
+ assertEquals("Unexpected value for point", 12, point.getX());
+ assertEquals("Unexpected value for point", 33, point.getY());
+
+ Address addr = foo.getAddress();
+ assertEquals("Unexpected value for address", "Dublin", addr.getCity());
+ assertEquals("Unexpected value for address", 4, addr.getZip());
+ assertEquals("Unexpected value for address", "Shelbourne Rd", addr.getStreet());
+ assertNull("Unexpected value for address", addr.getNr());
+
+ assertEquals("Unexpected value for name", "foam", foo.getName());
+ }
+
+ static class FooBean extends Foo implements Configurable {
+ private String beanName = "complex";
+
+ public FooBean() {
+ }
+
+ public FooBean(String bn) {
+ beanName = bn;
+ }
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+
+
+ }
+
+
+}
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/JaxbPropertyEditorTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml Fri Sep 8 08:16:35 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+ <property name="propertyEditorRegistrars">
+ <list merge="true">
+ <ref bean="org.apache.cxf.configuration.foo.JaxbPropertyEditorRegistrar"/>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="org.apache.cxf.configuration.foo.JaxbPropertyEditorRegistrar"
+ class="org.apache.cxf.configuration.spring.JaxbPropertyEditorRegistrar">
+ <property name="packageName" value="org.apache.cxf.configuration.foo"/>
+ <property name="propertyClassNames">
+ <list>
+ <value>Point</value>
+ <value>Address</value>
+ </list>
+ </property>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-jaxb-property-types.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml Fri Sep 8 08:16:35 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+ <property name="customEditors">
+ <map>
+ <entry key="org.apache.cxf.configuration.foo.Point">
+ <bean class="org.apache.cxf.configuration.spring.JaxbPropertyEditor">
+ <property name="packageName" value="org.apache.cxf.configuration.foo"/>
+ </bean>
+ </entry>
+ <entry key="org.apache.cxf.configuration.foo.Address">
+ <bean class="org.apache.cxf.configuration.spring.JaxbPropertyEditor">
+ <property name="packageName" value="org.apache.cxf.configuration.foo"/>
+ </bean>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf-property-editors.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml Fri Sep 8 08:16:35 2006
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+ <property name="propertyEditorRegistrars">
+ <list merge="true">
+ </list>
+ </property>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/cxf.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml Fri Sep 8 08:16:35 2006
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="simple" lazy-init="true">
+ <property name="stringAttr" value="hallo"/>
+ <property name="booleanAttr" value="false"/>
+ <property name="integerAttr" value="10"/>
+ <property name="intAttr" value="12"/>
+ <property name="longAttr" value="13"/>
+ <property name="shortAttr" value="14"/>
+ <property name="decimalAttr" value="15"/>
+ <property name="floatAttr" value="16"/>
+ <property name="doubleAttr" value="17"/>
+ <property name="byteAttr" value="18"/>
+
+ <!--
+ <property name="qnameAttr" value="xs:string"/>
+ -->
+ <property name="base64BinaryAttr" value="abcd"/>
+ <property name="hexBinaryAttr" value="bbbb"/>
+ <property name="unsignedIntAttr" value="19"/>
+ <property name="unsignedShortAttr" value="20"/>
+ <property name="unsignedByteAttr" value="21"/>
+ </bean>
+
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml (added)
+++ incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml Fri Sep 8 08:16:35 2006
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="complex" class="org.apache.cxf.configuration.spring.JaxbPropertyEditorTest$FooBean" lazy-init="true">
+ <property name="name">
+ <value>foam</value>
+ </property>
+ <property name="position">
+ <value>
+ <foo:point>
+ <foo:x>12</foo:x>
+ <foo:y>33</foo:y>
+ </foo:point>
+ </value>
+ </property>
+ <property name="address">
+ <value>
+ <foo:address>
+ <foo:city>Dublin</foo:city>
+ <foo:zip>4</foo:zip>
+ <foo:street>Shelbourne Rd</foo:street>
+ </foo:address>
+ </value>
+ </property>
+ </bean>
+</beans>
\ No newline at end of file
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/java/org/apache/cxf/configuration/spring/test-jaxb-beans.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd?view=auto&rev=441529
==============================================================================
--- incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd (added)
+++ incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd Fri Sep 8 08:16:35 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cxf.apache.org/configuration/foo" targetNamespace="http://cxf.apache.org/configuration/foo" elementFormDefault="qualified">
+
+ <xs:complexType name="foo">
+ <xs:sequence>
+ <xs:element name="position" type="tns:point" minOccurs="0"/>
+ <xs:element name="address" type="tns:address" minOccurs="0"/>
+ <xs:element name="name" type="xs:string" minOccurs="0"/>
+ <xs:element name="intDefault" type="xs:int" default="22" minOccurs="0"/>
+ <xs:element name="intNoDefault" type="xs:int" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="point">
+ <xs:sequence>
+ <xs:element name="x" type="xs:int"></xs:element>
+ <xs:element name="y" type="xs:int"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="address">
+ <xs:sequence>
+ <xs:element name="city" type="xs:string"></xs:element>
+ <xs:element name="zip" type="xs:int"></xs:element>
+ <xs:element name="street" type="xs:string"></xs:element>
+ <xs:element name="nr" type="xs:int" minOccurs="0"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="point" type="tns:point"/>
+ <xs:element name="address" type="tns:address"/>
+ <xs:element name="foo" type="tns:foo"/>
+
+</xs:schema>
Propchange: incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/common/src/test/resources/schemas/configuration/foo.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?view=diff&rev=441529&r1=441528&r2=441529
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Fri Sep 8 08:16:35 2006
@@ -317,6 +317,10 @@
<value>${basedir}/target/test-classes/logging.properties</value>
</property>
<property>
+ <name>log4j.configuration</name>
+ <value>file:///c:/log4j.properties</value>
+ </property>
+ <property>
<name>activemq.store.dir</name>
<value>${basedir}/target/ActiveMQ</value>
</property>
|