use of org.apache.openejb.jee.Text$JAXB.writeText in project tomee by apache.
the class FacesProperty$JAXB method _write.
public static final void _write(final XoXMLStreamWriter writer, final FacesProperty facesProperty, RuntimeContext context) throws Exception {
if (facesProperty == null) {
writer.writeXsiNil();
return;
}
if (context == null) {
context = new RuntimeContext();
}
final String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
if (FacesProperty.class != facesProperty.getClass()) {
context.unexpectedSubclass(writer, facesProperty, FacesProperty.class);
return;
}
context.beforeMarshal(facesProperty, LifecycleCallback.NONE);
// ATTRIBUTE: id
final String idRaw = facesProperty.id;
if (idRaw != null) {
String id = null;
try {
id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
} catch (final Exception e) {
context.xmlAdapterError(facesProperty, "id", CollapsedStringAdapter.class, String.class, String.class, e);
}
writer.writeAttribute("", "", "id", id);
}
// ELEMENT: descriptions
Text[] descriptions = null;
try {
descriptions = facesProperty.getDescriptions();
} catch (final Exception e) {
context.getterError(facesProperty, "descriptions", FacesProperty.class, "getDescriptions", e);
}
if (descriptions != null) {
for (final 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(facesProperty, "descriptions");
}
}
}
// ELEMENT: displayNames
Text[] displayNames = null;
try {
displayNames = facesProperty.getDisplayNames();
} catch (final Exception e) {
context.getterError(facesProperty, "displayNames", FacesProperty.class, "getDisplayNames", e);
}
if (displayNames != null) {
for (final 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(facesProperty, "displayNames");
}
}
}
// ELEMENT: icon
final LocalCollection<Icon> icon = facesProperty.icon;
if (icon != null) {
for (final 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(facesProperty, "icon");
}
}
}
// ELEMENT: propertyName
final String propertyNameRaw = facesProperty.propertyName;
String propertyName = null;
try {
propertyName = Adapters.collapsedStringAdapterAdapter.marshal(propertyNameRaw);
} catch (final Exception e) {
context.xmlAdapterError(facesProperty, "propertyName", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (propertyName != null) {
writer.writeStartElement(prefix, "property-name", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(propertyName);
writer.writeEndElement();
} else {
context.unexpectedNullValue(facesProperty, "propertyName");
}
// ELEMENT: propertyClass
final String propertyClassRaw = facesProperty.propertyClass;
String propertyClass = null;
try {
propertyClass = Adapters.collapsedStringAdapterAdapter.marshal(propertyClassRaw);
} catch (final Exception e) {
context.xmlAdapterError(facesProperty, "propertyClass", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (propertyClass != null) {
writer.writeStartElement(prefix, "property-class", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(propertyClass);
writer.writeEndElement();
} else {
context.unexpectedNullValue(facesProperty, "propertyClass");
}
// ELEMENT: defaultValue
final String defaultValueRaw = facesProperty.defaultValue;
String defaultValue = null;
try {
defaultValue = Adapters.collapsedStringAdapterAdapter.marshal(defaultValueRaw);
} catch (final Exception e) {
context.xmlAdapterError(facesProperty, "defaultValue", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (defaultValue != null) {
writer.writeStartElement(prefix, "default-value", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(defaultValue);
writer.writeEndElement();
}
// ELEMENT: suggestedValue
final String suggestedValueRaw = facesProperty.suggestedValue;
String suggestedValue = null;
try {
suggestedValue = Adapters.collapsedStringAdapterAdapter.marshal(suggestedValueRaw);
} catch (final Exception e) {
context.xmlAdapterError(facesProperty, "suggestedValue", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (suggestedValue != null) {
writer.writeStartElement(prefix, "suggested-value", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(suggestedValue);
writer.writeEndElement();
}
// ELEMENT: propertyExtension
final List<FacesPropertyExtension> propertyExtension = facesProperty.propertyExtension;
if (propertyExtension != null) {
for (final FacesPropertyExtension propertyExtensionItem : propertyExtension) {
if (propertyExtensionItem != null) {
writer.writeStartElement(prefix, "property-extension", "http://java.sun.com/xml/ns/javaee");
writeFacesPropertyExtension(writer, propertyExtensionItem, context);
writer.writeEndElement();
}
}
}
context.afterMarshal(facesProperty, LifecycleCallback.NONE);
}
use of org.apache.openejb.jee.Text$JAXB.writeText in project tomee by apache.
the class FacesValidator$JAXB method _read.
public static final FacesValidator _read(final XoXMLStreamReader reader, RuntimeContext context) throws Exception {
// Check for xsi:nil
if (reader.isXsiNil()) {
return null;
}
if (context == null) {
context = new RuntimeContext();
}
final 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
final 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 (final Attribute attribute : reader.getAttributes()) {
if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
// ATTRIBUTE: id
final 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 (final XoXMLStreamReader elementReader : reader.getChildElements()) {
if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
// ELEMENT: descriptions
final 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
final 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
final 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
final String validatorIdRaw = elementReader.getElementAsString();
final String validatorId;
try {
validatorId = Adapters.collapsedStringAdapterAdapter.unmarshal(validatorIdRaw);
} catch (final 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
final String validatorClassRaw = elementReader.getElementAsString();
final String validatorClass;
try {
validatorClass = Adapters.collapsedStringAdapterAdapter.unmarshal(validatorClassRaw);
} catch (final 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
final 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
final 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
final 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 {
// just here ATM to not prevent users to get JSF 2.2 feature because we can't read it
// TODO: handle it properly
// 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 (final Exception e) {
context.setterError(reader, FacesValidator.class, "setDescriptions", Text[].class, e);
}
}
if (displayNames != null) {
try {
facesValidator.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
} catch (final 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;
}
use of org.apache.openejb.jee.Text$JAXB.writeText in project tomee by apache.
the class FacesValidator$JAXB method _write.
public static final void _write(final XoXMLStreamWriter writer, final FacesValidator facesValidator, RuntimeContext context) throws Exception {
if (facesValidator == null) {
writer.writeXsiNil();
return;
}
if (context == null) {
context = new RuntimeContext();
}
final 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
final String idRaw = facesValidator.id;
if (idRaw != null) {
String id = null;
try {
id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
} catch (final 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 (final Exception e) {
context.getterError(facesValidator, "descriptions", FacesValidator.class, "getDescriptions", e);
}
if (descriptions != null) {
for (final 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 (final Exception e) {
context.getterError(facesValidator, "displayNames", FacesValidator.class, "getDisplayNames", e);
}
if (displayNames != null) {
for (final 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
final LocalCollection<Icon> icon = facesValidator.icon;
if (icon != null) {
for (final 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
final String validatorIdRaw = facesValidator.validatorId;
String validatorId = null;
try {
validatorId = Adapters.collapsedStringAdapterAdapter.marshal(validatorIdRaw);
} catch (final 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
final String validatorClassRaw = facesValidator.validatorClass;
String validatorClass = null;
try {
validatorClass = Adapters.collapsedStringAdapterAdapter.marshal(validatorClassRaw);
} catch (final 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
final List<FacesAttribute> attribute = facesValidator.attribute;
if (attribute != null) {
for (final 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
final List<FacesProperty> property = facesValidator.property;
if (property != null) {
for (final 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
final List<FacesValidatorExtension> validatorExtension = facesValidator.validatorExtension;
if (validatorExtension != null) {
for (final 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);
}
use of org.apache.openejb.jee.Text$JAXB.writeText in project tomee by apache.
the class FacesFacet$JAXB method _read.
public static final FacesFacet _read(final XoXMLStreamReader reader, RuntimeContext context) throws Exception {
// Check for xsi:nil
if (reader.isXsiNil()) {
return null;
}
if (context == null) {
context = new RuntimeContext();
}
final FacesFacet facesFacet = new FacesFacet();
context.beforeUnmarshal(facesFacet, LifecycleCallback.NONE);
ArrayList<Text> descriptions = null;
ArrayList<Text> displayNames = null;
LocalCollection<Icon> icon = null;
List<FacesFacetExtension> facetExtension = null;
// Check xsi:type
final QName xsiType = reader.getXsiType();
if (xsiType != null) {
if (("faces-config-facetType" != xsiType.getLocalPart()) || ("http://java.sun.com/xml/ns/javaee" != xsiType.getNamespaceURI())) {
return context.unexpectedXsiType(reader, FacesFacet.class);
}
}
// Read attributes
for (final Attribute attribute : reader.getAttributes()) {
if (("id" == attribute.getLocalName()) && (("" == attribute.getNamespace()) || (attribute.getNamespace() == null))) {
// ATTRIBUTE: id
final String id = Adapters.collapsedStringAdapterAdapter.unmarshal(attribute.getValue());
context.addXmlId(reader, id, facesFacet);
facesFacet.id = id;
} else if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI != attribute.getNamespace()) {
context.unexpectedAttribute(attribute, new QName("", "id"));
}
}
// Read elements
for (final XoXMLStreamReader elementReader : reader.getChildElements()) {
if (("description" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
// ELEMENT: descriptions
final 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
final 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
final Icon iconItem = readIcon(elementReader, context);
if (icon == null) {
icon = facesFacet.icon;
if (icon != null) {
icon.clear();
} else {
icon = new LocalCollection<Icon>();
}
}
icon.add(iconItem);
} else if (("facet-name" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
// ELEMENT: facetName
final String facetNameRaw = elementReader.getElementAsString();
final String facetName;
try {
facetName = Adapters.collapsedStringAdapterAdapter.unmarshal(facetNameRaw);
} catch (final Exception e) {
context.xmlAdapterError(elementReader, CollapsedStringAdapter.class, String.class, String.class, e);
continue;
}
facesFacet.facetName = facetName;
} else if (("facet-extension" == elementReader.getLocalName()) && ("http://java.sun.com/xml/ns/javaee" == elementReader.getNamespaceURI())) {
// ELEMENT: facetExtension
final FacesFacetExtension facetExtensionItem = readFacesFacetExtension(elementReader, context);
if (facetExtension == null) {
facetExtension = facesFacet.facetExtension;
if (facetExtension != null) {
facetExtension.clear();
} else {
facetExtension = new ArrayList<FacesFacetExtension>();
}
}
facetExtension.add(facetExtensionItem);
} 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", "facet-name"), new QName("http://java.sun.com/xml/ns/javaee", "facet-extension"));
}
}
if (descriptions != null) {
try {
facesFacet.setDescriptions(descriptions.toArray(new Text[descriptions.size()]));
} catch (final Exception e) {
context.setterError(reader, FacesFacet.class, "setDescriptions", Text[].class, e);
}
}
if (displayNames != null) {
try {
facesFacet.setDisplayNames(displayNames.toArray(new Text[displayNames.size()]));
} catch (final Exception e) {
context.setterError(reader, FacesFacet.class, "setDisplayNames", Text[].class, e);
}
}
if (icon != null) {
facesFacet.icon = icon;
}
if (facetExtension != null) {
facesFacet.facetExtension = facetExtension;
}
context.afterUnmarshal(facesFacet, LifecycleCallback.NONE);
return facesFacet;
}
use of org.apache.openejb.jee.Text$JAXB.writeText in project tomee by apache.
the class Interceptor$JAXB method _write.
public static final void _write(final XoXMLStreamWriter writer, final Interceptor interceptor, RuntimeContext context) throws Exception {
if (interceptor == null) {
writer.writeXsiNil();
return;
}
if (context == null) {
context = new RuntimeContext();
}
final String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
if (Interceptor.class != interceptor.getClass()) {
context.unexpectedSubclass(writer, interceptor, Interceptor.class);
return;
}
context.beforeMarshal(interceptor, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
// ATTRIBUTE: id
final String idRaw = interceptor.id;
if (idRaw != null) {
String id = null;
try {
id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
} catch (final Exception e) {
context.xmlAdapterError(interceptor, "id", CollapsedStringAdapter.class, String.class, String.class, e);
}
writer.writeAttribute("", "", "id", id);
}
// ELEMENT: descriptions
Text[] descriptions = null;
try {
descriptions = interceptor.getDescriptions();
} catch (final Exception e) {
context.getterError(interceptor, "descriptions", Interceptor.class, "getDescriptions", e);
}
if (descriptions != null) {
for (final 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(interceptor, "descriptions");
}
}
}
// ELEMENT: interceptorClass
final String interceptorClassRaw = interceptor.interceptorClass;
String interceptorClass = null;
try {
interceptorClass = Adapters.collapsedStringAdapterAdapter.marshal(interceptorClassRaw);
} catch (final Exception e) {
context.xmlAdapterError(interceptor, "interceptorClass", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (interceptorClass != null) {
writer.writeStartElement(prefix, "interceptor-class", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(interceptorClass);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "interceptorClass");
}
// ELEMENT: aroundInvoke
final List<AroundInvoke> aroundInvoke = interceptor.aroundInvoke;
if (aroundInvoke != null) {
for (final AroundInvoke aroundInvokeItem : aroundInvoke) {
if (aroundInvokeItem != null) {
writer.writeStartElement(prefix, "around-invoke", "http://java.sun.com/xml/ns/javaee");
writeAroundInvoke(writer, aroundInvokeItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "aroundInvoke");
}
}
}
// ELEMENT: aroundTimeout
final List<AroundTimeout> aroundTimeout = interceptor.aroundTimeout;
if (aroundTimeout != null) {
for (final AroundTimeout aroundTimeoutItem : aroundTimeout) {
if (aroundTimeoutItem != null) {
writer.writeStartElement(prefix, "around-timeout", "http://java.sun.com/xml/ns/javaee");
writeAroundTimeout(writer, aroundTimeoutItem, context);
writer.writeEndElement();
}
}
}
// ELEMENT: envEntry
final KeyedCollection<String, EnvEntry> envEntry = interceptor.envEntry;
if (envEntry != null) {
for (final EnvEntry envEntryItem : envEntry) {
if (envEntryItem != null) {
writer.writeStartElement(prefix, "env-entry", "http://java.sun.com/xml/ns/javaee");
writeEnvEntry(writer, envEntryItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "envEntry");
}
}
}
// ELEMENT: ejbRef
final KeyedCollection<String, EjbRef> ejbRef = interceptor.ejbRef;
if (ejbRef != null) {
for (final EjbRef ejbRefItem : ejbRef) {
if (ejbRefItem != null) {
writer.writeStartElement(prefix, "ejb-ref", "http://java.sun.com/xml/ns/javaee");
writeEjbRef(writer, ejbRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "ejbRef");
}
}
}
// ELEMENT: ejbLocalRef
final KeyedCollection<String, EjbLocalRef> ejbLocalRef = interceptor.ejbLocalRef;
if (ejbLocalRef != null) {
for (final EjbLocalRef ejbLocalRefItem : ejbLocalRef) {
if (ejbLocalRefItem != null) {
writer.writeStartElement(prefix, "ejb-local-ref", "http://java.sun.com/xml/ns/javaee");
writeEjbLocalRef(writer, ejbLocalRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "ejbLocalRef");
}
}
}
// ELEMENT: serviceRef
final KeyedCollection<String, ServiceRef> serviceRef = interceptor.serviceRef;
if (serviceRef != null) {
for (final ServiceRef serviceRefItem : serviceRef) {
if (serviceRefItem != null) {
writer.writeStartElement(prefix, "service-ref", "http://java.sun.com/xml/ns/javaee");
writeServiceRef(writer, serviceRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "serviceRef");
}
}
}
// ELEMENT: resourceRef
final KeyedCollection<String, ResourceRef> resourceRef = interceptor.resourceRef;
if (resourceRef != null) {
for (final ResourceRef resourceRefItem : resourceRef) {
if (resourceRefItem != null) {
writer.writeStartElement(prefix, "resource-ref", "http://java.sun.com/xml/ns/javaee");
writeResourceRef(writer, resourceRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "resourceRef");
}
}
}
// ELEMENT: resourceEnvRef
final KeyedCollection<String, ResourceEnvRef> resourceEnvRef = interceptor.resourceEnvRef;
if (resourceEnvRef != null) {
for (final ResourceEnvRef resourceEnvRefItem : resourceEnvRef) {
if (resourceEnvRefItem != null) {
writer.writeStartElement(prefix, "resource-env-ref", "http://java.sun.com/xml/ns/javaee");
writeResourceEnvRef(writer, resourceEnvRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "resourceEnvRef");
}
}
}
// ELEMENT: messageDestinationRef
final KeyedCollection<String, MessageDestinationRef> messageDestinationRef = interceptor.messageDestinationRef;
if (messageDestinationRef != null) {
for (final MessageDestinationRef messageDestinationRefItem : messageDestinationRef) {
if (messageDestinationRefItem != null) {
writer.writeStartElement(prefix, "message-destination-ref", "http://java.sun.com/xml/ns/javaee");
writeMessageDestinationRef(writer, messageDestinationRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "messageDestinationRef");
}
}
}
// ELEMENT: persistenceContextRef
final KeyedCollection<String, PersistenceContextRef> persistenceContextRef = interceptor.persistenceContextRef;
if (persistenceContextRef != null) {
for (final PersistenceContextRef persistenceContextRefItem : persistenceContextRef) {
if (persistenceContextRefItem != null) {
writer.writeStartElement(prefix, "persistence-context-ref", "http://java.sun.com/xml/ns/javaee");
writePersistenceContextRef(writer, persistenceContextRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "persistenceContextRef");
}
}
}
// ELEMENT: persistenceUnitRef
final KeyedCollection<String, PersistenceUnitRef> persistenceUnitRef = interceptor.persistenceUnitRef;
if (persistenceUnitRef != null) {
for (final PersistenceUnitRef persistenceUnitRefItem : persistenceUnitRef) {
if (persistenceUnitRefItem != null) {
writer.writeStartElement(prefix, "persistence-unit-ref", "http://java.sun.com/xml/ns/javaee");
writePersistenceUnitRef(writer, persistenceUnitRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "persistenceUnitRef");
}
}
}
// ELEMENT: postConstruct
final List<org.apache.openejb.jee.LifecycleCallback> postConstruct = interceptor.postConstruct;
if (postConstruct != null) {
for (final org.apache.openejb.jee.LifecycleCallback postConstructItem : postConstruct) {
if (postConstructItem != null) {
writer.writeStartElement(prefix, "post-construct", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, postConstructItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "postConstruct");
}
}
}
// ELEMENT: preDestroy
final List<org.apache.openejb.jee.LifecycleCallback> preDestroy = interceptor.preDestroy;
if (preDestroy != null) {
for (final org.apache.openejb.jee.LifecycleCallback preDestroyItem : preDestroy) {
if (preDestroyItem != null) {
writer.writeStartElement(prefix, "pre-destroy", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, preDestroyItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "preDestroy");
}
}
}
// ELEMENT: dataSource
final KeyedCollection<String, DataSource> dataSource = interceptor.dataSource;
if (dataSource != null) {
for (final DataSource dataSourceItem : dataSource) {
if (dataSourceItem != null) {
writer.writeStartElement(prefix, "data-source", "http://java.sun.com/xml/ns/javaee");
writeDataSource(writer, dataSourceItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "dataSource");
}
}
}
// ELEMENT: postActivate
final List<org.apache.openejb.jee.LifecycleCallback> postActivate = interceptor.postActivate;
if (postActivate != null) {
for (final org.apache.openejb.jee.LifecycleCallback postActivateItem : postActivate) {
if (postActivateItem != null) {
writer.writeStartElement(prefix, "post-activate", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, postActivateItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "postActivate");
}
}
}
// ELEMENT: prePassivate
final List<org.apache.openejb.jee.LifecycleCallback> prePassivate = interceptor.prePassivate;
if (prePassivate != null) {
for (final org.apache.openejb.jee.LifecycleCallback prePassivateItem : prePassivate) {
if (prePassivateItem != null) {
writer.writeStartElement(prefix, "pre-passivate", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, prePassivateItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "prePassivate");
}
}
}
// ELEMENT: afterBegin
final List<org.apache.openejb.jee.LifecycleCallback> afterBegin = interceptor.afterBegin;
if (afterBegin != null) {
for (final org.apache.openejb.jee.LifecycleCallback afterBeginItem : afterBegin) {
if (afterBeginItem != null) {
writer.writeStartElement(prefix, "after-begin", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, afterBeginItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "afterBegin");
}
}
}
// ELEMENT: beforeCompletion
final List<org.apache.openejb.jee.LifecycleCallback> beforeCompletion = interceptor.beforeCompletion;
if (beforeCompletion != null) {
for (final org.apache.openejb.jee.LifecycleCallback beforeCompletionItem : beforeCompletion) {
if (beforeCompletionItem != null) {
writer.writeStartElement(prefix, "before-completion", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, beforeCompletionItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "beforeCompletion");
}
}
}
// ELEMENT: afterCompletion
final List<org.apache.openejb.jee.LifecycleCallback> afterCompletion = interceptor.afterCompletion;
if (afterCompletion != null) {
for (final org.apache.openejb.jee.LifecycleCallback afterCompletionItem : afterCompletion) {
if (afterCompletionItem != null) {
writer.writeStartElement(prefix, "after-completion", "http://java.sun.com/xml/ns/javaee");
writeLifecycleCallback(writer, afterCompletionItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(interceptor, "afterCompletion");
}
}
}
context.afterMarshal(interceptor, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
}
Aggregations