diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-06 01:27:13 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-06 01:27:13 +0000 |
commit | 63bf29cb2ece06c52b7a59100895896f2668f8c7 (patch) | |
tree | 582228170a0375911e14ec7fa271baa007dbd51e /java/sca/modules/contribution-xml/src | |
parent | e6ad8036ebaeb26f0491a3071d564409b34b014e (diff) |
Use AssemblyFactory to create Extension
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@750739 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java index e27ac9fcab..aad7747522 100644 --- a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java +++ b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/AnyAttributeProcessor.java @@ -23,8 +23,8 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; +import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Extension; -import org.apache.tuscany.sca.assembly.ExtensionFactory; import org.apache.tuscany.sca.contribution.Constants; import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; @@ -43,10 +43,10 @@ import org.apache.tuscany.sca.monitor.Monitor; public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements StAXAttributeProcessor<Extension> { private static final QName ANY_ATTRIBUTE = new QName(Constants.XMLSCHEMA_NS, "anyAttribute"); - private ExtensionFactory extensionFactory; + private AssemblyFactory assemblyFactory; public AnyAttributeProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) { - this.extensionFactory = modelFactories.getFactory(ExtensionFactory.class); + this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); } public QName getArtifactType() { @@ -59,7 +59,11 @@ public class AnyAttributeProcessor extends BaseStAXArtifactProcessor implements public Extension read(QName attributeName, XMLStreamReader reader) throws ContributionReadException, XMLStreamException { String attributeValue = reader.getAttributeValue(attributeName.getNamespaceURI(), attributeName.getLocalPart()); - return extensionFactory.createExtension(attributeName, attributeValue, true); + Extension ext = assemblyFactory.createExtension(); + ext.setQName(attributeName); + ext.setAttribute(true); + ext.setValue(attributeValue); + return ext; } public void write(Extension attributeExtension, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException { |