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 [25/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/ ope...
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponent$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponent%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponent$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponent$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,436 @@
+/*
+ * 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.Addressing$JAXB.readAddressing;
+import static org.apache.openejb.jee.Addressing$JAXB.writeAddressing;
+import static org.apache.openejb.jee.Handler$JAXB.readHandler;
+import static org.apache.openejb.jee.Handler$JAXB.writeHandler;
+import static org.apache.openejb.jee.HandlerChains$JAXB.readHandlerChains;
+import static org.apache.openejb.jee.HandlerChains$JAXB.writeHandlerChains;
+import static org.apache.openejb.jee.Icon$JAXB.readIcon;
+import static org.apache.openejb.jee.Icon$JAXB.writeIcon;
+import static org.apache.openejb.jee.RespectBinding$JAXB.readRespectBinding;
+import static org.apache.openejb.jee.RespectBinding$JAXB.writeRespectBinding;
+import static org.apache.openejb.jee.ServiceImplBean$JAXB.readServiceImplBean;
+import static org.apache.openejb.jee.ServiceImplBean$JAXB.writeServiceImplBean;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class PortComponent$JAXB
+ extends JAXBObject<PortComponent> {
+
+
+ public PortComponent$JAXB() {
+ super(PortComponent.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "port-componentType".intern()), Icon$JAXB.class, Addressing$JAXB.class, RespectBinding$JAXB.class, ServiceImplBean$JAXB.class, Handler$JAXB.class, HandlerChains$JAXB.class);
+ }
+
+ public static PortComponent readPortComponent(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writePortComponent(XoXMLStreamWriter writer, PortComponent portComponent, RuntimeContext context)
+ throws Exception {
+ _write(writer, portComponent, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, PortComponent portComponent, RuntimeContext context)
+ throws Exception {
+ _write(writer, portComponent, context);
+ }
+
+ public final static PortComponent _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ PortComponent portComponent = new PortComponent();
+ context.beforeUnmarshal(portComponent, LifecycleCallback.NONE);
+
+ List<Handler> handler = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("port-componentType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, PortComponent.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, portComponent);
+ portComponent.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: description
+ String descriptionRaw = elementReader.getElementAsString();
+
+ String description;
+ try {
+ description = Adapters.collapsedStringAdapterAdapter.unmarshal(descriptionRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponent.description = description;
+ } else if (("display-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: displayName
+ String displayNameRaw = elementReader.getElementAsString();
+
+ String displayName;
+ try {
+ displayName = Adapters.collapsedStringAdapterAdapter.unmarshal(displayNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponent.displayName = displayName;
+ } else if (("icon" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: icon
+ Icon icon = readIcon(elementReader, context);
+ portComponent.icon = icon;
+ } else if (("port-component-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: portComponentName
+ String portComponentNameRaw = elementReader.getElementAsString();
+
+ String portComponentName;
+ try {
+ portComponentName = Adapters.collapsedStringAdapterAdapter.unmarshal(portComponentNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponent.portComponentName = portComponentName;
+ } else if (("wsdl-service" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: wsdlService
+ QName wsdlService = elementReader.getElementAsQName();
+ portComponent.wsdlService = wsdlService;
+ } else if (("wsdl-port" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: wsdlPort
+ QName wsdlPort = elementReader.getElementAsQName();
+ portComponent.wsdlPort = wsdlPort;
+ } else if (("enable-mtom" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: enableMtom
+ Boolean enableMtom = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ portComponent.enableMtom = enableMtom;
+ } else if (("mtom-threshold" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: mtomThreshold
+ Integer mtomThreshold = Integer.valueOf(elementReader.getElementAsString());
+ portComponent.mtomThreshold = mtomThreshold;
+ } else if (("addressing" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: addressing
+ Addressing addressing = readAddressing(elementReader, context);
+ portComponent.addressing = addressing;
+ } else if (("respect-binding" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: respectBinding
+ RespectBinding respectBinding = readRespectBinding(elementReader, context);
+ portComponent.respectBinding = respectBinding;
+ } else if (("protocol-binding" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: protocolBinding
+ String protocolBindingRaw = elementReader.getElementAsString();
+
+ String protocolBinding;
+ try {
+ protocolBinding = Adapters.collapsedStringAdapterAdapter.unmarshal(protocolBindingRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponent.protocolBinding = protocolBinding;
+ } else if (("service-endpoint-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: serviceEndpointInterface
+ String serviceEndpointInterfaceRaw = elementReader.getElementAsString();
+
+ String serviceEndpointInterface;
+ try {
+ serviceEndpointInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(serviceEndpointInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponent.serviceEndpointInterface = serviceEndpointInterface;
+ } else if (("service-impl-bean" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: serviceImplBean
+ ServiceImplBean serviceImplBean = readServiceImplBean(elementReader, context);
+ portComponent.serviceImplBean = serviceImplBean;
+ } else if (("handler" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: handler
+ Handler handlerItem = readHandler(elementReader, context);
+ if (handler == null) {
+ handler = portComponent.handler;
+ if (handler != null) {
+ handler.clear();
+ } else {
+ handler = new ArrayList<Handler>();
+ }
+ }
+ handler.add(handlerItem);
+ } else if (("handler-chains" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: handlerChains
+ HandlerChains handlerChains = readHandlerChains(elementReader, context);
+ portComponent.handlerChains = handlerChains;
+ } else {
+ context.unexpectedElement(elementReader, 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", "port-component-name"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-service"), new QName("http://java.sun.com/xml/ns/javaee", "wsdl-port"), new QName("http://java.sun.com/xml/ns/javaee", "enable-mtom"), new QName("http://java.sun.com/xml/ns/javaee", "mtom-threshold"), new QName("http://java.sun.com/xml/ns/javaee", "addressing"), new QName("http://java.sun.com/xml/ns/javaee", "respect-binding"), new QName("http://java.sun.com/xml/ns/javaee", "protocol-binding"), new QName("http://java.sun.com/xml/ns/javaee", "service-endpoint-interface"), new QName("http://java.sun.com/xml/ns/javaee", "service-impl-bean"), new QName("http://java.sun.com/xml/ns/javaee", "handler"), new QName("http://jav
a.sun.com/xml/ns/javaee", "handler-chains"));
+ }
+ }
+ if (handler != null) {
+ portComponent.handler = handler;
+ }
+
+ context.afterUnmarshal(portComponent, LifecycleCallback.NONE);
+
+ return portComponent;
+ }
+
+ public final PortComponent read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, PortComponent portComponent, RuntimeContext context)
+ throws Exception {
+ if (portComponent == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (PortComponent.class != portComponent.getClass()) {
+ context.unexpectedSubclass(writer, portComponent, PortComponent.class);
+ return;
+ }
+
+ context.beforeMarshal(portComponent, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = portComponent.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: description
+ String descriptionRaw = portComponent.description;
+ String description = null;
+ try {
+ description = Adapters.collapsedStringAdapterAdapter.marshal(descriptionRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "description", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (description != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(description);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: displayName
+ String displayNameRaw = portComponent.displayName;
+ String displayName = null;
+ try {
+ displayName = Adapters.collapsedStringAdapterAdapter.marshal(displayNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "displayName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (displayName != null) {
+ writer.writeStartElement(prefix, "display-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(displayName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: icon
+ Icon icon = portComponent.icon;
+ if (icon != null) {
+ writer.writeStartElement(prefix, "icon", "http://java.sun.com/xml/ns/javaee");
+ writeIcon(writer, icon, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: portComponentName
+ String portComponentNameRaw = portComponent.portComponentName;
+ String portComponentName = null;
+ try {
+ portComponentName = Adapters.collapsedStringAdapterAdapter.marshal(portComponentNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "portComponentName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (portComponentName != null) {
+ writer.writeStartElement(prefix, "port-component-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(portComponentName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(portComponent, "portComponentName");
+ }
+
+ // ELEMENT: wsdlService
+ QName wsdlService = portComponent.wsdlService;
+ if (wsdlService != null) {
+ writer.writeStartElement(prefix, "wsdl-service", "http://java.sun.com/xml/ns/javaee");
+ writer.writeQName(wsdlService);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: wsdlPort
+ QName wsdlPort = portComponent.wsdlPort;
+ if (wsdlPort != null) {
+ writer.writeStartElement(prefix, "wsdl-port", "http://java.sun.com/xml/ns/javaee");
+ writer.writeQName(wsdlPort);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: enableMtom
+ Boolean enableMtom = portComponent.enableMtom;
+ if (enableMtom != null) {
+ writer.writeStartElement(prefix, "enable-mtom", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(enableMtom));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: mtomThreshold
+ Integer mtomThreshold = portComponent.mtomThreshold;
+ if (mtomThreshold != null) {
+ writer.writeStartElement(prefix, "mtom-threshold", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Integer.toString(mtomThreshold));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: addressing
+ Addressing addressing = portComponent.addressing;
+ if (addressing != null) {
+ writer.writeStartElement(prefix, "addressing", "http://java.sun.com/xml/ns/javaee");
+ writeAddressing(writer, addressing, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: respectBinding
+ RespectBinding respectBinding = portComponent.respectBinding;
+ if (respectBinding != null) {
+ writer.writeStartElement(prefix, "respect-binding", "http://java.sun.com/xml/ns/javaee");
+ writeRespectBinding(writer, respectBinding, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: protocolBinding
+ String protocolBindingRaw = portComponent.protocolBinding;
+ String protocolBinding = null;
+ try {
+ protocolBinding = Adapters.collapsedStringAdapterAdapter.marshal(protocolBindingRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "protocolBinding", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (protocolBinding != null) {
+ writer.writeStartElement(prefix, "protocol-binding", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(protocolBinding);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: serviceEndpointInterface
+ String serviceEndpointInterfaceRaw = portComponent.serviceEndpointInterface;
+ String serviceEndpointInterface = null;
+ try {
+ serviceEndpointInterface = Adapters.collapsedStringAdapterAdapter.marshal(serviceEndpointInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponent, "serviceEndpointInterface", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (serviceEndpointInterface != null) {
+ writer.writeStartElement(prefix, "service-endpoint-interface", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(serviceEndpointInterface);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: serviceImplBean
+ ServiceImplBean serviceImplBean = portComponent.serviceImplBean;
+ if (serviceImplBean != null) {
+ writer.writeStartElement(prefix, "service-impl-bean", "http://java.sun.com/xml/ns/javaee");
+ writeServiceImplBean(writer, serviceImplBean, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(portComponent, "serviceImplBean");
+ }
+
+ // ELEMENT: handler
+ List<Handler> handler = portComponent.handler;
+ if (handler != null) {
+ for (Handler handlerItem : handler) {
+ writer.writeStartElement(prefix, "handler", "http://java.sun.com/xml/ns/javaee");
+ if (handlerItem != null) {
+ writeHandler(writer, handlerItem, context);
+ } else {
+ writer.writeXsiNil();
+ }
+ writer.writeEndElement();
+ }
+ }
+
+ // ELEMENT: handlerChains
+ HandlerChains handlerChains = portComponent.handlerChains;
+ if (handlerChains != null) {
+ writer.writeStartElement(prefix, "handler-chains", "http://java.sun.com/xml/ns/javaee");
+ writeHandlerChains(writer, handlerChains, context);
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(portComponent, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponent$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponentRef$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponentRef%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponentRef$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponentRef$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,253 @@
+/*
+ * 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 static org.apache.openejb.jee.Addressing$JAXB.readAddressing;
+import static org.apache.openejb.jee.Addressing$JAXB.writeAddressing;
+import static org.apache.openejb.jee.RespectBinding$JAXB.readRespectBinding;
+import static org.apache.openejb.jee.RespectBinding$JAXB.writeRespectBinding;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class PortComponentRef$JAXB
+ extends JAXBObject<PortComponentRef> {
+
+
+ public PortComponentRef$JAXB() {
+ super(PortComponentRef.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "port-component-refType".intern()), Addressing$JAXB.class, RespectBinding$JAXB.class);
+ }
+
+ public static PortComponentRef readPortComponentRef(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writePortComponentRef(XoXMLStreamWriter writer, PortComponentRef portComponentRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, portComponentRef, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, PortComponentRef portComponentRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, portComponentRef, context);
+ }
+
+ public final static PortComponentRef _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ PortComponentRef portComponentRef = new PortComponentRef();
+ context.beforeUnmarshal(portComponentRef, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("port-component-refType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, PortComponentRef.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, portComponentRef);
+ portComponentRef.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 (("service-endpoint-interface" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: serviceEndpointInterface
+ String serviceEndpointInterfaceRaw = elementReader.getElementAsString();
+
+ String serviceEndpointInterface;
+ try {
+ serviceEndpointInterface = Adapters.collapsedStringAdapterAdapter.unmarshal(serviceEndpointInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponentRef.serviceEndpointInterface = serviceEndpointInterface;
+ } else if (("enable-mtom" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: enableMtom
+ Boolean enableMtom = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ portComponentRef.enableMtom = enableMtom;
+ } else if (("mtom-threshold" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: mtomThreshold
+ Integer mtomThreshold = Integer.valueOf(elementReader.getElementAsString());
+ portComponentRef.mtomThreshold = mtomThreshold;
+ } else if (("addressing" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: addressing
+ Addressing addressing = readAddressing(elementReader, context);
+ portComponentRef.addressing = addressing;
+ } else if (("respect-binding" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: respectBinding
+ RespectBinding respectBinding = readRespectBinding(elementReader, context);
+ portComponentRef.respectBinding = respectBinding;
+ } else if (("port-component-link" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: portComponentLink
+ String portComponentLinkRaw = elementReader.getElementAsString();
+
+ String portComponentLink;
+ try {
+ portComponentLink = Adapters.collapsedStringAdapterAdapter.unmarshal(portComponentLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portComponentRef.portComponentLink = portComponentLink;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "service-endpoint-interface"), new QName("http://java.sun.com/xml/ns/javaee", "enable-mtom"), new QName("http://java.sun.com/xml/ns/javaee", "mtom-threshold"), new QName("http://java.sun.com/xml/ns/javaee", "addressing"), new QName("http://java.sun.com/xml/ns/javaee", "respect-binding"), new QName("http://java.sun.com/xml/ns/javaee", "port-component-link"));
+ }
+ }
+
+ context.afterUnmarshal(portComponentRef, LifecycleCallback.NONE);
+
+ return portComponentRef;
+ }
+
+ public final PortComponentRef read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, PortComponentRef portComponentRef, RuntimeContext context)
+ throws Exception {
+ if (portComponentRef == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (PortComponentRef.class != portComponentRef.getClass()) {
+ context.unexpectedSubclass(writer, portComponentRef, PortComponentRef.class);
+ return;
+ }
+
+ context.beforeMarshal(portComponentRef, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = portComponentRef.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponentRef, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: serviceEndpointInterface
+ String serviceEndpointInterfaceRaw = portComponentRef.serviceEndpointInterface;
+ String serviceEndpointInterface = null;
+ try {
+ serviceEndpointInterface = Adapters.collapsedStringAdapterAdapter.marshal(serviceEndpointInterfaceRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponentRef, "serviceEndpointInterface", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (serviceEndpointInterface != null) {
+ writer.writeStartElement(prefix, "service-endpoint-interface", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(serviceEndpointInterface);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(portComponentRef, "serviceEndpointInterface");
+ }
+
+ // ELEMENT: enableMtom
+ Boolean enableMtom = portComponentRef.enableMtom;
+ if (enableMtom != null) {
+ writer.writeStartElement(prefix, "enable-mtom", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(enableMtom));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: mtomThreshold
+ Integer mtomThreshold = portComponentRef.mtomThreshold;
+ if (mtomThreshold != null) {
+ writer.writeStartElement(prefix, "mtom-threshold", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Integer.toString(mtomThreshold));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: addressing
+ Addressing addressing = portComponentRef.addressing;
+ if (addressing != null) {
+ writer.writeStartElement(prefix, "addressing", "http://java.sun.com/xml/ns/javaee");
+ writeAddressing(writer, addressing, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: respectBinding
+ RespectBinding respectBinding = portComponentRef.respectBinding;
+ if (respectBinding != null) {
+ writer.writeStartElement(prefix, "respect-binding", "http://java.sun.com/xml/ns/javaee");
+ writeRespectBinding(writer, respectBinding, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: portComponentLink
+ String portComponentLinkRaw = portComponentRef.portComponentLink;
+ String portComponentLink = null;
+ try {
+ portComponentLink = Adapters.collapsedStringAdapterAdapter.marshal(portComponentLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portComponentRef, "portComponentLink", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (portComponentLink != null) {
+ writer.writeStartElement(prefix, "port-component-link", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(portComponentLink);
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(portComponentRef, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortComponentRef$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortMapping$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortMapping%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortMapping$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortMapping$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,202 @@
+/*
+ * 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;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class PortMapping$JAXB
+ extends JAXBObject<PortMapping> {
+
+
+ public PortMapping$JAXB() {
+ super(PortMapping.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "port-mappingType".intern()));
+ }
+
+ public static PortMapping readPortMapping(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writePortMapping(XoXMLStreamWriter writer, PortMapping portMapping, RuntimeContext context)
+ throws Exception {
+ _write(writer, portMapping, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, PortMapping portMapping, RuntimeContext context)
+ throws Exception {
+ _write(writer, portMapping, context);
+ }
+
+ public final static PortMapping _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ PortMapping portMapping = new PortMapping();
+ context.beforeUnmarshal(portMapping, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("port-mappingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, PortMapping.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, portMapping);
+ portMapping.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 (("port-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: portName
+ String portNameRaw = elementReader.getElementAsString();
+
+ String portName;
+ try {
+ portName = Adapters.collapsedStringAdapterAdapter.unmarshal(portNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portMapping.portName = portName;
+ } else if (("java-port-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: javaPortName
+ String javaPortNameRaw = elementReader.getElementAsString();
+
+ String javaPortName;
+ try {
+ javaPortName = Adapters.collapsedStringAdapterAdapter.unmarshal(javaPortNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ portMapping.javaPortName = javaPortName;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "port-name"), new QName("http://java.sun.com/xml/ns/javaee", "java-port-name"));
+ }
+ }
+
+ context.afterUnmarshal(portMapping, LifecycleCallback.NONE);
+
+ return portMapping;
+ }
+
+ public final PortMapping read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, PortMapping portMapping, RuntimeContext context)
+ throws Exception {
+ if (portMapping == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (PortMapping.class != portMapping.getClass()) {
+ context.unexpectedSubclass(writer, portMapping, PortMapping.class);
+ return;
+ }
+
+ context.beforeMarshal(portMapping, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = portMapping.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portMapping, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: portName
+ String portNameRaw = portMapping.portName;
+ String portName = null;
+ try {
+ portName = Adapters.collapsedStringAdapterAdapter.marshal(portNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portMapping, "portName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (portName != null) {
+ writer.writeStartElement(prefix, "port-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(portName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(portMapping, "portName");
+ }
+
+ // ELEMENT: javaPortName
+ String javaPortNameRaw = portMapping.javaPortName;
+ String javaPortName = null;
+ try {
+ javaPortName = Adapters.collapsedStringAdapterAdapter.marshal(javaPortNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(portMapping, "javaPortName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (javaPortName != null) {
+ writer.writeStartElement(prefix, "java-port-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(javaPortName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(portMapping, "javaPortName");
+ }
+
+ context.afterMarshal(portMapping, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/PortMapping$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Property$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Property%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Property$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Property$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,202 @@
+/*
+ * 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;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class Property$JAXB
+ extends JAXBObject<Property> {
+
+
+ public Property$JAXB() {
+ super(Property.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "propertyType".intern()));
+ }
+
+ public static Property readProperty(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeProperty(XoXMLStreamWriter writer, Property property, RuntimeContext context)
+ throws Exception {
+ _write(writer, property, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Property property, RuntimeContext context)
+ throws Exception {
+ _write(writer, property, context);
+ }
+
+ public final static Property _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Property property = new Property();
+ context.beforeUnmarshal(property, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("propertyType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Property.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, property);
+ property.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 (("name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: name
+ String nameRaw = elementReader.getElementAsString();
+
+ String name;
+ try {
+ name = Adapters.collapsedStringAdapterAdapter.unmarshal(nameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ property.name = name;
+ } else if (("value" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: value
+ String valueRaw = elementReader.getElementAsString();
+
+ String value;
+ try {
+ value = Adapters.collapsedStringAdapterAdapter.unmarshal(valueRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ property.value = value;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "name"), new QName("http://java.sun.com/xml/ns/javaee", "value"));
+ }
+ }
+
+ context.afterUnmarshal(property, LifecycleCallback.NONE);
+
+ return property;
+ }
+
+ public final Property read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Property property, RuntimeContext context)
+ throws Exception {
+ if (property == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (Property.class != property.getClass()) {
+ context.unexpectedSubclass(writer, property, Property.class);
+ return;
+ }
+
+ context.beforeMarshal(property, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = property.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(property, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: name
+ String nameRaw = property.name;
+ String name = null;
+ try {
+ name = Adapters.collapsedStringAdapterAdapter.marshal(nameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(property, "name", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (name != null) {
+ writer.writeStartElement(prefix, "name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(name);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(property, "name");
+ }
+
+ // ELEMENT: value
+ String valueRaw = property.value;
+ String value = null;
+ try {
+ value = Adapters.collapsedStringAdapterAdapter.marshal(valueRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(property, "value", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (value != null) {
+ writer.writeStartElement(prefix, "value", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(value);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(property, "value");
+ }
+
+ context.afterMarshal(property, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Property$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Query$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Query%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Query$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Query$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,220 @@
+/*
+ * 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 static org.apache.openejb.jee.QueryMethod$JAXB.readQueryMethod;
+import static org.apache.openejb.jee.QueryMethod$JAXB.writeQueryMethod;
+import static org.apache.openejb.jee.ResultTypeMapping$JAXB.parseResultTypeMapping;
+import static org.apache.openejb.jee.ResultTypeMapping$JAXB.toStringResultTypeMapping;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class Query$JAXB
+ extends JAXBObject<Query> {
+
+
+ public Query$JAXB() {
+ super(Query.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "queryType".intern()), Text$JAXB.class, QueryMethod$JAXB.class, ResultTypeMapping$JAXB.class);
+ }
+
+ public static Query readQuery(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeQuery(XoXMLStreamWriter writer, Query query, RuntimeContext context)
+ throws Exception {
+ _write(writer, query, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Query query, RuntimeContext context)
+ throws Exception {
+ _write(writer, query, context);
+ }
+
+ public final static Query _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Query query = new Query();
+ context.beforeUnmarshal(query, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("queryType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Query.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, query);
+ query.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: description
+ Text description = readText(elementReader, context);
+ query.description = description;
+ } else if (("query-method" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: queryMethod
+ QueryMethod queryMethod = readQueryMethod(elementReader, context);
+ query.queryMethod = queryMethod;
+ } else if (("result-type-mapping" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: resultTypeMapping
+ ResultTypeMapping resultTypeMapping = parseResultTypeMapping(elementReader, context, elementReader.getElementAsString());
+ if (resultTypeMapping != null) {
+ query.resultTypeMapping = resultTypeMapping;
+ }
+ } else if (("ejb-ql" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbQl
+ String ejbQlRaw = elementReader.getElementAsString();
+
+ String ejbQl;
+ try {
+ ejbQl = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbQlRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ query.ejbQl = ejbQl;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "query-method"), new QName("http://java.sun.com/xml/ns/javaee", "result-type-mapping"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ql"));
+ }
+ }
+
+ context.afterUnmarshal(query, LifecycleCallback.NONE);
+
+ return query;
+ }
+
+ public final Query read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Query query, RuntimeContext context)
+ throws Exception {
+ if (query == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (Query.class != query.getClass()) {
+ context.unexpectedSubclass(writer, query, Query.class);
+ return;
+ }
+
+ context.beforeMarshal(query, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = query.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(query, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: description
+ Text description = query.description;
+ if (description != null) {
+ writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, description, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: queryMethod
+ QueryMethod queryMethod = query.queryMethod;
+ if (queryMethod != null) {
+ writer.writeStartElement(prefix, "query-method", "http://java.sun.com/xml/ns/javaee");
+ writeQueryMethod(writer, queryMethod, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(query, "queryMethod");
+ }
+
+ // ELEMENT: resultTypeMapping
+ ResultTypeMapping resultTypeMapping = query.resultTypeMapping;
+ if (resultTypeMapping != null) {
+ writer.writeStartElement(prefix, "result-type-mapping", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringResultTypeMapping(query, null, context, resultTypeMapping));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: ejbQl
+ String ejbQlRaw = query.ejbQl;
+ String ejbQl = null;
+ try {
+ ejbQl = Adapters.collapsedStringAdapterAdapter.marshal(ejbQlRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(query, "ejbQl", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbQl != null) {
+ writer.writeStartElement(prefix, "ejb-ql", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbQl);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(query, "ejbQl");
+ }
+
+ context.afterMarshal(query, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Query$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/QueryMethod$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/QueryMethod%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/QueryMethod$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/QueryMethod$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 static org.apache.openejb.jee.MethodParams$JAXB.readMethodParams;
+import static org.apache.openejb.jee.MethodParams$JAXB.writeMethodParams;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class QueryMethod$JAXB
+ extends JAXBObject<QueryMethod> {
+
+
+ public QueryMethod$JAXB() {
+ super(QueryMethod.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "query-methodType".intern()), MethodParams$JAXB.class);
+ }
+
+ public static QueryMethod readQueryMethod(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeQueryMethod(XoXMLStreamWriter writer, QueryMethod queryMethod, RuntimeContext context)
+ throws Exception {
+ _write(writer, queryMethod, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, QueryMethod queryMethod, RuntimeContext context)
+ throws Exception {
+ _write(writer, queryMethod, context);
+ }
+
+ public final static QueryMethod _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ QueryMethod queryMethod = new QueryMethod();
+ context.beforeUnmarshal(queryMethod, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("query-methodType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, QueryMethod.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, queryMethod);
+ queryMethod.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 (("method-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: methodName
+ String methodNameRaw = elementReader.getElementAsString();
+
+ String methodName;
+ try {
+ methodName = Adapters.collapsedStringAdapterAdapter.unmarshal(methodNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ queryMethod.methodName = methodName;
+ } else if (("method-params" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: methodParams
+ MethodParams methodParams = readMethodParams(elementReader, context);
+ queryMethod.methodParams = methodParams;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "method-name"), new QName("http://java.sun.com/xml/ns/javaee", "method-params"));
+ }
+ }
+
+ context.afterUnmarshal(queryMethod, LifecycleCallback.NONE);
+
+ return queryMethod;
+ }
+
+ public final QueryMethod read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, QueryMethod queryMethod, RuntimeContext context)
+ throws Exception {
+ if (queryMethod == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (QueryMethod.class != queryMethod.getClass()) {
+ context.unexpectedSubclass(writer, queryMethod, QueryMethod.class);
+ return;
+ }
+
+ context.beforeMarshal(queryMethod, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = queryMethod.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(queryMethod, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: methodName
+ String methodNameRaw = queryMethod.methodName;
+ String methodName = null;
+ try {
+ methodName = Adapters.collapsedStringAdapterAdapter.marshal(methodNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(queryMethod, "methodName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (methodName != null) {
+ writer.writeStartElement(prefix, "method-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(methodName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(queryMethod, "methodName");
+ }
+
+ // ELEMENT: methodParams
+ MethodParams methodParams = queryMethod.methodParams;
+ if (methodParams != null) {
+ writer.writeStartElement(prefix, "method-params", "http://java.sun.com/xml/ns/javaee");
+ writeMethodParams(writer, methodParams, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(queryMethod, "methodParams");
+ }
+
+ context.afterMarshal(queryMethod, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/QueryMethod$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/RelationshipRoleSource$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/RelationshipRoleSource%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/RelationshipRoleSource$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/RelationshipRoleSource$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,211 @@
+/*
+ * 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 RelationshipRoleSource$JAXB
+ extends JAXBObject<RelationshipRoleSource> {
+
+
+ public RelationshipRoleSource$JAXB() {
+ super(RelationshipRoleSource.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "relationship-role-sourceType".intern()), Text$JAXB.class);
+ }
+
+ public static RelationshipRoleSource readRelationshipRoleSource(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeRelationshipRoleSource(XoXMLStreamWriter writer, RelationshipRoleSource relationshipRoleSource, RuntimeContext context)
+ throws Exception {
+ _write(writer, relationshipRoleSource, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, RelationshipRoleSource relationshipRoleSource, RuntimeContext context)
+ throws Exception {
+ _write(writer, relationshipRoleSource, context);
+ }
+
+ public final static RelationshipRoleSource _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ RelationshipRoleSource relationshipRoleSource = new RelationshipRoleSource();
+ context.beforeUnmarshal(relationshipRoleSource, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("relationship-role-sourceType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, RelationshipRoleSource.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, relationshipRoleSource);
+ relationshipRoleSource.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 (("ejb-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbName
+ String ejbNameRaw = elementReader.getElementAsString();
+
+ String ejbName;
+ try {
+ ejbName = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ relationshipRoleSource.ejbName = ejbName;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-name"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ relationshipRoleSource.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, RelationshipRoleSource.class, "setDescriptions", Text[].class, e);
+ }
+ }
+
+ context.afterUnmarshal(relationshipRoleSource, LifecycleCallback.NONE);
+
+ return relationshipRoleSource;
+ }
+
+ public final RelationshipRoleSource read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, RelationshipRoleSource relationshipRoleSource, RuntimeContext context)
+ throws Exception {
+ if (relationshipRoleSource == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (RelationshipRoleSource.class != relationshipRoleSource.getClass()) {
+ context.unexpectedSubclass(writer, relationshipRoleSource, RelationshipRoleSource.class);
+ return;
+ }
+
+ context.beforeMarshal(relationshipRoleSource, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = relationshipRoleSource.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(relationshipRoleSource, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = relationshipRoleSource.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(relationshipRoleSource, "descriptions", RelationshipRoleSource.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(relationshipRoleSource, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: ejbName
+ String ejbNameRaw = relationshipRoleSource.ejbName;
+ String ejbName = null;
+ try {
+ ejbName = Adapters.collapsedStringAdapterAdapter.marshal(ejbNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(relationshipRoleSource, "ejbName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbName != null) {
+ writer.writeStartElement(prefix, "ejb-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(relationshipRoleSource, "ejbName");
+ }
+
+ context.afterMarshal(relationshipRoleSource, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/RelationshipRoleSource$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native