From c97a45a13aee9f28e98d8709e59302bd0e9d99a3 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 15 Oct 2008 20:42:07 +0000 Subject: Restrict Export-Package and refactor some internal classes git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@705036 13f79535-47bb-0310-9956-ffa450edef68 --- branches/sca-equinox/modules/binding-gdata/pom.xml | 4 +- .../gdata/GDataImplementationProcessor.java | 100 -------------------- .../gdata/xml/GDataImplementationProcessor.java | 102 +++++++++++++++++++++ ...ca.contribution.processor.StAXArtifactProcessor | 2 +- 4 files changed, 105 insertions(+), 103 deletions(-) delete mode 100644 branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java create mode 100644 branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GDataImplementationProcessor.java (limited to 'branches/sca-equinox/modules/binding-gdata') diff --git a/branches/sca-equinox/modules/binding-gdata/pom.xml b/branches/sca-equinox/modules/binding-gdata/pom.xml index cf918652a6..3e2437ced7 100644 --- a/branches/sca-equinox/modules/binding-gdata/pom.xml +++ b/branches/sca-equinox/modules/binding-gdata/pom.xml @@ -61,9 +61,9 @@ ${tuscany.version} - org.apache.tuscany.sca.binding.atom + org.apache.tuscany.sca.binding.gdata ${pom.name} - org.apache.tuscany.sca.binding.atom* + org.apache.tuscany.sca.binding.gdata diff --git a/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java b/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java deleted file mode 100644 index 93b326e287..0000000000 --- a/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/GDataImplementationProcessor.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.tuscany.sca.binding.gdata; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.monitor.Monitor; - -public class GDataImplementationProcessor implements StAXArtifactProcessor { - - private GDataBindingFactory gdataFactory; - protected static final QName BINDING_GDATA = new QName(Constants.SCA10_TUSCANY_NS, "binding.gdata"); - - public GDataImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) { - - this.gdataFactory = (GDataBindingFactory) modelFactories.getFactory(GDataBindingFactory.class); - } - - public GDataBinding read(XMLStreamReader reader) { - - assert BINDING_GDATA.equals(reader.getName()); - - GDataBinding gdataBinding = gdataFactory.createAtomBinding(); - - /* - * - */ - - String uri = reader.getAttributeValue(null, "uri"); - String serviceType = reader.getAttributeValue(null, "serviceType"); - String login = reader.getAttributeValue(null, "username"); - String password = reader.getAttributeValue(null, "password"); - - gdataBinding.setURI(uri); - gdataBinding.setServiceType(serviceType); - gdataBinding.setUsername(login); - gdataBinding.setPassword(password); - - return gdataBinding; - } - - public void write(GDataBinding gdataBinding, XMLStreamWriter writer) throws XMLStreamException { - if (gdataBinding != null) { - writer.writeStartElement(BINDING_GDATA.getNamespaceURI(), BINDING_GDATA.getLocalPart()); - - if (gdataBinding.getURI() != null) { - writer.writeAttribute("uri", gdataBinding.getURI()); - } - - if (gdataBinding.getServiceType() != null) { - writer.writeAttribute("serviceType", gdataBinding.getServiceType()); - } - if (gdataBinding.getUsername() != null) { - writer.writeAttribute("username", gdataBinding.getUsername()); - } - if (gdataBinding.getPassword() != null) { - writer.writeAttribute("password", gdataBinding.getPassword()); - } - - writer.writeEndElement(); - } - } - - public QName getArtifactType() { - return BINDING_GDATA; - } - - public void resolve(GDataBinding arg0, ModelResolver arg1) throws ContributionResolveException { - } - - public Class getModelType() { - return GDataBinding.class; - } -} diff --git a/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GDataImplementationProcessor.java b/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GDataImplementationProcessor.java new file mode 100644 index 0000000000..a158aa2cc9 --- /dev/null +++ b/branches/sca-equinox/modules/binding-gdata/src/main/java/org/apache/tuscany/sca/binding/gdata/xml/GDataImplementationProcessor.java @@ -0,0 +1,102 @@ +/* + * 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.tuscany.sca.binding.gdata.xml; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; + +import org.apache.tuscany.sca.assembly.xml.Constants; +import org.apache.tuscany.sca.binding.gdata.GDataBinding; +import org.apache.tuscany.sca.binding.gdata.GDataBindingFactory; +import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; +import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.resolver.ModelResolver; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; + +public class GDataImplementationProcessor implements StAXArtifactProcessor { + + private GDataBindingFactory gdataFactory; + protected static final QName BINDING_GDATA = new QName(Constants.SCA10_TUSCANY_NS, "binding.gdata"); + + public GDataImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) { + + this.gdataFactory = (GDataBindingFactory) modelFactories.getFactory(GDataBindingFactory.class); + } + + public GDataBinding read(XMLStreamReader reader) { + + assert BINDING_GDATA.equals(reader.getName()); + + GDataBinding gdataBinding = gdataFactory.createAtomBinding(); + + /* + * + */ + + String uri = reader.getAttributeValue(null, "uri"); + String serviceType = reader.getAttributeValue(null, "serviceType"); + String login = reader.getAttributeValue(null, "username"); + String password = reader.getAttributeValue(null, "password"); + + gdataBinding.setURI(uri); + gdataBinding.setServiceType(serviceType); + gdataBinding.setUsername(login); + gdataBinding.setPassword(password); + + return gdataBinding; + } + + public void write(GDataBinding gdataBinding, XMLStreamWriter writer) throws XMLStreamException { + if (gdataBinding != null) { + writer.writeStartElement(BINDING_GDATA.getNamespaceURI(), BINDING_GDATA.getLocalPart()); + + if (gdataBinding.getURI() != null) { + writer.writeAttribute("uri", gdataBinding.getURI()); + } + + if (gdataBinding.getServiceType() != null) { + writer.writeAttribute("serviceType", gdataBinding.getServiceType()); + } + if (gdataBinding.getUsername() != null) { + writer.writeAttribute("username", gdataBinding.getUsername()); + } + if (gdataBinding.getPassword() != null) { + writer.writeAttribute("password", gdataBinding.getPassword()); + } + + writer.writeEndElement(); + } + } + + public QName getArtifactType() { + return BINDING_GDATA; + } + + public void resolve(GDataBinding arg0, ModelResolver arg1) throws ContributionResolveException { + } + + public Class getModelType() { + return GDataBinding.class; + } +} diff --git a/branches/sca-equinox/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-equinox/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor index 92aad3d44d..e48d2691b8 100644 --- a/branches/sca-equinox/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ b/branches/sca-equinox/modules/binding-gdata/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor @@ -18,4 +18,4 @@ # Implementation class for the artifact processor extension #org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GDataBinding,factory=org.apache.tuscany.sca.binding.gdata.GDataBindingFactory -org.apache.tuscany.sca.binding.gdata.GDataImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GDataBinding,factory=org.apache.tuscany.sca.binding.gdata.GDataBindingFactory \ No newline at end of file +org.apache.tuscany.sca.binding.gdata.xml.GDataImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#binding.gdata,model=org.apache.tuscany.sca.binding.gdata.GDataBinding,factory=org.apache.tuscany.sca.binding.gdata.GDataBindingFactory \ No newline at end of file -- cgit v1.2.3