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 [17/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/FacesValidator$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidator%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidator$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidator$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,401 @@
+/*
+ * 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.FacesAttribute$JAXB.readFacesAttribute;
+import static org.apache.openejb.jee.FacesAttribute$JAXB.writeFacesAttribute;
+import static org.apache.openejb.jee.FacesProperty$JAXB.readFacesProperty;
+import static org.apache.openejb.jee.FacesProperty$JAXB.writeFacesProperty;
+import static org.apache.openejb.jee.FacesValidatorExtension$JAXB.readFacesValidatorExtension;
+import static org.apache.openejb.jee.FacesValidatorExtension$JAXB.writeFacesValidatorExtension;
+import static org.apache.openejb.jee.Icon$JAXB.readIcon;
+import static org.apache.openejb.jee.Icon$JAXB.writeIcon;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class FacesValidator$JAXB
+ extends JAXBObject<FacesValidator> {
+
+
+ public FacesValidator$JAXB() {
+ super(FacesValidator.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "faces-config-validatorType".intern()), Text$JAXB.class, Icon$JAXB.class, FacesAttribute$JAXB.class, FacesProperty$JAXB.class, FacesValidatorExtension$JAXB.class);
+ }
+
+ public static FacesValidator readFacesValidator(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFacesValidator(XoXMLStreamWriter writer, FacesValidator facesValidator, RuntimeContext context)
+ throws Exception {
+ _write(writer, facesValidator, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, FacesValidator facesValidator, RuntimeContext context)
+ throws Exception {
+ _write(writer, facesValidator, context);
+ }
+
+ public final static FacesValidator _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ FacesValidator facesValidator = new FacesValidator();
+ context.beforeUnmarshal(facesValidator, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ ArrayList<Text> displayNames = null;
+ LocalCollection<Icon> icon = null;
+ List<FacesAttribute> attribute1 = null;
+ List<FacesProperty> property = null;
+ List<FacesValidatorExtension> validatorExtension = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("faces-config-validatorType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, FacesValidator.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, facesValidator);
+ facesValidator.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 (("display-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: displayNames
+ Text displayNamesItem = readText(elementReader, context);
+ if (displayNames == null) {
+ displayNames = new ArrayList<Text>();
+ }
+ displayNames.add(displayNamesItem);
+ } else if (("icon" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: icon
+ Icon iconItem = readIcon(elementReader, context);
+ if (icon == null) {
+ icon = facesValidator.icon;
+ if (icon != null) {
+ icon.clear();
+ } else {
+ icon = new LocalCollection<Icon>();
+ }
+ }
+ icon.add(iconItem);
+ } else if (("validator-id" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: validatorId
+ String validatorIdRaw = elementReader.getElementAsString();
+
+ String validatorId;
+ try {
+ validatorId = Adapters.collapsedStringAdapterAdapter.unmarshal(validatorIdRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ facesValidator.validatorId = validatorId;
+ } else if (("validator-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: validatorClass
+ String validatorClassRaw = elementReader.getElementAsString();
+
+ String validatorClass;
+ try {
+ validatorClass = Adapters.collapsedStringAdapterAdapter.unmarshal(validatorClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ facesValidator.validatorClass = validatorClass;
+ } else if (("attribute" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: attribute
+ FacesAttribute attributeItem = readFacesAttribute(elementReader, context);
+ if (attribute1 == null) {
+ attribute1 = facesValidator.attribute;
+ if (attribute1 != null) {
+ attribute1.clear();
+ } else {
+ attribute1 = new ArrayList<FacesAttribute>();
+ }
+ }
+ attribute1.add(attributeItem);
+ } else if (("property" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: property
+ FacesProperty propertyItem = readFacesProperty(elementReader, context);
+ if (property == null) {
+ property = facesValidator.property;
+ if (property != null) {
+ property.clear();
+ } else {
+ property = new ArrayList<FacesProperty>();
+ }
+ }
+ property.add(propertyItem);
+ } else if (("validator-extension" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: validatorExtension
+ FacesValidatorExtension validatorExtensionItem = readFacesValidatorExtension(elementReader, context);
+ if (validatorExtension == null) {
+ validatorExtension = facesValidator.validatorExtension;
+ if (validatorExtension != null) {
+ validatorExtension.clear();
+ } else {
+ validatorExtension = new ArrayList<FacesValidatorExtension>();
+ }
+ }
+ validatorExtension.add(validatorExtensionItem);
+ } 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", "validator-id"), new QName("http://java.sun.com/xml/ns/javaee", "validator-class"), new QName("http://java.sun.com/xml/ns/javaee", "attribute"), new QName("http://java.sun.com/xml/ns/javaee", "property"), new QName("http://java.sun.com/xml/ns/javaee", "validator-extension"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ facesValidator.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, FacesValidator.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (displayNames != null) {
+ try {
+ facesValidator.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, FacesValidator.class, "setDisplayNames", Text[].class, e);
+ }
+ }
+ if (icon != null) {
+ facesValidator.icon = icon;
+ }
+ if (attribute1 != null) {
+ facesValidator.attribute = attribute1;
+ }
+ if (property != null) {
+ facesValidator.property = property;
+ }
+ if (validatorExtension != null) {
+ facesValidator.validatorExtension = validatorExtension;
+ }
+
+ context.afterUnmarshal(facesValidator, LifecycleCallback.NONE);
+
+ return facesValidator;
+ }
+
+ public final FacesValidator read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, FacesValidator facesValidator, RuntimeContext context)
+ throws Exception {
+ if (facesValidator == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (FacesValidator.class != facesValidator.getClass()) {
+ context.unexpectedSubclass(writer, facesValidator, FacesValidator.class);
+ return;
+ }
+
+ context.beforeMarshal(facesValidator, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = facesValidator.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(facesValidator, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = facesValidator.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(facesValidator, "descriptions", FacesValidator.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(facesValidator, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: displayNames
+ Text[] displayNames = null;
+ try {
+ displayNames = facesValidator.getDisplayNames();
+ } catch (Exception e) {
+ context.getterError(facesValidator, "displayNames", FacesValidator.class, "getDisplayNames", e);
+ }
+ if (displayNames != null) {
+ for (Text displayNamesItem : displayNames) {
+ if (displayNamesItem != null) {
+ writer.writeStartElement(prefix, "display-name", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, displayNamesItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(facesValidator, "displayNames");
+ }
+ }
+ }
+
+ // ELEMENT: icon
+ LocalCollection<Icon> icon = facesValidator.icon;
+ if (icon != null) {
+ for (Icon iconItem : icon) {
+ if (iconItem != null) {
+ writer.writeStartElement(prefix, "icon", "http://java.sun.com/xml/ns/javaee");
+ writeIcon(writer, iconItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(facesValidator, "icon");
+ }
+ }
+ }
+
+ // ELEMENT: validatorId
+ String validatorIdRaw = facesValidator.validatorId;
+ String validatorId = null;
+ try {
+ validatorId = Adapters.collapsedStringAdapterAdapter.marshal(validatorIdRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(facesValidator, "validatorId", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (validatorId != null) {
+ writer.writeStartElement(prefix, "validator-id", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(validatorId);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(facesValidator, "validatorId");
+ }
+
+ // ELEMENT: validatorClass
+ String validatorClassRaw = facesValidator.validatorClass;
+ String validatorClass = null;
+ try {
+ validatorClass = Adapters.collapsedStringAdapterAdapter.marshal(validatorClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(facesValidator, "validatorClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (validatorClass != null) {
+ writer.writeStartElement(prefix, "validator-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(validatorClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(facesValidator, "validatorClass");
+ }
+
+ // ELEMENT: attribute
+ List<FacesAttribute> attribute = facesValidator.attribute;
+ if (attribute != null) {
+ for (FacesAttribute attributeItem : attribute) {
+ writer.writeStartElement(prefix, "attribute", "http://java.sun.com/xml/ns/javaee");
+ if (attributeItem != null) {
+ writeFacesAttribute(writer, attributeItem, context);
+ } else {
+ writer.writeXsiNil();
+ }
+ writer.writeEndElement();
+ }
+ }
+
+ // ELEMENT: property
+ List<FacesProperty> property = facesValidator.property;
+ if (property != null) {
+ for (FacesProperty propertyItem : property) {
+ writer.writeStartElement(prefix, "property", "http://java.sun.com/xml/ns/javaee");
+ if (propertyItem != null) {
+ writeFacesProperty(writer, propertyItem, context);
+ } else {
+ writer.writeXsiNil();
+ }
+ writer.writeEndElement();
+ }
+ }
+
+ // ELEMENT: validatorExtension
+ List<FacesValidatorExtension> validatorExtension = facesValidator.validatorExtension;
+ if (validatorExtension != null) {
+ for (FacesValidatorExtension validatorExtensionItem : validatorExtension) {
+ if (validatorExtensionItem != null) {
+ writer.writeStartElement(prefix, "validator-extension", "http://java.sun.com/xml/ns/javaee");
+ writeFacesValidatorExtension(writer, validatorExtensionItem, context);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ context.afterMarshal(facesValidator, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidator$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidatorExtension$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidatorExtension%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidatorExtension$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidatorExtension$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class FacesValidatorExtension$JAXB
+ extends JAXBObject<FacesValidatorExtension> {
+
+
+ public FacesValidatorExtension$JAXB() {
+ super(FacesValidatorExtension.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "faces-config-validator-extensionType".intern()));
+ }
+
+ public static FacesValidatorExtension readFacesValidatorExtension(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFacesValidatorExtension(XoXMLStreamWriter writer, FacesValidatorExtension facesValidatorExtension, RuntimeContext context)
+ throws Exception {
+ _write(writer, facesValidatorExtension, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, FacesValidatorExtension facesValidatorExtension, RuntimeContext context)
+ throws Exception {
+ _write(writer, facesValidatorExtension, context);
+ }
+
+ public final static FacesValidatorExtension _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ FacesValidatorExtension facesValidatorExtension = new FacesValidatorExtension();
+ context.beforeUnmarshal(facesValidatorExtension, LifecycleCallback.NONE);
+
+ List<Object> any = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("faces-config-validator-extensionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, FacesValidatorExtension.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, facesValidatorExtension);
+ facesValidatorExtension.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()) {
+ // ELEMENT_REF: any
+ if (any == null) {
+ any = facesValidatorExtension.any;
+ if (any != null) {
+ any.clear();
+ } else {
+ any = new ArrayList<Object>();
+ }
+ }
+ any.add(context.readXmlAny(elementReader, Object.class, true));
+ }
+ if (any != null) {
+ facesValidatorExtension.any = any;
+ }
+
+ context.afterUnmarshal(facesValidatorExtension, LifecycleCallback.NONE);
+
+ return facesValidatorExtension;
+ }
+
+ public final FacesValidatorExtension read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, FacesValidatorExtension facesValidatorExtension, RuntimeContext context)
+ throws Exception {
+ if (facesValidatorExtension == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ if (FacesValidatorExtension.class != facesValidatorExtension.getClass()) {
+ context.unexpectedSubclass(writer, facesValidatorExtension, FacesValidatorExtension.class);
+ return;
+ }
+
+ context.beforeMarshal(facesValidatorExtension, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = facesValidatorExtension.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(facesValidatorExtension, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT_REF: any
+ List<Object> any = facesValidatorExtension.any;
+ if (any != null) {
+ for (Object anyItem : any) {
+ context.writeXmlAny(writer, facesValidatorExtension, "any", anyItem);
+ }
+ }
+
+ context.afterMarshal(facesValidatorExtension, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesValidatorExtension$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Filter$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Filter%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Filter$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Filter$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,347 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.Icon$JAXB.readIcon;
+import static org.apache.openejb.jee.Icon$JAXB.writeIcon;
+import static org.apache.openejb.jee.ParamValue$JAXB.readParamValue;
+import static org.apache.openejb.jee.ParamValue$JAXB.writeParamValue;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class Filter$JAXB
+ extends JAXBObject<Filter> {
+
+
+ public Filter$JAXB() {
+ super(Filter.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "filterType".intern()), Text$JAXB.class, Icon$JAXB.class, ParamValue$JAXB.class);
+ }
+
+ public static Filter readFilter(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFilter(XoXMLStreamWriter writer, Filter filter, RuntimeContext context)
+ throws Exception {
+ _write(writer, filter, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Filter filter, RuntimeContext context)
+ throws Exception {
+ _write(writer, filter, context);
+ }
+
+ public final static Filter _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Filter filter = new Filter();
+ context.beforeUnmarshal(filter, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ ArrayList<Text> displayNames = null;
+ LocalCollection<Icon> icon = null;
+ List<ParamValue> initParam = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("filterType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Filter.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, filter);
+ filter.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 (("display-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: displayNames
+ Text displayNamesItem = readText(elementReader, context);
+ if (displayNames == null) {
+ displayNames = new ArrayList<Text>();
+ }
+ displayNames.add(displayNamesItem);
+ } else if (("icon" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: icon
+ Icon iconItem = readIcon(elementReader, context);
+ if (icon == null) {
+ icon = filter.icon;
+ if (icon != null) {
+ icon.clear();
+ } else {
+ icon = new LocalCollection<Icon>();
+ }
+ }
+ icon.add(iconItem);
+ } else if (("filter-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: filterName
+ String filterNameRaw = elementReader.getElementAsString();
+
+ String filterName;
+ try {
+ filterName = Adapters.collapsedStringAdapterAdapter.unmarshal(filterNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ filter.filterName = filterName;
+ } else if (("filter-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: filterClass
+ String filterClassRaw = elementReader.getElementAsString();
+
+ String filterClass;
+ try {
+ filterClass = Adapters.collapsedStringAdapterAdapter.unmarshal(filterClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ filter.filterClass = filterClass;
+ } else if (("async-supported" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: asyncSupported
+ Boolean asyncSupported = ("1".equals(elementReader.getElementAsString()) || "true".equals(elementReader.getElementAsString()));
+ filter.asyncSupported = asyncSupported;
+ } else if (("init-param" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: initParam
+ ParamValue initParamItem = readParamValue(elementReader, context);
+ if (initParam == null) {
+ initParam = filter.initParam;
+ if (initParam != null) {
+ initParam.clear();
+ } else {
+ initParam = new ArrayList<ParamValue>();
+ }
+ }
+ initParam.add(initParamItem);
+ } 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", "filter-name"), new QName("http://java.sun.com/xml/ns/javaee", "filter-class"), new QName("http://java.sun.com/xml/ns/javaee", "async-supported"), new QName("http://java.sun.com/xml/ns/javaee", "init-param"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ filter.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Filter.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (displayNames != null) {
+ try {
+ filter.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Filter.class, "setDisplayNames", Text[].class, e);
+ }
+ }
+ if (icon != null) {
+ filter.icon = icon;
+ }
+ if (initParam != null) {
+ filter.initParam = initParam;
+ }
+
+ context.afterUnmarshal(filter, LifecycleCallback.NONE);
+
+ return filter;
+ }
+
+ public final Filter read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Filter filter, RuntimeContext context)
+ throws Exception {
+ if (filter == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (Filter.class != filter.getClass()) {
+ context.unexpectedSubclass(writer, filter, Filter.class);
+ return;
+ }
+
+ context.beforeMarshal(filter, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = filter.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(filter, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = filter.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(filter, "descriptions", Filter.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(filter, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: displayNames
+ Text[] displayNames = null;
+ try {
+ displayNames = filter.getDisplayNames();
+ } catch (Exception e) {
+ context.getterError(filter, "displayNames", Filter.class, "getDisplayNames", e);
+ }
+ if (displayNames != null) {
+ for (Text displayNamesItem : displayNames) {
+ if (displayNamesItem != null) {
+ writer.writeStartElement(prefix, "display-name", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, displayNamesItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(filter, "displayNames");
+ }
+ }
+ }
+
+ // ELEMENT: icon
+ LocalCollection<Icon> icon = filter.icon;
+ if (icon != null) {
+ for (Icon iconItem : icon) {
+ if (iconItem != null) {
+ writer.writeStartElement(prefix, "icon", "http://java.sun.com/xml/ns/javaee");
+ writeIcon(writer, iconItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(filter, "icon");
+ }
+ }
+ }
+
+ // ELEMENT: filterName
+ String filterNameRaw = filter.filterName;
+ String filterName = null;
+ try {
+ filterName = Adapters.collapsedStringAdapterAdapter.marshal(filterNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(filter, "filterName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (filterName != null) {
+ writer.writeStartElement(prefix, "filter-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(filterName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(filter, "filterName");
+ }
+
+ // ELEMENT: filterClass
+ String filterClassRaw = filter.filterClass;
+ String filterClass = null;
+ try {
+ filterClass = Adapters.collapsedStringAdapterAdapter.marshal(filterClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(filter, "filterClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (filterClass != null) {
+ writer.writeStartElement(prefix, "filter-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(filterClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(filter, "filterClass");
+ }
+
+ // ELEMENT: asyncSupported
+ Boolean asyncSupported = filter.asyncSupported;
+ writer.writeStartElement(prefix, "async-supported", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(Boolean.toString(asyncSupported));
+ writer.writeEndElement();
+
+ // ELEMENT: initParam
+ List<ParamValue> initParam = filter.initParam;
+ if (initParam != null) {
+ for (ParamValue initParamItem : initParam) {
+ if (initParamItem != null) {
+ writer.writeStartElement(prefix, "init-param", "http://java.sun.com/xml/ns/javaee");
+ writeParamValue(writer, initParamItem, context);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ context.afterMarshal(filter, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Filter$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FilterMapping$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FilterMapping%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FilterMapping$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FilterMapping$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,297 @@
+/*
+ * 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.Dispatcher$JAXB.parseDispatcher;
+import static org.apache.openejb.jee.Dispatcher$JAXB.toStringDispatcher;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class FilterMapping$JAXB
+ extends JAXBObject<FilterMapping> {
+
+
+ public FilterMapping$JAXB() {
+ super(FilterMapping.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "filter-mappingType".intern()), Dispatcher$JAXB.class);
+ }
+
+ public static FilterMapping readFilterMapping(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFilterMapping(XoXMLStreamWriter writer, FilterMapping filterMapping, RuntimeContext context)
+ throws Exception {
+ _write(writer, filterMapping, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, FilterMapping filterMapping, RuntimeContext context)
+ throws Exception {
+ _write(writer, filterMapping, context);
+ }
+
+ public final static FilterMapping _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ FilterMapping filterMapping = new FilterMapping();
+ context.beforeUnmarshal(filterMapping, LifecycleCallback.NONE);
+
+ List<String> urlPattern = null;
+ List<String> servletName = null;
+ List<Dispatcher> dispatcher = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("filter-mappingType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, FilterMapping.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, filterMapping);
+ filterMapping.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 (("filter-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: filterName
+ String filterNameRaw = elementReader.getElementAsString();
+
+ String filterName;
+ try {
+ filterName = Adapters.collapsedStringAdapterAdapter.unmarshal(filterNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ filterMapping.filterName = filterName;
+ } else if (("url-pattern" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: urlPattern
+ String urlPatternItemRaw = elementReader.getElementAsString();
+
+ String urlPatternItem;
+ try {
+ urlPatternItem = Adapters.trimStringAdapterAdapter.unmarshal(urlPatternItemRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, TrimStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ if (urlPattern == null) {
+ urlPattern = filterMapping.urlPattern;
+ if (urlPattern != null) {
+ urlPattern.clear();
+ } else {
+ urlPattern = new ArrayList<String>();
+ }
+ }
+ urlPattern.add(urlPatternItem);
+ } else if (("servlet-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: servletName
+ String servletNameItemRaw = elementReader.getElementAsString();
+
+ String servletNameItem;
+ try {
+ servletNameItem = Adapters.collapsedStringAdapterAdapter.unmarshal(servletNameItemRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ if (servletName == null) {
+ servletName = filterMapping.servletName;
+ if (servletName != null) {
+ servletName.clear();
+ } else {
+ servletName = new ArrayList<String>();
+ }
+ }
+ servletName.add(servletNameItem);
+ } else if (("dispatcher" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: dispatcher
+ Dispatcher dispatcherItem = null;
+ if (!elementReader.isXsiNil()) {
+ dispatcherItem = parseDispatcher(elementReader, context, elementReader.getElementAsString());
+ }
+ if (dispatcher == null) {
+ dispatcher = filterMapping.dispatcher;
+ if (dispatcher != null) {
+ dispatcher.clear();
+ } else {
+ dispatcher = new ArrayList<Dispatcher>();
+ }
+ }
+ dispatcher.add(dispatcherItem);
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "filter-name"), new QName("http://java.sun.com/xml/ns/javaee", "url-pattern"), new QName("http://java.sun.com/xml/ns/javaee", "servlet-name"), new QName("http://java.sun.com/xml/ns/javaee", "dispatcher"));
+ }
+ }
+ if (urlPattern != null) {
+ filterMapping.urlPattern = urlPattern;
+ }
+ if (servletName != null) {
+ filterMapping.servletName = servletName;
+ }
+ if (dispatcher != null) {
+ filterMapping.dispatcher = dispatcher;
+ }
+
+ context.afterUnmarshal(filterMapping, LifecycleCallback.NONE);
+
+ return filterMapping;
+ }
+
+ public final FilterMapping read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, FilterMapping filterMapping, RuntimeContext context)
+ throws Exception {
+ if (filterMapping == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (FilterMapping.class != filterMapping.getClass()) {
+ context.unexpectedSubclass(writer, filterMapping, FilterMapping.class);
+ return;
+ }
+
+ context.beforeMarshal(filterMapping, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = filterMapping.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(filterMapping, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: filterName
+ String filterNameRaw = filterMapping.filterName;
+ String filterName = null;
+ try {
+ filterName = Adapters.collapsedStringAdapterAdapter.marshal(filterNameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(filterMapping, "filterName", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (filterName != null) {
+ writer.writeStartElement(prefix, "filter-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(filterName);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(filterMapping, "filterName");
+ }
+
+ // ELEMENT: urlPattern
+ List<String> urlPatternRaw = filterMapping.urlPattern;
+ if (urlPatternRaw != null) {
+ for (String urlPatternItem : urlPatternRaw) {
+ String urlPattern = null;
+ try {
+ urlPattern = Adapters.trimStringAdapterAdapter.marshal(urlPatternItem);
+ } catch (Exception e) {
+ context.xmlAdapterError(filterMapping, "urlPattern", TrimStringAdapter.class, List.class, List.class, e);
+ }
+ if (urlPattern != null) {
+ writer.writeStartElement(prefix, "url-pattern", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(urlPattern);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ // ELEMENT: servletName
+ List<String> servletNameRaw = filterMapping.servletName;
+ if (servletNameRaw != null) {
+ for (String servletNameItem : servletNameRaw) {
+ String servletName = null;
+ try {
+ servletName = Adapters.collapsedStringAdapterAdapter.marshal(servletNameItem);
+ } catch (Exception e) {
+ context.xmlAdapterError(filterMapping, "servletName", CollapsedStringAdapter.class, List.class, List.class, e);
+ }
+ if (servletName != null) {
+ writer.writeStartElement(prefix, "servlet-name", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(servletName);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ // ELEMENT: dispatcher
+ List<Dispatcher> dispatcher = filterMapping.dispatcher;
+ if (dispatcher != null) {
+ for (Dispatcher dispatcherItem : dispatcher) {
+ writer.writeStartElement(prefix, "dispatcher", "http://java.sun.com/xml/ns/javaee");
+ if (dispatcherItem != null) {
+ writer.writeCharacters(toStringDispatcher(filterMapping, null, context, dispatcherItem));
+ } else {
+ writer.writeXsiNil();
+ }
+ writer.writeEndElement();
+ }
+ }
+
+ context.afterMarshal(filterMapping, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FilterMapping$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FormLoginConfig$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FormLoginConfig%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FormLoginConfig$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FormLoginConfig$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 FormLoginConfig$JAXB
+ extends JAXBObject<FormLoginConfig> {
+
+
+ public FormLoginConfig$JAXB() {
+ super(FormLoginConfig.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "form-login-configType".intern()));
+ }
+
+ public static FormLoginConfig readFormLoginConfig(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFormLoginConfig(XoXMLStreamWriter writer, FormLoginConfig formLoginConfig, RuntimeContext context)
+ throws Exception {
+ _write(writer, formLoginConfig, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, FormLoginConfig formLoginConfig, RuntimeContext context)
+ throws Exception {
+ _write(writer, formLoginConfig, context);
+ }
+
+ public final static FormLoginConfig _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ FormLoginConfig formLoginConfig = new FormLoginConfig();
+ context.beforeUnmarshal(formLoginConfig, LifecycleCallback.NONE);
+
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("form-login-configType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, FormLoginConfig.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, formLoginConfig);
+ formLoginConfig.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 (("form-login-page" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: formLoginPage
+ String formLoginPageRaw = elementReader.getElementAsString();
+
+ String formLoginPage;
+ try {
+ formLoginPage = Adapters.collapsedStringAdapterAdapter.unmarshal(formLoginPageRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ formLoginConfig.formLoginPage = formLoginPage;
+ } else if (("form-error-page" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: formErrorPage
+ String formErrorPageRaw = elementReader.getElementAsString();
+
+ String formErrorPage;
+ try {
+ formErrorPage = Adapters.collapsedStringAdapterAdapter.unmarshal(formErrorPageRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ formLoginConfig.formErrorPage = formErrorPage;
+ } else {
+ context.unexpectedElement(elementReader, new QName("http://java.sun.com/xml/ns/javaee", "form-login-page"), new QName("http://java.sun.com/xml/ns/javaee", "form-error-page"));
+ }
+ }
+
+ context.afterUnmarshal(formLoginConfig, LifecycleCallback.NONE);
+
+ return formLoginConfig;
+ }
+
+ public final FormLoginConfig read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, FormLoginConfig formLoginConfig, RuntimeContext context)
+ throws Exception {
+ if (formLoginConfig == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (FormLoginConfig.class != formLoginConfig.getClass()) {
+ context.unexpectedSubclass(writer, formLoginConfig, FormLoginConfig.class);
+ return;
+ }
+
+ context.beforeMarshal(formLoginConfig, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = formLoginConfig.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(formLoginConfig, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: formLoginPage
+ String formLoginPageRaw = formLoginConfig.formLoginPage;
+ String formLoginPage = null;
+ try {
+ formLoginPage = Adapters.collapsedStringAdapterAdapter.marshal(formLoginPageRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(formLoginConfig, "formLoginPage", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (formLoginPage != null) {
+ writer.writeStartElement(prefix, "form-login-page", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(formLoginPage);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(formLoginConfig, "formLoginPage");
+ }
+
+ // ELEMENT: formErrorPage
+ String formErrorPageRaw = formLoginConfig.formErrorPage;
+ String formErrorPage = null;
+ try {
+ formErrorPage = Adapters.collapsedStringAdapterAdapter.marshal(formErrorPageRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(formLoginConfig, "formErrorPage", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (formErrorPage != null) {
+ writer.writeStartElement(prefix, "form-error-page", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(formErrorPage);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(formLoginConfig, "formErrorPage");
+ }
+
+ context.afterMarshal(formLoginConfig, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FormLoginConfig$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Function$JAXB.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Function%24JAXB.java?rev=1419199&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Function$JAXB.java (added)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Function$JAXB.java Mon Dec 10 05:08:14 2012
@@ -0,0 +1,393 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.jee;
+
+import com.envoisolutions.sxc.jaxb.JAXBObject;
+import com.envoisolutions.sxc.jaxb.LifecycleCallback;
+import com.envoisolutions.sxc.jaxb.RuntimeContext;
+import com.envoisolutions.sxc.util.Attribute;
+import com.envoisolutions.sxc.util.XoXMLStreamReader;
+import com.envoisolutions.sxc.util.XoXMLStreamWriter;
+
+import javax.xml.XMLConstants;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.openejb.jee.Icon$JAXB.readIcon;
+import static org.apache.openejb.jee.Icon$JAXB.writeIcon;
+import static org.apache.openejb.jee.Text$JAXB.readText;
+import static org.apache.openejb.jee.Text$JAXB.writeText;
+import static org.apache.openejb.jee.TldExtension$JAXB.readTldExtension;
+import static org.apache.openejb.jee.TldExtension$JAXB.writeTldExtension;
+
+@SuppressWarnings({
+ "StringEquality"
+})
+public class Function$JAXB
+ extends JAXBObject<Function> {
+
+
+ public Function$JAXB() {
+ super(Function.class, null, new QName("http://java.sun.com/xml/ns/javaee".intern(), "functionType".intern()), Text$JAXB.class, Icon$JAXB.class, TldExtension$JAXB.class);
+ }
+
+ public static Function readFunction(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public static void writeFunction(XoXMLStreamWriter writer, Function function, RuntimeContext context)
+ throws Exception {
+ _write(writer, function, context);
+ }
+
+ public void write(XoXMLStreamWriter writer, Function function, RuntimeContext context)
+ throws Exception {
+ _write(writer, function, context);
+ }
+
+ public final static Function _read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+
+ // Check for xsi:nil
+ if (reader.isXsiNil()) {
+ return null;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ Function function = new Function();
+ context.beforeUnmarshal(function, LifecycleCallback.NONE);
+
+ ArrayList<Text> descriptions = null;
+ ArrayList<Text> displayNames = null;
+ LocalCollection<Icon> icon = null;
+ List<TldExtension> functionExtension = null;
+
+ // Check xsi:type
+ QName xsiType = reader.getXsiType();
+ if (xsiType != null) {
+ if (("functionType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
+ return context.unexpectedXsiType(reader, Function.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, function);
+ function.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 (("display-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: displayNames
+ Text displayNamesItem = readText(elementReader, context);
+ if (displayNames == null) {
+ displayNames = new ArrayList<Text>();
+ }
+ displayNames.add(displayNamesItem);
+ } else if (("icon" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: icon
+ Icon iconItem = readIcon(elementReader, context);
+ if (icon == null) {
+ icon = function.icon;
+ if (icon != null) {
+ icon.clear();
+ } else {
+ icon = new LocalCollection<Icon>();
+ }
+ }
+ icon.add(iconItem);
+ } else 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;
+ }
+
+ function.name = name;
+ } else if (("function-class" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: functionClass
+ String functionClassRaw = elementReader.getElementAsString();
+
+ String functionClass;
+ try {
+ functionClass = Adapters.collapsedStringAdapterAdapter.unmarshal(functionClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ function.functionClass = functionClass;
+ } else if (("function-signature" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: functionSignature
+ String functionSignatureRaw = elementReader.getElementAsString();
+
+ String functionSignature;
+ try {
+ functionSignature = Adapters.collapsedStringAdapterAdapter.unmarshal(functionSignatureRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ function.functionSignature = functionSignature;
+ } else if (("example" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: example
+ String exampleRaw = elementReader.getElementAsString();
+
+ String example;
+ try {
+ example = Adapters.collapsedStringAdapterAdapter.unmarshal(exampleRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
+ continue;
+ }
+
+ function.example = example;
+ } else if (("function-extension" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
+ // ELEMENT: functionExtension
+ TldExtension functionExtensionItem = readTldExtension(elementReader, context);
+ if (functionExtension == null) {
+ functionExtension = function.functionExtension;
+ if (functionExtension != null) {
+ functionExtension.clear();
+ } else {
+ functionExtension = new ArrayList<TldExtension>();
+ }
+ }
+ functionExtension.add(functionExtensionItem);
+ } 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", "name"), new QName("http://java.sun.com/xml/ns/javaee", "function-class"), new QName("http://java.sun.com/xml/ns/javaee", "function-signature"), new QName("http://java.sun.com/xml/ns/javaee", "example"), new QName("http://java.sun.com/xml/ns/javaee", "function-extension"));
+ }
+ }
+ if (descriptions != null) {
+ try {
+ function.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Function.class, "setDescriptions", Text[].class, e);
+ }
+ }
+ if (displayNames != null) {
+ try {
+ function.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
+ } catch (Exception e) {
+ context.setterError(reader, Function.class, "setDisplayNames", Text[].class, e);
+ }
+ }
+ if (icon != null) {
+ function.icon = icon;
+ }
+ if (functionExtension != null) {
+ function.functionExtension = functionExtension;
+ }
+
+ context.afterUnmarshal(function, LifecycleCallback.NONE);
+
+ return function;
+ }
+
+ public final Function read(XoXMLStreamReader reader, RuntimeContext context)
+ throws Exception {
+ return _read(reader, context);
+ }
+
+ public final static void _write(XoXMLStreamWriter writer, Function function, RuntimeContext context)
+ throws Exception {
+ if (function == null) {
+ writer.writeXsiNil();
+ return;
+ }
+
+ if (context == null) {
+ context = new RuntimeContext();
+ }
+
+ String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
+ if (Function.class != function.getClass()) {
+ context.unexpectedSubclass(writer, function, Function.class);
+ return;
+ }
+
+ context.beforeMarshal(function, LifecycleCallback.NONE);
+
+
+ // ATTRIBUTE: id
+ String idRaw = function.id;
+ if (idRaw != null) {
+ String id = null;
+ try {
+ id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(function, "id", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ writer.writeAttribute("", "", "id", id);
+ }
+
+ // ELEMENT: descriptions
+ Text[] descriptions = null;
+ try {
+ descriptions = function.getDescriptions();
+ } catch (Exception e) {
+ context.getterError(function, "descriptions", Function.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(function, "descriptions");
+ }
+ }
+ }
+
+ // ELEMENT: displayNames
+ Text[] displayNames = null;
+ try {
+ displayNames = function.getDisplayNames();
+ } catch (Exception e) {
+ context.getterError(function, "displayNames", Function.class, "getDisplayNames", e);
+ }
+ if (displayNames != null) {
+ for (Text displayNamesItem : displayNames) {
+ if (displayNamesItem != null) {
+ writer.writeStartElement(prefix, "display-name", "http://java.sun.com/xml/ns/javaee");
+ writeText(writer, displayNamesItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(function, "displayNames");
+ }
+ }
+ }
+
+ // ELEMENT: icon
+ LocalCollection<Icon> icon = function.icon;
+ if (icon != null) {
+ for (Icon iconItem : icon) {
+ if (iconItem != null) {
+ writer.writeStartElement(prefix, "icon", "http://java.sun.com/xml/ns/javaee");
+ writeIcon(writer, iconItem, context);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(function, "icon");
+ }
+ }
+ }
+
+ // ELEMENT: name
+ String nameRaw = function.name;
+ String name = null;
+ try {
+ name = Adapters.collapsedStringAdapterAdapter.marshal(nameRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(function, "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(function, "name");
+ }
+
+ // ELEMENT: functionClass
+ String functionClassRaw = function.functionClass;
+ String functionClass = null;
+ try {
+ functionClass = Adapters.collapsedStringAdapterAdapter.marshal(functionClassRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(function, "functionClass", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (functionClass != null) {
+ writer.writeStartElement(prefix, "function-class", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(functionClass);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(function, "functionClass");
+ }
+
+ // ELEMENT: functionSignature
+ String functionSignatureRaw = function.functionSignature;
+ String functionSignature = null;
+ try {
+ functionSignature = Adapters.collapsedStringAdapterAdapter.marshal(functionSignatureRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(function, "functionSignature", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (functionSignature != null) {
+ writer.writeStartElement(prefix, "function-signature", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(functionSignature);
+ writer.writeEndElement();
+ } else {
+ context.unexpectedNullValue(function, "functionSignature");
+ }
+
+ // ELEMENT: example
+ String exampleRaw = function.example;
+ String example = null;
+ try {
+ example = Adapters.collapsedStringAdapterAdapter.marshal(exampleRaw);
+ } catch (Exception e) {
+ context.xmlAdapterError(function, "example", CollapsedStringAdapter.class, String.class, String.class, e);
+ }
+ if (example != null) {
+ writer.writeStartElement(prefix, "example", "http://java.sun.com/xml/ns/javaee");
+ writer.writeCharacters(example);
+ writer.writeEndElement();
+ }
+
+ // ELEMENT: functionExtension
+ List<TldExtension> functionExtension = function.functionExtension;
+ if (functionExtension != null) {
+ for (TldExtension functionExtensionItem : functionExtension) {
+ if (functionExtensionItem != null) {
+ writer.writeStartElement(prefix, "function-extension", "http://java.sun.com/xml/ns/javaee");
+ writeTldExtension(writer, functionExtensionItem, context);
+ writer.writeEndElement();
+ }
+ }
+ }
+
+ context.afterMarshal(function, LifecycleCallback.NONE);
+ }
+
+}
Propchange: openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/Function$JAXB.java
------------------------------------------------------------------------------
svn:eol-style = native