Author: thomas.diesler(a)jboss.com
Date: 2008-02-28 07:13:05 -0500 (Thu, 28 Feb 2008)
New Revision: 5844
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/Accessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactoryCreator.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactoryCreator.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactoryCreator.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactoryCreator.java
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/Accessor.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactoryCreator.java
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
Log:
[JBWS-1857] JAXBContext created for every wrapper type
Refactor accessor to use top level elements. No functional change.
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor (from rev 5829,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor)
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/Accessor.java
(from rev 5829,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/Accessor.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/Accessor.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/Accessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+// $Id$
+
+/**
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ */
+public interface Accessor
+{
+ public Object get(Object bean);
+
+ public void set(Object bean, Object value);
+}
\ No newline at end of file
Copied:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactory.java (from
rev 5829,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactory.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactory.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+// $Id$
+
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+/**
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ */
+public interface AccessorFactory
+{
+ public Accessor create(WrappedParameter parameter);
+}
\ No newline at end of file
Copied:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactoryCreator.java
(from rev 5829,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactoryCreator.java)
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactoryCreator.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/AccessorFactoryCreator.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+/**
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public interface AccessorFactoryCreator
+{
+ public AccessorFactory create(ParameterMetaData parameter);
+
+ public AccessorFactory create(FaultMetaData fault);
+}
\ No newline at end of file
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java 2008-02-28
07:23:17 UTC (rev 5829)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.acessor;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.JAXBContextFactory;
-import org.jboss.ws.metadata.umdm.Accessor;
-import org.jboss.ws.metadata.umdm.AccessorFactory;
-import org.jboss.ws.metadata.umdm.AccessorFactoryCreator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-
-import com.sun.xml.bind.api.AccessorException;
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.RawAccessor;
-
-/**
- * A JAXB object accessor.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class JAXBAccessor implements Accessor
-{
- private RawAccessor accessor;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator() {
-
- public AccessorFactory create(ParameterMetaData parameter)
- {
- return create(parameter.getJavaType());
- }
-
- public AccessorFactory create(FaultMetaData fault)
- {
- return create(fault.getFaultBean());
- }
-
- private AccessorFactory create(final Class clazz)
- {
- final JAXBRIContext ctx = (JAXBRIContext)
JAXBContextFactory.newInstance().createContext(clazz);
-
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- RawAccessor<Object, Object> accessor;
- try
- {
- QName name = parameter.getName();
- accessor = ctx.getElementPropertyAccessor(
- clazz,
- name.getNamespaceURI().intern(), // JAXB internally optimizes String
usage towards intern()
- name.getLocalPart().intern() // see
com.sun.xml.bind.v2.util.QNameMap;
- );
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
-
- if (accessor == null)
- throw new IllegalStateException("Could not obtain accessor for
parameter: " + parameter);
-
- return new JAXBAccessor(accessor);
- }
- };
- }
- };
-
- private JAXBAccessor(RawAccessor accessor)
- {
- this.accessor = accessor;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return accessor.get(bean);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- accessor.set(bean, value);
- }
- catch (AccessorException a)
- {
- WSException ex = new WSException(a.getMessage());
- ex.setStackTrace(a.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied: stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java
(from rev 5842,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/JAXBAccessor.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import org.jboss.ws.WSException;
+
+import com.sun.xml.bind.api.AccessorException;
+import com.sun.xml.bind.api.RawAccessor;
+
+/**
+ * A JAXB object accessor.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ */
+@SuppressWarnings("unchecked")
+public class JAXBAccessor implements Accessor
+{
+ private RawAccessor accessor;
+
+ JAXBAccessor(RawAccessor accessor)
+ {
+ this.accessor = accessor;
+ }
+
+ public Object get(Object bean)
+ {
+ try
+ {
+ return accessor.get(bean);
+ }
+ catch (AccessorException a)
+ {
+ WSException ex = new WSException(a.getMessage());
+ ex.setStackTrace(a.getStackTrace());
+ throw ex;
+ }
+ }
+
+ public void set(Object bean, Object value)
+ {
+ try
+ {
+ accessor.set(bean, value);
+ }
+ catch (AccessorException a)
+ {
+ WSException ex = new WSException(a.getMessage());
+ ex.setStackTrace(a.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactory.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.RawAccessor;
+
+final class JAXBAccessorFactory implements AccessorFactory
+{
+ private final Class clazz;
+ private final JAXBRIContext ctx;
+
+ JAXBAccessorFactory(Class clazz, JAXBRIContext ctx)
+ {
+ this.clazz = clazz;
+ this.ctx = ctx;
+ }
+
+ public Accessor create(WrappedParameter parameter)
+ {
+ RawAccessor<Object, Object> accessor;
+ try
+ {
+ QName name = parameter.getName();
+ accessor = ctx.getElementPropertyAccessor(
+ clazz,
+ name.getNamespaceURI().intern(), // JAXB internally optimizes String usage
towards intern()
+ name.getLocalPart().intern() // see com.sun.xml.bind.v2.util.QNameMap;
+ );
+ }
+ catch (Throwable t)
+ {
+ WSException ex = new WSException(t.getMessage());
+ ex.setStackTrace(t.getStackTrace());
+ throw ex;
+ }
+
+ if (accessor == null)
+ throw new IllegalStateException("Could not obtain accessor for parameter:
" + parameter);
+
+ return new JAXBAccessor(accessor);
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactoryCreator.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactoryCreator.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactoryCreator.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import org.jboss.ws.core.jaxws.JAXBContextFactory;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+
+public class JAXBAccessorFactoryCreator implements AccessorFactoryCreator
+{
+ public AccessorFactory create(ParameterMetaData parameter)
+ {
+ Class clazz = parameter.getJavaType();
+ JAXBRIContext ctx =
(JAXBRIContext)JAXBContextFactory.newInstance().createContext(clazz);
+ return new JAXBAccessorFactory(clazz, ctx);
+ }
+
+ public AccessorFactory create(FaultMetaData fault)
+ {
+ Class clazz = fault.getFaultBean();
+ JAXBRIContext ctx =
(JAXBRIContext)JAXBContextFactory.newInstance().createContext(clazz);
+ return new JAXBAccessorFactory(clazz, ctx);
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/JAXBAccessorFactoryCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveFieldAccessor.java 2008-02-28
07:23:17 UTC (rev 5829)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,128 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.acessor;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.umdm.Accessor;
-import org.jboss.ws.metadata.umdm.AccessorFactory;
-import org.jboss.ws.metadata.umdm.AccessorFactoryCreator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-
-/**
- * A simple Java field accessor that uses ordinary reflection.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision: 1760 $
- */
-@SuppressWarnings("unchecked")
-public class ReflectiveFieldAccessor implements Accessor
-{
- private Field field;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- return create(parameter.getJavaType());
- }
-
- public AccessorFactory create(FaultMetaData fault)
- {
- return create(fault.getFaultBean());
- }
-
- private AccessorFactory create(final Class clazz)
- {
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- String fieldName = parameter.getVariable();
- try
- {
- Field field;
-
- try
- {
- field = clazz.getField(fieldName);
- }
- catch (NoSuchFieldException e)
- {
- // Search for a private field
- field = clazz.getDeclaredField(fieldName);
- field.setAccessible(true);
- }
-
- if (Modifier.isStatic(field.getModifiers()))
- throw new WSException("Field can not be static: " +
fieldName);
-
- return new ReflectiveFieldAccessor(field);
- }
- catch (Throwable t)
- {
- WSException ex = new WSException("Error accessing field: " +
fieldName + t.getClass().getSimpleName() + ": " + t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
- }
- };
- }
- };
-
- private ReflectiveFieldAccessor(Field field)
- {
- this.field = field;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return field.get(bean);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- field.set(bean, value);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java
(from rev 5842,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveFieldAccessor.java)
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id: $
+
+import java.lang.reflect.Field;
+
+import org.jboss.ws.WSException;
+
+/**
+ * A simple Java field accessor that uses ordinary reflection.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision: 1760 $
+ */
+@SuppressWarnings("unchecked")
+public class ReflectiveFieldAccessor implements Accessor
+{
+ private Field field;
+
+ public static AccessorFactoryCreator FACTORY_CREATOR = new
ReflectiveFieldAccessorFactoryCreator();
+
+ ReflectiveFieldAccessor(Field field)
+ {
+ this.field = field;
+ }
+
+ public Object get(Object bean)
+ {
+ try
+ {
+ return field.get(bean);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+
+ public void set(Object bean, Object value)
+ {
+ try
+ {
+ field.set(bean, value);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+final class ReflectiveFieldAccessorFactory implements AccessorFactory
+{
+ private final Class clazz;
+
+ ReflectiveFieldAccessorFactory(Class clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ public Accessor create(WrappedParameter parameter)
+ {
+ String fieldName = parameter.getVariable();
+ try
+ {
+ Field field;
+
+ try
+ {
+ field = clazz.getField(fieldName);
+ }
+ catch (NoSuchFieldException e)
+ {
+ // Search for a private field
+ field = clazz.getDeclaredField(fieldName);
+ field.setAccessible(true);
+ }
+
+ if (Modifier.isStatic(field.getModifiers()))
+ throw new WSException("Field can not be static: " + fieldName);
+
+ return new ReflectiveFieldAccessor(field);
+ }
+ catch (Throwable t)
+ {
+ WSException ex = new WSException("Error accessing field: " + fieldName
+ t.getClass().getSimpleName() + ": " + t.getMessage());
+ ex.setStackTrace(t.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactoryCreator.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactoryCreator.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactoryCreator.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class ReflectiveFieldAccessorFactoryCreator implements AccessorFactoryCreator
+{
+ public AccessorFactory create(ParameterMetaData parameter)
+ {
+ return new ReflectiveFieldAccessorFactory(parameter.getJavaType());
+ }
+
+ public AccessorFactory create(FaultMetaData fault)
+ {
+ return new ReflectiveFieldAccessorFactory(fault.getFaultBean());
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveFieldAccessorFactoryCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java 2008-02-28
07:23:17 UTC (rev 5829)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ws.metadata.acessor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.umdm.Accessor;
-import org.jboss.ws.metadata.umdm.AccessorFactory;
-import org.jboss.ws.metadata.umdm.AccessorFactoryCreator;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
-
-/**
- * A simple JavaBean accessor that uses ordinary reflection.
- *
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-@SuppressWarnings("unchecked")
-public class ReflectiveMethodAccessor implements Accessor
-{
- private Method getter;
- private Method setter;
-
- public static AccessorFactoryCreator FACTORY_CREATOR = new AccessorFactoryCreator()
- {
- public AccessorFactory create(ParameterMetaData parameter)
- {
- return create(parameter.getJavaType());
- }
-
- public AccessorFactory create(FaultMetaData fault)
- {
- return create(fault.getFaultBean());
- }
-
- private AccessorFactory create(final Class clazz)
- {
- return new AccessorFactory()
- {
- public Accessor create(WrappedParameter parameter)
- {
- try
- {
- PropertyDescriptor pd = new PropertyDescriptor(parameter.getVariable(),
clazz);
- return new ReflectiveMethodAccessor(pd.getReadMethod(),
pd.getWriteMethod());
- }
- catch (Throwable t)
- {
- WSException ex = new WSException(t.getMessage());
- ex.setStackTrace(t.getStackTrace());
- throw ex;
- }
- }
- };
- }
- };
-
- private ReflectiveMethodAccessor(Method getter, Method setter)
- {
- this.getter = getter;
- this.setter = setter;
- }
-
- public Object get(Object bean)
- {
- try
- {
- return getter.invoke(bean);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-
- public void set(Object bean, Object value)
- {
- try
- {
- setter.invoke(bean, value);
- }
- catch (Throwable e)
- {
- WSException ex = new WSException(e.getMessage());
- ex.setStackTrace(ex.getStackTrace());
- throw ex;
- }
- }
-}
\ No newline at end of file
Copied:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java
(from rev 5842,
stack/native/trunk/src/main/java/org/jboss/ws/metadata/acessor/ReflectiveMethodAccessor.java)
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import java.lang.reflect.Method;
+
+import org.jboss.ws.WSException;
+
+/**
+ * A simple JavaBean accessor that uses ordinary reflection.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+@SuppressWarnings("unchecked")
+public class ReflectiveMethodAccessor implements Accessor
+{
+ private Method getter;
+ private Method setter;
+
+ ReflectiveMethodAccessor(Method getter, Method setter)
+ {
+ this.getter = getter;
+ this.setter = setter;
+ }
+
+ public Object get(Object bean)
+ {
+ try
+ {
+ return getter.invoke(bean);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+
+ public void set(Object bean, Object value)
+ {
+ try
+ {
+ setter.invoke(bean, value);
+ }
+ catch (Throwable e)
+ {
+ WSException ex = new WSException(e.getMessage());
+ ex.setStackTrace(ex.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+//$Id$
+
+import java.beans.PropertyDescriptor;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+
+final class ReflectiveMethodAccessorFactory implements AccessorFactory
+{
+ private final Class clazz;
+
+ ReflectiveMethodAccessorFactory(Class clazz)
+ {
+ this.clazz = clazz;
+ }
+
+ public Accessor create(WrappedParameter parameter)
+ {
+ try
+ {
+ PropertyDescriptor pd = new PropertyDescriptor(parameter.getVariable(), clazz);
+ return new ReflectiveMethodAccessor(pd.getReadMethod(), pd.getWriteMethod());
+ }
+ catch (Throwable t)
+ {
+ WSException ex = new WSException(t.getMessage());
+ ex.setStackTrace(t.getStackTrace());
+ throw ex;
+ }
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactoryCreator.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactoryCreator.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactoryCreator.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.accessor;
+
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+
+public class ReflectiveMethodAccessorFactoryCreator implements AccessorFactoryCreator
+{
+ public AccessorFactory create(ParameterMetaData parameter)
+ {
+ return new ReflectiveMethodAccessorFactory(parameter.getJavaType());
+ }
+
+ public AccessorFactory create(FaultMetaData fault)
+ {
+ return new ReflectiveMethodAccessorFactory(fault.getFaultBean());
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/accessor/ReflectiveMethodAccessorFactoryCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -70,7 +70,8 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-import org.jboss.ws.metadata.acessor.JAXBAccessor;
+import org.jboss.ws.metadata.accessor.JAXBAccessor;
+import org.jboss.ws.metadata.accessor.JAXBAccessorFactoryCreator;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
@@ -377,7 +378,7 @@
// JAX-WS p.37 pg.1, the annotation only affects the element name, not the type
name
ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName,
xmlType, requestWrapperType);
- wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ wrapperParameter.setAccessorFactoryCreator(new JAXBAccessorFactoryCreator());
operation.addParameter(wrapperParameter);
return wrapperParameter;
@@ -409,7 +410,7 @@
}
ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType,
responseWrapperType);
- retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ retMetaData.setAccessorFactoryCreator(new JAXBAccessorFactoryCreator());
operation.setReturnParameter(retMetaData);
return retMetaData;
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/Accessor.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/Accessor.java 2008-02-28
12:12:06 UTC (rev 5843)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/Accessor.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,26 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-package org.jboss.ws.metadata.umdm;
-
-/**
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface Accessor
-{
- public Object get(Object bean);
-
- public void set(Object bean, Object value);
-}
\ No newline at end of file
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactory.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactory.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,24 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-package org.jboss.ws.metadata.umdm;
-
-/**
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface AccessorFactory
-{
- public Accessor create(WrappedParameter parameter);
-}
\ No newline at end of file
Deleted:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactoryCreator.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactoryCreator.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/AccessorFactoryCreator.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -1,26 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 of the License, or
- * (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-package org.jboss.ws.metadata.umdm;
-
-/**
- * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public interface AccessorFactoryCreator
-{
- public AccessorFactory create(ParameterMetaData parameter);
-
- public AccessorFactory create(FaultMetaData fault);
-}
\ No newline at end of file
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/FaultMetaData.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -39,8 +39,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.metadata.acessor.ReflectiveFieldAccessor;
-import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
+import org.jboss.ws.metadata.accessor.AccessorFactory;
+import org.jboss.ws.metadata.accessor.ReflectiveFieldAccessorFactoryCreator;
+import org.jboss.ws.metadata.accessor.ReflectiveMethodAccessorFactoryCreator;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.wsf.common.JavaUtils;
@@ -317,9 +318,9 @@
// However, if issues arrise then switch this to a full jaxb reflection library
XmlAccessorType type =
(XmlAccessorType)faultBean.getAnnotation(XmlAccessorType.class);
if (type != null && type.value() == XmlAccessType.FIELD)
- return ReflectiveFieldAccessor.FACTORY_CREATOR.create(this);
+ return new ReflectiveFieldAccessorFactoryCreator().create(this);
- return ReflectiveMethodAccessor.FACTORY_CREATOR.create(this);
+ return new ReflectiveMethodAccessorFactoryCreator().create(this);
}
public Object toFaultBean(Exception serviceException)
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -41,7 +41,9 @@
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import org.jboss.ws.extensions.xop.jaxws.ReflectiveAttachmentRefScanner;
-import org.jboss.ws.metadata.acessor.ReflectiveMethodAccessor;
+import org.jboss.ws.metadata.accessor.AccessorFactory;
+import org.jboss.ws.metadata.accessor.AccessorFactoryCreator;
+import org.jboss.ws.metadata.accessor.ReflectiveMethodAccessorFactoryCreator;
import org.jboss.ws.metadata.config.EndpointFeature;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.wsf.common.JavaUtils;
@@ -78,7 +80,7 @@
// SOAP-ENC:Array
private boolean soapArrayParam;
private QName soapArrayCompType;
- private AccessorFactoryCreator accessorFactoryCreator =
ReflectiveMethodAccessor.FACTORY_CREATOR;
+ private AccessorFactoryCreator accessorFactoryCreator = new
ReflectiveMethodAccessorFactoryCreator();
private static final List<String> messageTypes = new ArrayList<String>();
static
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2008-02-28
12:12:06 UTC (rev 5843)
+++
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/WrappedParameter.java 2008-02-28
12:13:05 UTC (rev 5844)
@@ -21,15 +21,17 @@
*/
package org.jboss.ws.metadata.umdm;
+// $Id$
+
import javax.xml.namespace.QName;
+import org.jboss.ws.metadata.accessor.Accessor;
import org.jboss.wsf.common.JavaUtils;
/**
* WrappedParameter represents a document/literal wrapped parameter.
*
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
- * @version $Revision$
*/
public class WrappedParameter
{