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 [7/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/EjbLocalRef$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbLocalRef%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbLocalRef$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbLocalRef$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,396 @@
+/*
+ * 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.LinkedHashSet;
+import java.util.Set;
+
+import static org.apache.openejb.jee.EjbRefType$JAXB.parseEjbRefType;
+import static org.apache.openejb.jee.EjbRefType$JAXB.toStringEjbRefType;
+import static org.apache.openejb.jee.InjectionTarget$JAXB.readInjectionTarget;
+import static org.apache.openejb.jee.InjectionTarget$JAXB.writeInjectionTarget;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class EjbLocalRef$JAXB
+ extends JAXBObject<EjbLocalRef> {
+
+
+ public EjbLocalRef$JAXB() {
+ super(EjbLocalRef.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "ejb-local-refType".intern()), Text$JAXB.class, EjbRefType$JAXB.class, InjectionTarget$JAXB.class);
+ }
+
+ public static EjbLocalRef readEjbLocalRef(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeEjbLocalRef(XoXMLStreamWriter writer, EjbLocalRef ejbLocalRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbLocalRef, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, EjbLocalRef ejbLocalRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbLocalRef, context);
+ }
+
+ public final static EjbLocalRef _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ EjbLocalRef ejbLocalRef = new EjbLocalRef();
+ context.beforeUnmarshal(ejbLocalRef, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ Set<InjectionTarget> injectionTarget = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("ejb-local-refType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, EjbLocalRef.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, ejbLocalRef);
+ ejbLocalRef.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-ref-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRefName
+ String ejbRefNameRaw = elementReader.getElementAsString();
+
+ String ejbRefName;
+ try {
+ ejbRefName = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbRefNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.ejbRefName = ejbRefName;
+ } else if (("ejb-ref-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRefType
+ EjbRefType ejbRefType = parseEjbRefType(elementReader, context, elementReader.getElementAsString());
+ if (ejbRefType != null) {
+ ejbLocalRef.ejbRefType = ejbRefType;
+ }
+ } else if (("local-home" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: localHome
+ String localHomeRaw = elementReader.getElementAsString();
+
+ String localHome;
+ try {
+ localHome = Adapters.collapsedStringAdapterAdapter.unmarshal(localHomeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.localHome = localHome;
+ } else if (("local" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: local
+ String localRaw = elementReader.getElementAsString();
+
+ String local;
+ try {
+ local = Adapters.collapsedStringAdapterAdapter.unmarshal(localRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.local = local;
+ } else if (("ejb-link" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbLink
+ String ejbLinkRaw = elementReader.getElementAsString();
+
+ String ejbLink;
+ try {
+ ejbLink = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.ejbLink = ejbLink;
+ } else if (("mapped-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: mappedName
+ String mappedNameRaw = elementReader.getElementAsString();
+
+ String mappedName;
+ try {
+ mappedName = Adapters.collapsedStringAdapterAdapter.unmarshal(mappedNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.mappedName = mappedName;
+ } else if (("injection-target" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: injectionTarget
+ InjectionTarget injectionTargetItem = readInjectionTarget(elementReader, context);
+ if (injectionTarget == null) {
+ injectionTarget = ejbLocalRef.injectionTarget;
+ if (injectionTarget != null) {
+ injectionTarget.clear();
+ } else {
+ injectionTarget = new LinkedHashSet<InjectionTarget>();
+ }
+ }
+ injectionTarget.add(injectionTargetItem);
+ } else if (("lookup-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: lookupName
+ String lookupNameRaw = elementReader.getElementAsString();
+
+ String lookupName;
+ try {
+ lookupName = Adapters.collapsedStringAdapterAdapter.unmarshal(lookupNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbLocalRef.lookupName = lookupName;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ref-name"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ref-type"), new QName("http://java.sun.com/xml/ns/javaee", "local-home"), new QName("http://java.sun.com/xml/ns/javaee", "local"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-link"), new QName("http://java.sun.com/xml/ns/javaee", "mapped-name"), new QName("http://java.sun.com/xml/ns/javaee", "injection-target"), new QName("http://java.sun.com/xml/ns/javaee", "lookup-name"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ ejbLocalRef.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, EjbLocalRef.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (injectionTarget != null) {
+ ejbLocalRef.injectionTarget = injectionTarget;
+ }
+
+ context.afterUnmarshal(ejbLocalRef, LifecycleCallback.NONE);
+
+ return ejbLocalRef;
+ }
+
+ public final EjbLocalRef read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, EjbLocalRef ejbLocalRef, RuntimeContext context)
+ throws Exception {
+ if (ejbLocalRef == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (EjbLocalRef.class != ejbLocalRef.getClass()) {
+ context.unexpectedSubclass(writer, ejbLocalRef, EjbLocalRef.class);
+ return;
+ }
+
+ context.beforeMarshal(ejbLocalRef, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = ejbLocalRef.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = ejbLocalRef.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(ejbLocalRef, "descriptions", EjbLocalRef.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(ejbLocalRef, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: ejbRefName
+ String ejbRefNameRaw = ejbLocalRef.ejbRefName;
+ String ejbRefName = null;
+ try {
+ ejbRefName = Adapters.collapsedStringAdapterAdapter.marshal(ejbRefNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "ejbRefName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbRefName != null) {
+ writer.writeStartElement(prefix, "ejb-ref-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbRefName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbLocalRef, "ejbRefName");
+ }
+
+ // ELEMENT: ejbRefType
+ EjbRefType ejbRefType = ejbLocalRef.ejbRefType;
+ if (ejbRefType != null) {
+ writer.writeStartElement(prefix, "ejb-ref-type", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringEjbRefType(ejbLocalRef, null, context, ejbRefType));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: localHome
+ String localHomeRaw = ejbLocalRef.localHome;
+ String localHome = null;
+ try {
+ localHome = Adapters.collapsedStringAdapterAdapter.marshal(localHomeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "localHome", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (localHome != null) {
+ writer.writeStartElement(prefix, "local-home", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(localHome);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: local
+ String localRaw = ejbLocalRef.local;
+ String local = null;
+ try {
+ local = Adapters.collapsedStringAdapterAdapter.marshal(localRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "local", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (local != null) {
+ writer.writeStartElement(prefix, "local", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(local);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: ejbLink
+ String ejbLinkRaw = ejbLocalRef.ejbLink;
+ String ejbLink = null;
+ try {
+ ejbLink = Adapters.collapsedStringAdapterAdapter.marshal(ejbLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "ejbLink", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbLink != null) {
+ writer.writeStartElement(prefix, "ejb-link", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbLink);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: mappedName
+ String mappedNameRaw = ejbLocalRef.mappedName;
+ String mappedName = null;
+ try {
+ mappedName = Adapters.collapsedStringAdapterAdapter.marshal(mappedNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "mappedName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (mappedName != null) {
+ writer.writeStartElement(prefix, "mapped-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(mappedName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: injectionTarget
+ Set<InjectionTarget> injectionTarget = ejbLocalRef.injectionTarget;
+ if (injectionTarget != null) {
+ for (InjectionTarget injectionTargetItem : injectionTarget) {
+ if (injectionTargetItem != null) {
+ writer.writeStartElement(prefix, "injection-target", "http://java.sun.com/xml/ns/javaee");
+ writeInjectionTarget(writer, injectionTargetItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbLocalRef, "injectionTarget");
+ }
+ }
+ }
+
+ // ELEMENT: lookupName
+ String lookupNameRaw = ejbLocalRef.lookupName;
+ String lookupName = null;
+ try {
+ lookupName = Adapters.collapsedStringAdapterAdapter.marshal(lookupNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbLocalRef, "lookupName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (lookupName != null) {
+ writer.writeStartElement(prefix, "lookup-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(lookupName);
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(ejbLocalRef, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbLocalRef$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRef$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRef%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRef$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRef$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,396 @@
+/*
+ * 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.LinkedHashSet;
+import java.util.Set;
+
+import static org.apache.openejb.jee.EjbRefType$JAXB.parseEjbRefType;
+import static org.apache.openejb.jee.EjbRefType$JAXB.toStringEjbRefType;
+import static org.apache.openejb.jee.InjectionTarget$JAXB.readInjectionTarget;
+import static org.apache.openejb.jee.InjectionTarget$JAXB.writeInjectionTarget;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class EjbRef$JAXB
+ extends JAXBObject<EjbRef> {
+
+
+ public EjbRef$JAXB() {
+ super(EjbRef.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "ejb-refType".intern()), Text$JAXB.class, EjbRefType$JAXB.class, InjectionTarget$JAXB.class);
+ }
+
+ public static EjbRef readEjbRef(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeEjbRef(XoXMLStreamWriter writer, EjbRef ejbRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRef, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, EjbRef ejbRef, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRef, context);
+ }
+
+ public final static EjbRef _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ EjbRef ejbRef = new EjbRef();
+ context.beforeUnmarshal(ejbRef, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ Set<InjectionTarget> injectionTarget = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("ejb-refType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, EjbRef.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, ejbRef);
+ ejbRef.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-ref-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRefName
+ String ejbRefNameRaw = elementReader.getElementAsString();
+
+ String ejbRefName;
+ try {
+ ejbRefName = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbRefNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.ejbRefName = ejbRefName;
+ } else if (("ejb-ref-type" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRefType
+ EjbRefType ejbRefType = parseEjbRefType(elementReader, context, elementReader.getElementAsString());
+ if (ejbRefType != null) {
+ ejbRef.ejbRefType = ejbRefType;
+ }
+ } else if (("home" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: home
+ String homeRaw = elementReader.getElementAsString();
+
+ String home;
+ try {
+ home = Adapters.collapsedStringAdapterAdapter.unmarshal(homeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.home = home;
+ } else if (("remote" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: remote
+ String remoteRaw = elementReader.getElementAsString();
+
+ String remote;
+ try {
+ remote = Adapters.collapsedStringAdapterAdapter.unmarshal(remoteRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.remote = remote;
+ } else if (("ejb-link" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbLink
+ String ejbLinkRaw = elementReader.getElementAsString();
+
+ String ejbLink;
+ try {
+ ejbLink = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.ejbLink = ejbLink;
+ } else if (("mapped-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: mappedName
+ String mappedNameRaw = elementReader.getElementAsString();
+
+ String mappedName;
+ try {
+ mappedName = Adapters.collapsedStringAdapterAdapter.unmarshal(mappedNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.mappedName = mappedName;
+ } else if (("injection-target" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: injectionTarget
+ InjectionTarget injectionTargetItem = readInjectionTarget(elementReader, context);
+ if (injectionTarget == null) {
+ injectionTarget = ejbRef.injectionTarget;
+ if (injectionTarget != null) {
+ injectionTarget.clear();
+ } else {
+ injectionTarget = new LinkedHashSet<InjectionTarget>();
+ }
+ }
+ injectionTarget.add(injectionTargetItem);
+ } else if (("lookup-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: lookupName
+ String lookupNameRaw = elementReader.getElementAsString();
+
+ String lookupName;
+ try {
+ lookupName = Adapters.collapsedStringAdapterAdapter.unmarshal(lookupNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRef.lookupName = lookupName;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ref-name"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-ref-type"), new QName("http://java.sun.com/xml/ns/javaee", "home"), new QName("http://java.sun.com/xml/ns/javaee", "remote"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-link"), new QName("http://java.sun.com/xml/ns/javaee", "mapped-name"), new QName("http://java.sun.com/xml/ns/javaee", "injection-target"), new QName("http://java.sun.com/xml/ns/javaee", "lookup-name"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ ejbRef.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, EjbRef.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (injectionTarget != null) {
+ ejbRef.injectionTarget = injectionTarget;
+ }
+
+ context.afterUnmarshal(ejbRef, LifecycleCallback.NONE);
+
+ return ejbRef;
+ }
+
+ public final EjbRef read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, EjbRef ejbRef, RuntimeContext context)
+ throws Exception {
+ if (ejbRef == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (EjbRef.class != ejbRef.getClass()) {
+ context.unexpectedSubclass(writer, ejbRef, EjbRef.class);
+ return;
+ }
+
+ context.beforeMarshal(ejbRef, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = ejbRef.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = ejbRef.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(ejbRef, "descriptions", EjbRef.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(ejbRef, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: ejbRefName
+ String ejbRefNameRaw = ejbRef.ejbRefName;
+ String ejbRefName = null;
+ try {
+ ejbRefName = Adapters.collapsedStringAdapterAdapter.marshal(ejbRefNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "ejbRefName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbRefName != null) {
+ writer.writeStartElement(prefix, "ejb-ref-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbRefName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbRef, "ejbRefName");
+ }
+
+ // ELEMENT: ejbRefType
+ EjbRefType ejbRefType = ejbRef.ejbRefType;
+ if (ejbRefType != null) {
+ writer.writeStartElement(prefix, "ejb-ref-type", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringEjbRefType(ejbRef, null, context, ejbRefType));
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: home
+ String homeRaw = ejbRef.home;
+ String home = null;
+ try {
+ home = Adapters.collapsedStringAdapterAdapter.marshal(homeRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "home", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (home != null) {
+ writer.writeStartElement(prefix, "home", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(home);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: remote
+ String remoteRaw = ejbRef.remote;
+ String remote = null;
+ try {
+ remote = Adapters.collapsedStringAdapterAdapter.marshal(remoteRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "remote", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (remote != null) {
+ writer.writeStartElement(prefix, "remote", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(remote);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: ejbLink
+ String ejbLinkRaw = ejbRef.ejbLink;
+ String ejbLink = null;
+ try {
+ ejbLink = Adapters.collapsedStringAdapterAdapter.marshal(ejbLinkRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "ejbLink", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbLink != null) {
+ writer.writeStartElement(prefix, "ejb-link", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbLink);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: mappedName
+ String mappedNameRaw = ejbRef.mappedName;
+ String mappedName = null;
+ try {
+ mappedName = Adapters.collapsedStringAdapterAdapter.marshal(mappedNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "mappedName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (mappedName != null) {
+ writer.writeStartElement(prefix, "mapped-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(mappedName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: injectionTarget
+ Set<InjectionTarget> injectionTarget = ejbRef.injectionTarget;
+ if (injectionTarget != null) {
+ for (InjectionTarget injectionTargetItem : injectionTarget) {
+ if (injectionTargetItem != null) {
+ writer.writeStartElement(prefix, "injection-target", "http://java.sun.com/xml/ns/javaee");
+ writeInjectionTarget(writer, injectionTargetItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbRef, "injectionTarget");
+ }
+ }
+ }
+
+ // ELEMENT: lookupName
+ String lookupNameRaw = ejbRef.lookupName;
+ String lookupName = null;
+ try {
+ lookupName = Adapters.collapsedStringAdapterAdapter.marshal(lookupNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRef, "lookupName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (lookupName != null) {
+ writer.writeStartElement(prefix, "lookup-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(lookupName);
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(ejbRef, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRef$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRefType$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRefType%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRefType$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRefType$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,67 @@
+/*
+ * 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.JAXBEnum;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+
+import javax.xml.namespace.QName;
+
+public class EjbRefType$JAXB
+ extends JAXBEnum<EjbRefType> {
+
+
+ public EjbRefType$JAXB() {
+ super(EjbRefType.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "ejbRefType".intern()));
+ }
+
+ public EjbRefType parse(XoXMLStreamReader reader, RuntimeContext context, String value)
+ throws Exception {
+ return parseEjbRefType(reader, context, value);
+ }
+
+ public String toString(Object bean, String parameterName, RuntimeContext context, EjbRefType ejbRefType)
+ throws Exception {
+ return toStringEjbRefType(bean, parameterName, context, ejbRefType);
+ }
+
+ public static EjbRefType parseEjbRefType(XoXMLStreamReader reader, RuntimeContext context, String value)
+ throws Exception {
+ if ("Entity".equals(value)) {
+ return EjbRefType.ENTITY;
+ } else if ("Session".equals(value)) {
+ return EjbRefType.SESSION;
+ } else {
+ context.unexpectedEnumValue(reader, EjbRefType.class, value, "Entity", "Session");
+ return null;
+ }
+ }
+
+ public static String toStringEjbRefType(Object bean, String parameterName, RuntimeContext context, EjbRefType ejbRefType)
+ throws Exception {
+ if (EjbRefType.ENTITY == ejbRefType) {
+ return "Entity";
+ } else if (EjbRefType.SESSION == ejbRefType) {
+ return "Session";
+ } else {
+ context.unexpectedEnumConst(bean, parameterName, ejbRefType, EjbRefType.ENTITY, EjbRefType.SESSION);
+ return null;
+ }
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRefType$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelation$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelation%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelation$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelation$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,242 @@
+/*
+ * 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.EjbRelationshipRole$JAXB.readEjbRelationshipRole;
+import static org.apache.openejb.jee.EjbRelationshipRole$JAXB.writeEjbRelationshipRole;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class EjbRelation$JAXB
+ extends JAXBObject<EjbRelation> {
+
+
+ public EjbRelation$JAXB() {
+ super(EjbRelation.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "ejb-relationType".intern()), Text$JAXB.class, EjbRelationshipRole$JAXB.class);
+ }
+
+ public static EjbRelation readEjbRelation(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeEjbRelation(XoXMLStreamWriter writer, EjbRelation ejbRelation, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRelation, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, EjbRelation ejbRelation, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRelation, context);
+ }
+
+ public final static EjbRelation _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ EjbRelation ejbRelation = new EjbRelation();
+ context.beforeUnmarshal(ejbRelation, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ List<EjbRelationshipRole> ejbRelationshipRole = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("ejb-relationType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, EjbRelation.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, ejbRelation);
+ ejbRelation.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-relation-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRelationName
+ String ejbRelationNameRaw = elementReader.getElementAsString();
+
+ String ejbRelationName;
+ try {
+ ejbRelationName = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbRelationNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRelation.ejbRelationName = ejbRelationName;
+ } else if (("ejb-relationship-role" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRelationshipRole
+ EjbRelationshipRole ejbRelationshipRoleItem = readEjbRelationshipRole(elementReader, context);
+ if (ejbRelationshipRole == null) {
+ ejbRelationshipRole = ejbRelation.ejbRelationshipRole;
+ if (ejbRelationshipRole != null) {
+ ejbRelationshipRole.clear();
+ } else {
+ ejbRelationshipRole = new ArrayList<EjbRelationshipRole>();
+ }
+ }
+ ejbRelationshipRole.add(ejbRelationshipRoleItem);
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-relation-name"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-relationship-role"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ ejbRelation.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, EjbRelation.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (ejbRelationshipRole != null) {
+ ejbRelation.ejbRelationshipRole = ejbRelationshipRole;
+ }
+
+ context.afterUnmarshal(ejbRelation, LifecycleCallback.NONE);
+
+ return ejbRelation;
+ }
+
+ public final EjbRelation read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, EjbRelation ejbRelation, RuntimeContext context)
+ throws Exception {
+ if (ejbRelation == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (EjbRelation.class != ejbRelation.getClass()) {
+ context.unexpectedSubclass(writer, ejbRelation, EjbRelation.class);
+ return;
+ }
+
+ context.beforeMarshal(ejbRelation, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = ejbRelation.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRelation, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = ejbRelation.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(ejbRelation, "descriptions", EjbRelation.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(ejbRelation, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: ejbRelationName
+ String ejbRelationNameRaw = ejbRelation.ejbRelationName;
+ String ejbRelationName = null;
+ try {
+ ejbRelationName = Adapters.collapsedStringAdapterAdapter.marshal(ejbRelationNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRelation, "ejbRelationName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbRelationName != null) {
+ writer.writeStartElement(prefix, "ejb-relation-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbRelationName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: ejbRelationshipRole
+ List<EjbRelationshipRole> ejbRelationshipRole = ejbRelation.ejbRelationshipRole;
+ if (ejbRelationshipRole != null) {
+ for (EjbRelationshipRole ejbRelationshipRoleItem : ejbRelationshipRole) {
+ if (ejbRelationshipRoleItem != null) {
+ writer.writeStartElement(prefix, "ejb-relationship-role", "http://java.sun.com/xml/ns/javaee");
+ writeEjbRelationshipRole(writer, ejbRelationshipRoleItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbRelation, "ejbRelationshipRole");
+ }
+ }
+ }
+
+ context.afterMarshal(ejbRelation, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelation$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelationshipRole$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelationshipRole%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelationshipRole$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelationshipRole$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,271 @@
+/*
+ * 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.CmrField$JAXB.readCmrField;
+import static org.apache.openejb.jee.CmrField$JAXB.writeCmrField;
+import static org.apache.openejb.jee.Empty$JAXB.readEmpty;
+import static org.apache.openejb.jee.Empty$JAXB.writeEmpty;
+import static org.apache.openejb.jee.Multiplicity$JAXB.parseMultiplicity;
+import static org.apache.openejb.jee.Multiplicity$JAXB.toStringMultiplicity;
+import static org.apache.openejb.jee.RelationshipRoleSource$JAXB.readRelationshipRoleSource;
+import static org.apache.openejb.jee.RelationshipRoleSource$JAXB.writeRelationshipRoleSource;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class EjbRelationshipRole$JAXB
+ extends JAXBObject<EjbRelationshipRole> {
+
+
+ public EjbRelationshipRole$JAXB() {
+ super(EjbRelationshipRole.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "ejb-relationship-roleType".intern()), Text$JAXB.class, Multiplicity$JAXB.class, Empty$JAXB.class, RelationshipRoleSource$JAXB.class, CmrField$JAXB.class);
+ }
+
+ public static EjbRelationshipRole readEjbRelationshipRole(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeEjbRelationshipRole(XoXMLStreamWriter writer, EjbRelationshipRole ejbRelationshipRole, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRelationshipRole, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, EjbRelationshipRole ejbRelationshipRole, RuntimeContext context)
+ throws Exception {
+ _write(writer, ejbRelationshipRole, context);
+ }
+
+ public final static EjbRelationshipRole _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ EjbRelationshipRole ejbRelationshipRole = new EjbRelationshipRole();
+ context.beforeUnmarshal(ejbRelationshipRole, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("ejb-relationship-roleType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, EjbRelationshipRole.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, ejbRelationshipRole);
+ ejbRelationshipRole.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-relationship-role-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: ejbRelationshipRoleName
+ String ejbRelationshipRoleNameRaw = elementReader.getElementAsString();
+
+ String ejbRelationshipRoleName;
+ try {
+ ejbRelationshipRoleName = Adapters.collapsedStringAdapterAdapter.unmarshal(ejbRelationshipRoleNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ ejbRelationshipRole.ejbRelationshipRoleName = ejbRelationshipRoleName;
+ } else if (("multiplicity" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: multiplicity
+ Multiplicity multiplicity = parseMultiplicity(elementReader, context, elementReader.getElementAsString());
+ if (multiplicity != null) {
+ ejbRelationshipRole.multiplicity = multiplicity;
+ }
+ } else if (("cascade-delete" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: cascadeDelete
+ Empty cascadeDelete = readEmpty(elementReader, context);
+ ejbRelationshipRole.cascadeDelete = cascadeDelete;
+ } else if (("relationship-role-source" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: relationshipRoleSource
+ RelationshipRoleSource relationshipRoleSource = readRelationshipRoleSource(elementReader, context);
+ ejbRelationshipRole.relationshipRoleSource = relationshipRoleSource;
+ } else if (("cmr-field" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: cmrField
+ CmrField cmrField = readCmrField(elementReader, context);
+ ejbRelationshipRole.cmrField = cmrField;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "description"), new QName("http://java.sun.com/xml/ns/javaee", "ejb-relationship-role-name"), new QName("http://java.sun.com/xml/ns/javaee", "multiplicity"), new QName("http://java.sun.com/xml/ns/javaee", "cascade-delete"), new QName("http://java.sun.com/xml/ns/javaee", "relationship-role-source"), new QName("http://java.sun.com/xml/ns/javaee", "cmr-field"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ ejbRelationshipRole.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, EjbRelationshipRole.class, "setDescriptions", Text[].class, e);
+ }
+ }
+
+ context.afterUnmarshal(ejbRelationshipRole, LifecycleCallback.NONE);
+
+ return ejbRelationshipRole;
+ }
+
+ public final EjbRelationshipRole read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, EjbRelationshipRole ejbRelationshipRole, RuntimeContext context)
+ throws Exception {
+ if (ejbRelationshipRole == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (EjbRelationshipRole.class != ejbRelationshipRole.getClass()) {
+ context.unexpectedSubclass(writer, ejbRelationshipRole, EjbRelationshipRole.class);
+ return;
+ }
+
+ context.beforeMarshal(ejbRelationshipRole, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = ejbRelationshipRole.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRelationshipRole, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = ejbRelationshipRole.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(ejbRelationshipRole, "descriptions", EjbRelationshipRole.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(ejbRelationshipRole, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: ejbRelationshipRoleName
+ String ejbRelationshipRoleNameRaw = ejbRelationshipRole.ejbRelationshipRoleName;
+ String ejbRelationshipRoleName = null;
+ try {
+ ejbRelationshipRoleName = Adapters.collapsedStringAdapterAdapter.marshal(ejbRelationshipRoleNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(ejbRelationshipRole, "ejbRelationshipRoleName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (ejbRelationshipRoleName != null) {
+ writer.writeStartElement(prefix, "ejb-relationship-role-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(ejbRelationshipRoleName);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: multiplicity
+ Multiplicity multiplicity = ejbRelationshipRole.multiplicity;
+ if (multiplicity != null) {
+ writer.writeStartElement(prefix, "multiplicity", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(toStringMultiplicity(ejbRelationshipRole, null, context, multiplicity));
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbRelationshipRole, "multiplicity");
+ }
+
+ // ELEMENT: cascadeDelete
+ Empty cascadeDelete = ejbRelationshipRole.cascadeDelete;
+ if (cascadeDelete != null) {
+ writer.writeStartElement(prefix, "cascade-delete", "http://java.sun.com/xml/ns/javaee");
+ writeEmpty(writer, cascadeDelete, context);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: relationshipRoleSource
+ RelationshipRoleSource relationshipRoleSource = ejbRelationshipRole.relationshipRoleSource;
+ if (relationshipRoleSource != null) {
+ writer.writeStartElement(prefix, "relationship-role-source", "http://java.sun.com/xml/ns/javaee");
+ writeRelationshipRoleSource(writer, relationshipRoleSource, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(ejbRelationshipRole, "relationshipRoleSource");
+ }
+
+ // ELEMENT: cmrField
+ CmrField cmrField = ejbRelationshipRole.cmrField;
+ if (cmrField != null) {
+ writer.writeStartElement(prefix, "cmr-field", "http://java.sun.com/xml/ns/javaee");
+ writeCmrField(writer, cmrField, context);
+ writer.writeEndElement();
+ }
+
+ context.afterMarshal(ejbRelationshipRole, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/EjbRelationshipRole$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Empty$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Empty%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Empty$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Empty$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,141 @@
+/*
+ * 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 Empty$JAXB
+ extends JAXBObject<Empty> {
+
+
+ public Empty$JAXB() {
+ super(Empty.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "emptyType".intern()));
+ }
+
+ public static Empty readEmpty(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeEmpty(XoXMLStreamWriter writer, Empty empty, RuntimeContext context)
+ throws Exception {
+ _write(writer, empty, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Empty empty, RuntimeContext context)
+ throws Exception {
+ _write(writer, empty, context);
+ }
+
+ public final static Empty _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Empty empty = new Empty();
+ context.beforeUnmarshal(empty, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("emptyType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Empty.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, empty);
+ empty.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()) {
+ context.unexpectedElement(elementReader);
+ }
+
+ context.afterUnmarshal(empty, LifecycleCallback.NONE);
+
+ return empty;
+ }
+
+ public final Empty read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Empty empty, RuntimeContext context)
+ throws Exception {
+ if (empty == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ if (Empty.class != empty.getClass()) {
+ context.unexpectedSubclass(writer, empty, Empty.class);
+ return;
+ }
+
+ context.beforeMarshal(empty, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = empty.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(empty, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ context.afterMarshal(empty, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Empty$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native