You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2010/12/04 19:37:54 UTC
svn commit: r1042223 - in
/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template:
ADBBeanTemplate-bean.xsl ADBBeanTemplate-helpermode.xsl
Author: veithen
Date: Sat Dec 4 18:37:53 2010
New Revision: 1042223
URL: http://svn.apache.org/viewvc?rev=1042223&view=rev
Log:
AXIS2-4902: Avoid references to Axiom implementation classes in ADB generated code.
Modified:
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl?rev=1042223&r1=1042222&r2=1042223&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-bean.xsl Sat Dec 4 18:37:53 2010
@@ -615,14 +615,12 @@
<xsl:when test="@type">
org.apache.axiom.om.OMDataSource dataSource =
new org.apache.axis2.databinding.ADBDataSource(this,parentQName);
- return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
- parentQName,factory,dataSource);
+ return factory.createOMElement(dataSource,parentQName);
</xsl:when>
<xsl:otherwise>
org.apache.axiom.om.OMDataSource dataSource =
new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME);
- return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
- MY_QNAME,factory,dataSource);
+ return factory.createOMElement(dataSource,MY_QNAME);
</xsl:otherwise>
</xsl:choose>
}
@@ -2146,7 +2144,7 @@
<xsl:value-of select="$name"/> object = null;
// initialize a hash map to keep values
java.util.Map attributeMap = new java.util.HashMap();
- java.util.List extraAttributeList = new java.util.ArrayList();
+ java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();
</xsl:if>
int event;
@@ -2367,13 +2365,13 @@
if (!handledAttributes.contains(reader.getAttributeLocalName(i))) {
// this is an anyAttribute and we create
// an OMAttribute for this
- org.apache.axiom.om.impl.llom.OMAttributeImpl attr =
- new org.apache.axiom.om.impl.llom.OMAttributeImpl(
+ org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
+ org.apache.axiom.om.OMAttribute attr =
+ factory.createOMAttribute(
reader.getAttributeLocalName(i),
- new org.apache.axiom.om.impl.dom.NamespaceImpl(
+ factory.createOMNamespace(
reader.getAttributeNamespace(i), reader.getAttributePrefix(i)),
- reader.getAttributeValue(i),
- org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ reader.getAttributeValue(i));
// and add it to the extra attributes
<xsl:choose>
@@ -3025,8 +3023,8 @@
<!-- Handle anyAttributes here -->
<xsl:if test="$propertyName = 'extraAttributes'">
- for(java.util.Iterator iter = extraAttributeList.iterator();iter.hasNext();){
- object.addExtraAttributes((org.apache.axiom.om.impl.llom.OMAttributeImpl)iter.next());
+ for(org.apache.axiom.om.OMAttribute att : extraAttributeList){
+ object.addExtraAttributes(att);
}
</xsl:if>
Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl?rev=1042223&r1=1042222&r2=1042223&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl (original)
+++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate-helpermode.xsl Sat Dec 4 18:37:53 2010
@@ -535,14 +535,12 @@ public <xsl:if test="not(@unwrapped) or
<xsl:when test="@type">
org.apache.axiom.om.OMDataSource dataSource =
new org.apache.axis2.databinding.ADBHelperDataSource(bean,parentQName,this);
- return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
- parentQName,factory,dataSource);
+ return factory.createOMElement(dataSource,parentQName);
</xsl:when>
<xsl:otherwise>
org.apache.axiom.om.OMDataSource dataSource =
new org.apache.axis2.databinding.ADBHelperDataSource(bean,<xsl:value-of select="$fullyQualifiedName"/>.MY_QNAME,this);
- return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
- <xsl:value-of select="$fullyQualifiedName"/>.MY_QNAME,factory,dataSource);
+ return factory.createOMElement(dataSource,<xsl:value-of select="$fullyQualifiedName"/>.MY_QNAME);
</xsl:otherwise>
</xsl:choose>
}
@@ -1479,13 +1477,13 @@ public <xsl:if test="not(@unwrapped) or
if (!handledAttributes.contains(reader.getAttributeLocalName(i))) {
// this is an anyAttribute and we create
// an OMAttribute for this
- org.apache.axiom.om.impl.llom.OMAttributeImpl attr =
- new org.apache.axiom.om.impl.llom.OMAttributeImpl(
+ org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
+ org.apache.axiom.om.OMAttribute attr =
+ factory.createOMAttribute(
reader.getAttributeLocalName(i),
- new org.apache.axiom.om.impl.dom.NamespaceImpl(
+ factory.createOMNamespace(
reader.getAttributeNamespace(i), reader.getAttributePrefix(i)),
- reader.getAttributeValue(i),
- org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+ reader.getAttributeValue(i));
// and add it to the extra attributes
object.addExtraAttributes(attr);