You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2012/12/10 06:08:43 UTC
svn commit: r1419199 [5/35] - in /openejb/trunk/openejb/container:
openejb-jee-accessors/ openejb-jee-accessors/src/main/
openejb-jee-accessors/src/main/java/ openejb-jee-accessors/src/main/java/org/
openejb-jee-accessors/src/main/java/org/apache/ open...
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConfigProperty$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConfigProperty%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConfigProperty$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConfigProperty$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,303 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class ConfigProperty$JAXB
+ extends JAXBObject<ConfigProperty> {
+
+
+ public ConfigProperty$JAXB() {
+ super(ConfigProperty.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "config-propertyType".intern()), Text$JAXB.class);
+ }
+
+ public static ConfigProperty readConfigProperty(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeConfigProperty(XoXMLStreamWriter writer, ConfigProperty configProperty, RuntimeContext context)
+ throws Exception {
+ _write(writer, configProperty, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, ConfigProperty configProperty, RuntimeContext context)
+ throws Exception {
+ _write(writer, configProperty, context);
+ }
+
+ public final static ConfigProperty _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ ConfigProperty configProperty = new ConfigProperty();
+ context.beforeUnmarshal(configProperty, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("config-propertyType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, ConfigProperty.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, configProperty);
+ configProperty.id = id;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: descriptions
+ Text descriptionsItem = readText(elementReader, context);
+ if (descriptions == null) {
+ descriptions = new ArrayList<Text>();
+ }
+ descriptions.add(descriptionsItem);
+ } else if (("config-property-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertyName
+ String configPropertyNameRaw = elementReader.getElementAsString();
+
+ String configPropertyName;
+ try {
+ configPropertyName = Adapters.collapsedStringAdapterAdapter.unmarshal(configPropertyNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ configProperty.configPropertyName = configPropertyName;
+ } else if (("config-property-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertyType
+ String configPropertyTypeRaw = elementReader.getElementAsString();
+
+ String configPropertyType;
+ try {
+ configPropertyType = Adapters.collapsedStringAdapterAdapter.unmarshal(configPropertyTypeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ configProperty.configPropertyType = configPropertyType;
+ } else if (("config-property-value" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertyValue
+ String configPropertyValueRaw = elementReader.getElementAsString();
+
+ String configPropertyValue;
+ try {
+ configPropertyValue = Adapters.collapsedStringAdapterAdapter.unmarshal(configPropertyValueRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ configProperty.configPropertyValue = configPropertyValue;
+ } else if (("config-property-ignore" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertyIgnore
+ Boolean configPropertyIgnore = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ configProperty.configPropertyIgnore = configPropertyIgnore;
+ } else if (("config-property-supports-dynamic-updates" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertySupportsDynamicUpdates
+ Boolean configPropertySupportsDynamicUpdates = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ configProperty.configPropertySupportsDynamicUpdates = configPropertySupportsDynamicUpdates;
+ } else if (("config-property-confidential" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configPropertyConfidential
+ Boolean configPropertyConfidential = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ configProperty.configPropertyConfidential = configPropertyConfidential;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-name"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-type"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-value"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-ignore"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-supports-dynamic-updates"), new QName("http://java.sun.com/xml/ns/javaee", "config-property-confidential"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ configProperty.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, ConfigProperty.class, "setDescriptions", Text[].class, e);
+ }
+ }
+
+ context.afterUnmarshal(configProperty, LifecycleCallback.NONE);
+
+ return configProperty;
+ }
+
+ public final ConfigProperty read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, ConfigProperty configProperty, RuntimeContext context)
+ throws Exception {
+ if (configProperty == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (ConfigProperty.class != configProperty.getClass()) {
+ context.unexpectedSubclass(writer, configProperty, ConfigProperty.class);
+ return;
+ }
+
+ context.beforeMarshal(configProperty, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = configProperty.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(configProperty, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = configProperty.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(configProperty, "descriptions", ConfigProperty.class, "getDescriptions", e);
+ }
+ if (descriptions != null) {
+ for (Text descriptionsItem : descriptions) {
+ if (descriptionsItem != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, descriptionsItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(configProperty, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: configPropertyName
+ String configPropertyNameRaw = configProperty.configPropertyName;
+ String configPropertyName = null;
+ try {
+ configPropertyName = Adapters.collapsedStringAdapterAdapter.marshal(configPropertyNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(configProperty, "configPropertyName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (configPropertyName != null) {
+ writer.writeStartElement(prefix, "config-property-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(configPropertyName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(configProperty, "configPropertyName");
+ }
+
+ // ELEMENT: configPropertyType
+ String configPropertyTypeRaw = configProperty.configPropertyType;
+ String configPropertyType = null;
+ try {
+ configPropertyType = Adapters.collapsedStringAdapterAdapter.marshal(configPropertyTypeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(configProperty, "configPropertyType", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (configPropertyType != null) {
+ writer.writeStartElement(prefix, "config-property-type", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(configPropertyType);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(configProperty, "configPropertyType");
+ }
+
+ // ELEMENT: configPropertyValue
+ String configPropertyValueRaw = configProperty.configPropertyValue;
+ String configPropertyValue = null;
+ try {
+ configPropertyValue = Adapters.collapsedStringAdapterAdapter.marshal(configPropertyValueRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(configProperty, "configPropertyValue", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (configPropertyValue != null) {
+ writer.writeStartElement(prefix, "config-property-value", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(configPropertyValue);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: configPropertyIgnore
+ Boolean configPropertyIgnore = configProperty.configPropertyIgnore;
+ if (configPropertyIgnore != null) {
+ writer.writeStartElement(prefix, "config-property-ignore", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(configPropertyIgnore));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: configPropertySupportsDynamicUpdates
+ Boolean configPropertySupportsDynamicUpdates = configProperty.configPropertySupportsDynamicUpdates;
+ if (configPropertySupportsDynamicUpdates != null) {
+ writer.writeStartElement(prefix, "config-property-supports-dynamic-updates", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(configPropertySupportsDynamicUpdates));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: configPropertyConfidential
+ Boolean configPropertyConfidential = configProperty.configPropertyConfidential;
+ if (configPropertyConfidential != null) {
+ writer.writeStartElement(prefix, "config-property-confidential", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(configPropertyConfidential));
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(configProperty, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConfigProperty$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConnectionDefinition$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConnectionDefinition%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConnectionDefinition$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConnectionDefinition$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,322 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.ConfigProperty$JAXB.readConfigProperty;
+import static org.apache.openejb.jee.ConfigProperty$JAXB.writeConfigProperty;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class ConnectionDefinition$JAXB
+ extends JAXBObject<ConnectionDefinition> {
+
+
+ public ConnectionDefinition$JAXB() {
+ super(ConnectionDefinition.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "connection-definitionType".intern()), ConfigProperty$JAXB.class);
+ }
+
+ public static ConnectionDefinition readConnectionDefinition(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeConnectionDefinition(XoXMLStreamWriter writer, ConnectionDefinition connectionDefinition, RuntimeContext context)
+ throws Exception {
+ _write(writer, connectionDefinition, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, ConnectionDefinition connectionDefinition, RuntimeContext context)
+ throws Exception {
+ _write(writer, connectionDefinition, context);
+ }
+
+ public final static ConnectionDefinition _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ ConnectionDefinition connectionDefinition = new ConnectionDefinition();
+ context.beforeUnmarshal(connectionDefinition, LifecycleCallback.NONE);
+
+ List<ConfigProperty> configProperty = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("connection-definitionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, ConnectionDefinition.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, connectionDefinition);
+ connectionDefinition.id = id;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("managedconnectionfactory-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: managedConnectionFactoryClass
+ String managedConnectionFactoryClassRaw = elementReader.getElementAsString();
+
+ String managedConnectionFactoryClass;
+ try {
+ managedConnectionFactoryClass = Adapters.collapsedStringAdapterAdapter.unmarshal(managedConnectionFactoryClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connectionDefinition.managedConnectionFactoryClass = managedConnectionFactoryClass;
+ } else if (("config-property" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: configProperty
+ ConfigProperty configPropertyItem = readConfigProperty(elementReader, context);
+ if (configProperty == null) {
+ configProperty = connectionDefinition.configProperty;
+ if (configProperty != null) {
+ configProperty.clear();
+ } else {
+ configProperty = new ArrayList<ConfigProperty>();
+ }
+ }
+ configProperty.add(configPropertyItem);
+ } else if (("connectionfactory-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: connectionFactoryInterface
+ String connectionFactoryInterfaceRaw = elementReader.getElementAsString();
+
+ String connectionFactoryInterface;
+ try {
+ connectionFactoryInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(connectionFactoryInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connectionDefinition.connectionFactoryInterface = connectionFactoryInterface;
+ } else if (("connectionfactory-impl-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: connectionFactoryImplClass
+ String connectionFactoryImplClassRaw = elementReader.getElementAsString();
+
+ String connectionFactoryImplClass;
+ try {
+ connectionFactoryImplClass = Adapters.collapsedStringAdapterAdapter.unmarshal(connectionFactoryImplClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connectionDefinition.connectionFactoryImplClass = connectionFactoryImplClass;
+ } else if (("connection-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: connectionInterface
+ String connectionInterfaceRaw = elementReader.getElementAsString();
+
+ String connectionInterface;
+ try {
+ connectionInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(connectionInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connectionDefinition.connectionInterface = connectionInterface;
+ } else if (("connection-impl-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: connectionImplClass
+ String connectionImplClassRaw = elementReader.getElementAsString();
+
+ String connectionImplClass;
+ try {
+ connectionImplClass = Adapters.collapsedStringAdapterAdapter.unmarshal(connectionImplClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connectionDefinition.connectionImplClass = connectionImplClass;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "managedconnectionfactory-class"), new QName("http://java.sun.com/xml/ns/javaee", "config-property"), new QName("http://java.sun.com/xml/ns/javaee", "connectionfactory-interface"), new QName("http://java.sun.com/xml/ns/javaee", "connectionfactory-impl-class"), new QName("http://java.sun.com/xml/ns/javaee", "connection-interface"), new QName("http://java.sun.com/xml/ns/javaee", "connection-impl-class"));
+ }
+ }
+ if (configProperty != null) {
+ connectionDefinition.configProperty = configProperty;
+ }
+
+ context.afterUnmarshal(connectionDefinition, LifecycleCallback.NONE);
+
+ return connectionDefinition;
+ }
+
+ public final ConnectionDefinition read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, ConnectionDefinition connectionDefinition, RuntimeContext context)
+ throws Exception {
+ if (connectionDefinition == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (ConnectionDefinition.class != connectionDefinition.getClass()) {
+ context.unexpectedSubclass(writer, connectionDefinition, ConnectionDefinition.class);
+ return;
+ }
+
+ context.beforeMarshal(connectionDefinition, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = connectionDefinition.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: managedConnectionFactoryClass
+ String managedConnectionFactoryClassRaw = connectionDefinition.managedConnectionFactoryClass;
+ String managedConnectionFactoryClass = null;
+ try {
+ managedConnectionFactoryClass = Adapters.collapsedStringAdapterAdapter.marshal(managedConnectionFactoryClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "managedConnectionFactoryClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (managedConnectionFactoryClass != null) {
+ writer.writeStartElement(prefix, "managedconnectionfactory-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(managedConnectionFactoryClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connectionDefinition, "managedConnectionFactoryClass");
+ }
+
+ // ELEMENT: configProperty
+ List<ConfigProperty> configProperty = connectionDefinition.configProperty;
+ if (configProperty != null) {
+ for (ConfigProperty configPropertyItem : configProperty) {
+ if (configPropertyItem != null) {
+ writer.writeStartElement(prefix, "config-property", "http://java.sun.com/xml/ns/javaee");
+ writeConfigProperty(writer, configPropertyItem, context);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ // ELEMENT: connectionFactoryInterface
+ String connectionFactoryInterfaceRaw = connectionDefinition.connectionFactoryInterface;
+ String connectionFactoryInterface = null;
+ try {
+ connectionFactoryInterface = Adapters.collapsedStringAdapterAdapter.marshal(connectionFactoryInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "connectionFactoryInterface", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (connectionFactoryInterface != null) {
+ writer.writeStartElement(prefix, "connectionfactory-interface", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(connectionFactoryInterface);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connectionDefinition, "connectionFactoryInterface");
+ }
+
+ // ELEMENT: connectionFactoryImplClass
+ String connectionFactoryImplClassRaw = connectionDefinition.connectionFactoryImplClass;
+ String connectionFactoryImplClass = null;
+ try {
+ connectionFactoryImplClass = Adapters.collapsedStringAdapterAdapter.marshal(connectionFactoryImplClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "connectionFactoryImplClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (connectionFactoryImplClass != null) {
+ writer.writeStartElement(prefix, "connectionfactory-impl-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(connectionFactoryImplClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connectionDefinition, "connectionFactoryImplClass");
+ }
+
+ // ELEMENT: connectionInterface
+ String connectionInterfaceRaw = connectionDefinition.connectionInterface;
+ String connectionInterface = null;
+ try {
+ connectionInterface = Adapters.collapsedStringAdapterAdapter.marshal(connectionInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "connectionInterface", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (connectionInterface != null) {
+ writer.writeStartElement(prefix, "connection-interface", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(connectionInterface);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connectionDefinition, "connectionInterface");
+ }
+
+ // ELEMENT: connectionImplClass
+ String connectionImplClassRaw = connectionDefinition.connectionImplClass;
+ String connectionImplClass = null;
+ try {
+ connectionImplClass = Adapters.collapsedStringAdapterAdapter.marshal(connectionImplClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connectionDefinition, "connectionImplClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (connectionImplClass != null) {
+ writer.writeStartElement(prefix, "connection-impl-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(connectionImplClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connectionDefinition, "connectionImplClass");
+ }
+
+ context.afterMarshal(connectionDefinition, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConnectionDefinition$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Connector$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Connector%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Connector$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Connector$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,455 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.Icon$JAXB.readIcon;
+import static org.apache.openejb.jee.Icon$JAXB.writeIcon;
+import static org.apache.openejb.jee.License$JAXB.readLicense;
+import static org.apache.openejb.jee.License$JAXB.writeLicense;
+import static org.apache.openejb.jee.ResourceAdapter$JAXB.readResourceAdapter;
+import static org.apache.openejb.jee.ResourceAdapter$JAXB.writeResourceAdapter;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class Connector$JAXB
+ extends JAXBObject<Connector> {
+
+
+ public Connector$JAXB() {
+ super(Connector.class, new QName("http://java.sun.com/xml/ns/javaee".intern(), "connector".intern()), new QName("http://java.sun.com/xml/ns/javaee".intern(), "connectorType".intern()), Text$JAXB.class, Icon$JAXB.class, License$JAXB.class, ResourceAdapter$JAXB.class);
+ }
+
+ public static Connector readConnector(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeConnector(XoXMLStreamWriter writer, Connector connector, RuntimeContext context)
+ throws Exception {
+ _write(writer, connector, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Connector connector, RuntimeContext context)
+ throws Exception {
+ _write(writer, connector, context);
+ }
+
+ public final static Connector _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Connector connector = new Connector();
+ context.beforeUnmarshal(connector, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ ArrayList<Text> displayNames = null;
+ LocalCollection<Icon> icon = null;
+ List<String> requiredWorkContext = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("connectorType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Connector.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, connector);
+ connector.id = id;
+ } else if (("version" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: version
+ connector.version = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ } else if (("metadata-complete" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: metadataComplete
+ Boolean metadataComplete = ("1".equals(attribute.getValue()) || "true".equals(attribute.getValue()));
+ connector.metadataComplete = metadataComplete;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"), new QName("", "version"), new QName("", "metadata-complete"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("module-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: moduleName
+ String moduleNameRaw = elementReader.getElementAsString();
+
+ String moduleName;
+ try {
+ moduleName = Adapters.collapsedStringAdapterAdapter.unmarshal(moduleNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connector.moduleName = moduleName;
+ } else if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: descriptions
+ Text descriptionsItem = readText(elementReader, context);
+ if (descriptions == null) {
+ descriptions = new ArrayList<Text>();
+ }
+ descriptions.add(descriptionsItem);
+ } else if (("display-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: displayNames
+ Text displayNamesItem = readText(elementReader, context);
+ if (displayNames == null) {
+ displayNames = new ArrayList<Text>();
+ }
+ displayNames.add(displayNamesItem);
+ } else if (("icon" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: icon
+ Icon iconItem = readIcon(elementReader, context);
+ if (icon == null) {
+ icon = connector.icon;
+ if (icon != null) {
+ icon.clear();
+ } else {
+ icon = new LocalCollection<Icon>();
+ }
+ }
+ icon.add(iconItem);
+ } else if (("vendor-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: vendorName
+ String vendorNameRaw = elementReader.getElementAsString();
+
+ String vendorName;
+ try {
+ vendorName = Adapters.collapsedStringAdapterAdapter.unmarshal(vendorNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connector.vendorName = vendorName;
+ } else if (("eis-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: eisType
+ String eisTypeRaw = elementReader.getElementAsString();
+
+ String eisType;
+ try {
+ eisType = Adapters.collapsedStringAdapterAdapter.unmarshal(eisTypeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connector.eisType = eisType;
+ } else if (("resourceadapter-version" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: resourceAdapterVersion
+ String resourceAdapterVersionRaw = elementReader.getElementAsString();
+
+ String resourceAdapterVersion;
+ try {
+ resourceAdapterVersion = Adapters.collapsedStringAdapterAdapter.unmarshal(resourceAdapterVersionRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ connector.resourceAdapterVersion = resourceAdapterVersion;
+ } else if (("license" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: license
+ License license = readLicense(elementReader, context);
+ connector.license = license;
+ } else if (("resourceadapter" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: resourceAdapter
+ ResourceAdapter resourceAdapter = readResourceAdapter(elementReader, context);
+ connector.resourceAdapter = resourceAdapter;
+ } else if (("required-work-context" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: requiredWorkContext
+ String requiredWorkContextItemRaw = elementReader.getElementAsString();
+
+ String requiredWorkContextItem;
+ try {
+ requiredWorkContextItem = Adapters.collapsedStringAdapterAdapter.unmarshal(requiredWorkContextItemRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ if (requiredWorkContext == null) {
+ requiredWorkContext = connector.requiredWorkContext;
+ if (requiredWorkContext != null) {
+ requiredWorkContext.clear();
+ } else {
+ requiredWorkContext = new ArrayList<String>();
+ }
+ }
+ requiredWorkContext.add(requiredWorkContextItem);
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "module-name"), new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "display-name"), new QName("http://java.sun.com/xml/ns/javaee", "icon"), new QName("http://java.sun.com/xml/ns/javaee", "vendor-name"), new QName("http://java.sun.com/xml/ns/javaee", "eis-type"), new QName("http://java.sun.com/xml/ns/javaee", "resourceadapter-version"), new QName("http://java.sun.com/xml/ns/javaee", "license"), new QName("http://java.sun.com/xml/ns/javaee", "resourceadapter"), new QName("http://java.sun.com/xml/ns/javaee", "required-work-context"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ connector.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Connector.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (displayNames != null) {
+ try {
+ connector.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Connector.class, "setDisplayNames", Text[].class, e);
+ }
+ }
+ if (icon != null) {
+ connector.icon = icon;
+ }
+ if (requiredWorkContext != null) {
+ connector.requiredWorkContext = requiredWorkContext;
+ }
+
+ context.afterUnmarshal(connector, LifecycleCallback.NONE);
+
+ return connector;
+ }
+
+ public final Connector read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Connector connector, RuntimeContext context)
+ throws Exception {
+ if (connector == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (Connector.class != connector.getClass()) {
+ context.unexpectedSubclass(writer, connector, Connector.class);
+ return;
+ }
+
+ context.beforeMarshal(connector, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = connector.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ATTRIBUTE: version
+ String versionRaw = connector.version;
+ if (versionRaw != null) {
+ String version = null;
+ try {
+ version = Adapters.collapsedStringAdapterAdapter.marshal(versionRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "version", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "version", version);
+ }
+
+ // ATTRIBUTE: metadataComplete
+ Boolean metadataComplete = connector.metadataComplete;
+ if (metadataComplete != null) {
+ writer.writeAttribute("", "", "metadata-complete", Boolean.toString(metadataComplete));
+ }
+
+ // ELEMENT: moduleName
+ String moduleNameRaw = connector.moduleName;
+ String moduleName = null;
+ try {
+ moduleName = Adapters.collapsedStringAdapterAdapter.marshal(moduleNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "moduleName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (moduleName != null) {
+ writer.writeStartElement(prefix, "module-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(moduleName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = connector.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(connector, "descriptions", Connector.class, "getDescriptions", e);
+ }
+ if (descriptions != null) {
+ for (Text descriptionsItem : descriptions) {
+ if (descriptionsItem != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, descriptionsItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connector, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: displayNames
+ Text[] displayNames = null;
+ try {
+ displayNames = connector.getDisplayNames();
+ } catch (Exception e) {
+ context.getterError(connector, "displayNames", Connector.class, "getDisplayNames", e);
+ }
+ if (displayNames != null) {
+ for (Text displayNamesItem : displayNames) {
+ if (displayNamesItem != null) {
+ writer.writeStartElement(prefix, "display-name", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, displayNamesItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connector, "displayNames");
+ }
+ }
+ }
+
+ // ELEMENT: icon
+ LocalCollection<Icon> icon = connector.icon;
+ if (icon != null) {
+ for (Icon iconItem : icon) {
+ if (iconItem != null) {
+ writer.writeStartElement(prefix, "icon", "http://java.sun.com/xml/ns/javaee");
+ writeIcon(writer, iconItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connector, "icon");
+ }
+ }
+ }
+
+ // ELEMENT: vendorName
+ String vendorNameRaw = connector.vendorName;
+ String vendorName = null;
+ try {
+ vendorName = Adapters.collapsedStringAdapterAdapter.marshal(vendorNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "vendorName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (vendorName != null) {
+ writer.writeStartElement(prefix, "vendor-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(vendorName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: eisType
+ String eisTypeRaw = connector.eisType;
+ String eisType = null;
+ try {
+ eisType = Adapters.collapsedStringAdapterAdapter.marshal(eisTypeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "eisType", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (eisType != null) {
+ writer.writeStartElement(prefix, "eis-type", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(eisType);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: resourceAdapterVersion
+ String resourceAdapterVersionRaw = connector.resourceAdapterVersion;
+ String resourceAdapterVersion = null;
+ try {
+ resourceAdapterVersion = Adapters.collapsedStringAdapterAdapter.marshal(resourceAdapterVersionRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "resourceAdapterVersion", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (resourceAdapterVersion != null) {
+ writer.writeStartElement(prefix, "resourceadapter-version", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(resourceAdapterVersion);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: license
+ License license = connector.license;
+ if (license != null) {
+ writer.writeStartElement(prefix, "license", "http://java.sun.com/xml/ns/javaee");
+ writeLicense(writer, license, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: resourceAdapter
+ ResourceAdapter resourceAdapter = connector.resourceAdapter;
+ if (resourceAdapter != null) {
+ writer.writeStartElement(prefix, "resourceadapter", "http://java.sun.com/xml/ns/javaee");
+ writeResourceAdapter(writer, resourceAdapter, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(connector, "resourceAdapter");
+ }
+
+ // ELEMENT: requiredWorkContext
+ List<String> requiredWorkContextRaw = connector.requiredWorkContext;
+ if (requiredWorkContextRaw != null) {
+ for (String requiredWorkContextItem : requiredWorkContextRaw) {
+ String requiredWorkContext = null;
+ try {
+ requiredWorkContext = Adapters.collapsedStringAdapterAdapter.marshal(requiredWorkContextItem);
+ } catch (Exception e) {
+ context.xmlAdapterError(connector, "requiredWorkContext", CollapsedStringAdapter.class, List.class, List.class, e);
+ }
+ if (requiredWorkContext != null) {
+ writer.writeStartElement(prefix, "required-work-context", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(requiredWorkContext);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ context.afterMarshal(connector, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Connector$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConstructorParameterOrder$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConstructorParameterOrder%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConstructorParameterOrder$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConstructorParameterOrder$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,190 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class ConstructorParameterOrder$JAXB
+ extends JAXBObject<ConstructorParameterOrder> {
+
+
+ public ConstructorParameterOrder$JAXB() {
+ super(ConstructorParameterOrder.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "constructor-parameter-orderType".intern()));
+ }
+
+ public static ConstructorParameterOrder readConstructorParameterOrder(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeConstructorParameterOrder(XoXMLStreamWriter writer, ConstructorParameterOrder constructorParameterOrder, RuntimeContext context)
+ throws Exception {
+ _write(writer, constructorParameterOrder, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, ConstructorParameterOrder constructorParameterOrder, RuntimeContext context)
+ throws Exception {
+ _write(writer, constructorParameterOrder, context);
+ }
+
+ public final static ConstructorParameterOrder _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ ConstructorParameterOrder constructorParameterOrder = new ConstructorParameterOrder();
+ context.beforeUnmarshal(constructorParameterOrder, LifecycleCallback.NONE);
+
+ List<String> elementName = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("constructor-parameter-orderType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, ConstructorParameterOrder.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, constructorParameterOrder);
+ constructorParameterOrder.id = id;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("element-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: elementName
+ String elementNameItemRaw = elementReader.getElementAsString();
+
+ String elementNameItem;
+ try {
+ elementNameItem = Adapters.collapsedStringAdapterAdapter.unmarshal(elementNameItemRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ if (elementName == null) {
+ elementName = constructorParameterOrder.elementName;
+ if (elementName != null) {
+ elementName.clear();
+ } else {
+ elementName = new ArrayList<String>();
+ }
+ }
+ elementName.add(elementNameItem);
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "element-name"));
+ }
+ }
+ if (elementName != null) {
+ constructorParameterOrder.elementName = elementName;
+ }
+
+ context.afterUnmarshal(constructorParameterOrder, LifecycleCallback.NONE);
+
+ return constructorParameterOrder;
+ }
+
+ public final ConstructorParameterOrder read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, ConstructorParameterOrder constructorParameterOrder, RuntimeContext context)
+ throws Exception {
+ if (constructorParameterOrder == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ if (ConstructorParameterOrder.class != constructorParameterOrder.getClass()) {
+ context.unexpectedSubclass(writer, constructorParameterOrder, ConstructorParameterOrder.class);
+ return;
+ }
+
+ context.beforeMarshal(constructorParameterOrder, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = constructorParameterOrder.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(constructorParameterOrder, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: elementName
+ List<String> elementNameRaw = constructorParameterOrder.elementName;
+ if (elementNameRaw != null) {
+ for (String elementNameItem : elementNameRaw) {
+ String elementName = null;
+ try {
+ elementName = Adapters.collapsedStringAdapterAdapter.marshal(elementNameItem);
+ } catch (Exception e) {
+ context.xmlAdapterError(constructorParameterOrder, "elementName", CollapsedStringAdapter.class, List.class, List.class, e);
+ }
+ if (elementName != null) {
+ writer.writeStartElementWithAutoPrefix("http://java.sun.com/xml/ns/javaee", "element-name");
+ writer.writeCharacters(elementName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(constructorParameterOrder, "elementName");
+ }
+ }
+ }
+
+ context.afterMarshal(constructorParameterOrder, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ConstructorParameterOrder$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerConcurrency$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerConcurrency%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerConcurrency$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerConcurrency$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,233 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.ConcurrentLockType$JAXB.parseConcurrentLockType;
+import static org.apache.openejb.jee.ConcurrentLockType$JAXB.toStringConcurrentLockType;
+import static org.apache.openejb.jee.Method$JAXB.readMethod;
+import static org.apache.openejb.jee.Method$JAXB.writeMethod;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class ContainerConcurrency$JAXB
+ extends JAXBObject<ContainerConcurrency> {
+
+
+ public ContainerConcurrency$JAXB() {
+ super(ContainerConcurrency.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "container-concurrencyType".intern()), Text$JAXB.class, Method$JAXB.class, ConcurrentLockType$JAXB.class);
+ }
+
+ public static ContainerConcurrency readContainerConcurrency(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeContainerConcurrency(XoXMLStreamWriter writer, ContainerConcurrency containerConcurrency, RuntimeContext context)
+ throws Exception {
+ _write(writer, containerConcurrency, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, ContainerConcurrency containerConcurrency, RuntimeContext context)
+ throws Exception {
+ _write(writer, containerConcurrency, context);
+ }
+
+ public final static ContainerConcurrency _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ ContainerConcurrency containerConcurrency = new ContainerConcurrency();
+ context.beforeUnmarshal(containerConcurrency, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ List<Method> method = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("container-concurrencyType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, ContainerConcurrency.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, containerConcurrency);
+ containerConcurrency.id = id;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: descriptions
+ Text descriptionsItem = readText(elementReader, context);
+ if (descriptions == null) {
+ descriptions = new ArrayList<Text>();
+ }
+ descriptions.add(descriptionsItem);
+ } else if (("method" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: method
+ Method methodItem = readMethod(elementReader, context);
+ if (method == null) {
+ method = containerConcurrency.method;
+ if (method != null) {
+ method.clear();
+ } else {
+ method = new ArrayList<Method>();
+ }
+ }
+ method.add(methodItem);
+ } else if (("concurrency-attribute" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: lock
+ ConcurrentLockType lock = parseConcurrentLockType(elementReader, context, elementReader.getElementAsString());
+ if (lock != null) {
+ containerConcurrency.lock = lock;
+ }
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "method"), new QName("http://java.sun.com/xml/ns/javaee", "concurrency-attribute"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ containerConcurrency.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, ContainerConcurrency.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (method != null) {
+ containerConcurrency.method = method;
+ }
+
+ context.afterUnmarshal(containerConcurrency, LifecycleCallback.NONE);
+
+ return containerConcurrency;
+ }
+
+ public final ContainerConcurrency read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, ContainerConcurrency containerConcurrency, RuntimeContext context)
+ throws Exception {
+ if (containerConcurrency == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (ContainerConcurrency.class != containerConcurrency.getClass()) {
+ context.unexpectedSubclass(writer, containerConcurrency, ContainerConcurrency.class);
+ return;
+ }
+
+ context.beforeMarshal(containerConcurrency, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = containerConcurrency.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(containerConcurrency, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = containerConcurrency.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(containerConcurrency, "descriptions", ContainerConcurrency.class, "getDescriptions", e);
+ }
+ if (descriptions != null) {
+ for (Text descriptionsItem : descriptions) {
+ if (descriptionsItem != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, descriptionsItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerConcurrency, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: method
+ List<Method> method = containerConcurrency.method;
+ if (method != null) {
+ for (Method methodItem : method) {
+ if (methodItem != null) {
+ writer.writeStartElement(prefix, "method", "http://java.sun.com/xml/ns/javaee");
+ writeMethod(writer, methodItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerConcurrency, "method");
+ }
+ }
+ }
+
+ // ELEMENT: lock
+ ConcurrentLockType lock = containerConcurrency.lock;
+ if (lock != null) {
+ writer.writeStartElement(prefix, "concurrency-attribute", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringConcurrentLockType(containerConcurrency, null, context, lock));
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerConcurrency, "lock");
+ }
+
+ context.afterMarshal(containerConcurrency, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerConcurrency$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerTransaction$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerTransaction%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerTransaction$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerTransaction$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,233 @@
+/*
+ * 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.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.Method$JAXB.readMethod;
+import static org.apache.openejb.jee.Method$JAXB.writeMethod;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+import static org.apache.openejb.jee.TransAttribute$JAXB.parseTransAttribute;
+import static org.apache.openejb.jee.TransAttribute$JAXB.toStringTransAttribute;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class ContainerTransaction$JAXB
+ extends JAXBObject<ContainerTransaction> {
+
+
+ public ContainerTransaction$JAXB() {
+ super(ContainerTransaction.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "container-transactionType".intern()), Text$JAXB.class, Method$JAXB.class, TransAttribute$JAXB.class);
+ }
+
+ public static ContainerTransaction readContainerTransaction(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeContainerTransaction(XoXMLStreamWriter writer, ContainerTransaction containerTransaction, RuntimeContext context)
+ throws Exception {
+ _write(writer, containerTransaction, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, ContainerTransaction containerTransaction, RuntimeContext context)
+ throws Exception {
+ _write(writer, containerTransaction, context);
+ }
+
+ public final static ContainerTransaction _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ ContainerTransaction containerTransaction = new ContainerTransaction();
+ context.beforeUnmarshal(containerTransaction, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ List<Method> method = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("container-transactionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, ContainerTransaction.class);
+ }
+ }
+
+ // Read attributes
+ for (Attribute attribute : reader.getAttributes()) {
+ if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
+ // ATTRIBUTE: id
+ String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
+ context.addXmlId(reader, id, containerTransaction);
+ containerTransaction.id = id;
+ } else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
+ context.unexpectedAttribute(attribute, new QName("", "id"));
+ }
+ }
+
+ // Read elements
+ for (XoXMLStreamReader elementReader : reader.getChildElements()) {
+ if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: descriptions
+ Text descriptionsItem = readText(elementReader, context);
+ if (descriptions == null) {
+ descriptions = new ArrayList<Text>();
+ }
+ descriptions.add(descriptionsItem);
+ } else if (("method" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: method
+ Method methodItem = readMethod(elementReader, context);
+ if (method == null) {
+ method = containerTransaction.method;
+ if (method != null) {
+ method.clear();
+ } else {
+ method = new ArrayList<Method>();
+ }
+ }
+ method.add(methodItem);
+ } else if (("trans-attribute" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: transAttribute
+ TransAttribute transAttribute = parseTransAttribute(elementReader, context, elementReader.getElementAsString());
+ if (transAttribute != null) {
+ containerTransaction.transAttribute = transAttribute;
+ }
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "method"), new QName("http://java.sun.com/xml/ns/javaee", "trans-attribute"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ containerTransaction.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, ContainerTransaction.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (method != null) {
+ containerTransaction.method = method;
+ }
+
+ context.afterUnmarshal(containerTransaction, LifecycleCallback.NONE);
+
+ return containerTransaction;
+ }
+
+ public final ContainerTransaction read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, ContainerTransaction containerTransaction, RuntimeContext context)
+ throws Exception {
+ if (containerTransaction == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (ContainerTransaction.class != containerTransaction.getClass()) {
+ context.unexpectedSubclass(writer, containerTransaction, ContainerTransaction.class);
+ return;
+ }
+
+ context.beforeMarshal(containerTransaction, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = containerTransaction.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(containerTransaction, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = containerTransaction.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(containerTransaction, "descriptions", ContainerTransaction.class, "getDescriptions", e);
+ }
+ if (descriptions != null) {
+ for (Text descriptionsItem : descriptions) {
+ if (descriptionsItem != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, descriptionsItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerTransaction, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: method
+ List<Method> method = containerTransaction.method;
+ if (method != null) {
+ for (Method methodItem : method) {
+ if (methodItem != null) {
+ writer.writeStartElement(prefix, "method", "http://java.sun.com/xml/ns/javaee");
+ writeMethod(writer, methodItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerTransaction, "method");
+ }
+ }
+ }
+
+ // ELEMENT: transAttribute
+ TransAttribute transAttribute = containerTransaction.transAttribute;
+ if (transAttribute != null) {
+ writer.writeStartElement(prefix, "trans-attribute", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringTransAttribute(containerTransaction, null, context, transAttribute));
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(containerTransaction, "transAttribute");
+ }
+
+ context.afterMarshal(containerTransaction, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/ContainerTransaction$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native