use of org.apache.openejb.jee.ServiceRef$JAXB.writeServiceRef in project tomee by apache.
the class EntityBean$JAXB method _write.
public static final void _write(final XoXMLStreamWriter writer, final EntityBean entityBean, RuntimeContext context) throws Exception {
if (entityBean == null) {
writer.writeXsiNil();
return;
}
if (context == null) {
context = new RuntimeContext();
}
final String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
if (EntityBean.class != entityBean.getClass()) {
context.unexpectedSubclass(writer, entityBean, EntityBean.class);
return;
}
context.beforeMarshal(entityBean, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
// ATTRIBUTE: id
final String idRaw = entityBean.id;
if (idRaw != null) {
String id = null;
try {
id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "id", CollapsedStringAdapter.class, String.class, String.class, e);
}
writer.writeAttribute("", "", "id", id);
}
// ELEMENT: descriptions
Text[] descriptions = null;
try {
descriptions = entityBean.getDescriptions();
} catch (final Exception e) {
context.getterError(entityBean, "descriptions", EntityBean.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(entityBean, "descriptions");
}
}
}
// ELEMENT: displayNames
Text[] displayNames = null;
try {
displayNames = entityBean.getDisplayNames();
} catch (final Exception e) {
context.getterError(entityBean, "displayNames", EntityBean.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(entityBean, "displayNames");
}
}
}
// ELEMENT: icon
final LocalCollection<Icon> icon = entityBean.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(entityBean, "icon");
}
}
}
// ELEMENT: ejbName
final String ejbNameRaw = entityBean.ejbName;
String ejbName = null;
try {
ejbName = Adapters.collapsedStringAdapterAdapter.marshal(ejbNameRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "ejbName", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (ejbName != null) {
writer.writeStartElement(prefix, "ejb-name", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(ejbName);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "ejbName");
}
// ELEMENT: mappedName
final String mappedNameRaw = entityBean.mappedName;
String mappedName = null;
try {
mappedName = Adapters.collapsedStringAdapterAdapter.marshal(mappedNameRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "mappedName", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (mappedName != null) {
writer.writeStartElement(prefix, "mapped-name", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(mappedName);
writer.writeEndElement();
}
// ELEMENT: home
final String homeRaw = entityBean.home;
String home = null;
try {
home = Adapters.collapsedStringAdapterAdapter.marshal(homeRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "home", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (home != null) {
writer.writeStartElement(prefix, "home", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(home);
writer.writeEndElement();
}
// ELEMENT: remote
final String remoteRaw = entityBean.remote;
String remote = null;
try {
remote = Adapters.collapsedStringAdapterAdapter.marshal(remoteRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "remote", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (remote != null) {
writer.writeStartElement(prefix, "remote", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(remote);
writer.writeEndElement();
}
// ELEMENT: localHome
final String localHomeRaw = entityBean.localHome;
String localHome = null;
try {
localHome = Adapters.collapsedStringAdapterAdapter.marshal(localHomeRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "localHome", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (localHome != null) {
writer.writeStartElement(prefix, "local-home", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(localHome);
writer.writeEndElement();
}
// ELEMENT: local
final String localRaw = entityBean.local;
String local = null;
try {
local = Adapters.collapsedStringAdapterAdapter.marshal(localRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "local", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (local != null) {
writer.writeStartElement(prefix, "local", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(local);
writer.writeEndElement();
}
// ELEMENT: ejbClass
final String ejbClassRaw = entityBean.ejbClass;
String ejbClass = null;
try {
ejbClass = Adapters.collapsedStringAdapterAdapter.marshal(ejbClassRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "ejbClass", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (ejbClass != null) {
writer.writeStartElement(prefix, "ejb-class", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(ejbClass);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "ejbClass");
}
// ELEMENT: persistenceType
final PersistenceType persistenceType = entityBean.persistenceType;
if (persistenceType != null) {
writer.writeStartElement(prefix, "persistence-type", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(toStringPersistenceType(entityBean, null, context, persistenceType));
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "persistenceType");
}
// ELEMENT: primKeyClass
final String primKeyClassRaw = entityBean.primKeyClass;
String primKeyClass = null;
try {
primKeyClass = Adapters.collapsedStringAdapterAdapter.marshal(primKeyClassRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "primKeyClass", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (primKeyClass != null) {
writer.writeStartElement(prefix, "prim-key-class", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(primKeyClass);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "primKeyClass");
}
// ELEMENT: reentrant
final Boolean reentrantRaw = entityBean.reentrant;
String reentrant = null;
try {
reentrant = Adapters.booleanAdapterAdapter.marshal(reentrantRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "reentrant", BooleanAdapter.class, Boolean.TYPE, Boolean.TYPE, e);
}
if (reentrant != null) {
writer.writeStartElement(prefix, "reentrant", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(reentrant);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "reentrant");
}
// ELEMENT: cmpVersion
final CmpVersion cmpVersion = entityBean.cmpVersion;
if (cmpVersion != null) {
writer.writeStartElement(prefix, "cmp-version", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(toStringCmpVersion(entityBean, null, context, cmpVersion));
writer.writeEndElement();
}
// ELEMENT: abstractSchemaName
final String abstractSchemaNameRaw = entityBean.abstractSchemaName;
String abstractSchemaName = null;
try {
abstractSchemaName = Adapters.collapsedStringAdapterAdapter.marshal(abstractSchemaNameRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "abstractSchemaName", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (abstractSchemaName != null) {
writer.writeStartElement(prefix, "abstract-schema-name", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(abstractSchemaName);
writer.writeEndElement();
}
// ELEMENT: cmpField
final List<CmpField> cmpField = entityBean.cmpField;
if (cmpField != null) {
for (final CmpField cmpFieldItem : cmpField) {
if (cmpFieldItem != null) {
writer.writeStartElement(prefix, "cmp-field", "http://java.sun.com/xml/ns/javaee");
writeCmpField(writer, cmpFieldItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "cmpField");
}
}
}
// ELEMENT: primkeyField
final String primkeyFieldRaw = entityBean.primkeyField;
String primkeyField = null;
try {
primkeyField = Adapters.collapsedStringAdapterAdapter.marshal(primkeyFieldRaw);
} catch (final Exception e) {
context.xmlAdapterError(entityBean, "primkeyField", CollapsedStringAdapter.class, String.class, String.class, e);
}
if (primkeyField != null) {
writer.writeStartElement(prefix, "primkey-field", "http://java.sun.com/xml/ns/javaee");
writer.writeCharacters(primkeyField);
writer.writeEndElement();
}
// ELEMENT: envEntry
final KeyedCollection<String, EnvEntry> envEntry = entityBean.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(entityBean, "envEntry");
}
}
}
// ELEMENT: ejbRef
final KeyedCollection<String, EjbRef> ejbRef = entityBean.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(entityBean, "ejbRef");
}
}
}
// ELEMENT: ejbLocalRef
final KeyedCollection<String, EjbLocalRef> ejbLocalRef = entityBean.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(entityBean, "ejbLocalRef");
}
}
}
// ELEMENT: serviceRef
final KeyedCollection<String, ServiceRef> serviceRef = entityBean.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(entityBean, "serviceRef");
}
}
}
// ELEMENT: resourceRef
final KeyedCollection<String, ResourceRef> resourceRef = entityBean.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(entityBean, "resourceRef");
}
}
}
// ELEMENT: resourceEnvRef
final KeyedCollection<String, ResourceEnvRef> resourceEnvRef = entityBean.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(entityBean, "resourceEnvRef");
}
}
}
// ELEMENT: messageDestinationRef
final KeyedCollection<String, MessageDestinationRef> messageDestinationRef = entityBean.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(entityBean, "messageDestinationRef");
}
}
}
// ELEMENT: persistenceContextRef
final KeyedCollection<String, PersistenceContextRef> persistenceContextRef = entityBean.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(entityBean, "persistenceContextRef");
}
}
}
// ELEMENT: persistenceUnitRef
final KeyedCollection<String, PersistenceUnitRef> persistenceUnitRef = entityBean.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(entityBean, "persistenceUnitRef");
}
}
}
// ELEMENT: postConstruct
final List<org.apache.openejb.jee.LifecycleCallback> postConstruct = entityBean.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(entityBean, "postConstruct");
}
}
}
// ELEMENT: preDestroy
final List<org.apache.openejb.jee.LifecycleCallback> preDestroy = entityBean.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(entityBean, "preDestroy");
}
}
}
// ELEMENT: dataSource
final KeyedCollection<String, DataSource> dataSource = entityBean.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();
}
}
}
// ELEMENT: securityRoleRef
final List<SecurityRoleRef> securityRoleRef = entityBean.securityRoleRef;
if (securityRoleRef != null) {
for (final SecurityRoleRef securityRoleRefItem : securityRoleRef) {
if (securityRoleRefItem != null) {
writer.writeStartElement(prefix, "security-role-ref", "http://java.sun.com/xml/ns/javaee");
writeSecurityRoleRef(writer, securityRoleRefItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "securityRoleRef");
}
}
}
// ELEMENT: securityIdentity
final SecurityIdentity securityIdentity = entityBean.securityIdentity;
if (securityIdentity != null) {
writer.writeStartElement(prefix, "security-identity", "http://java.sun.com/xml/ns/javaee");
writeSecurityIdentity(writer, securityIdentity, context);
writer.writeEndElement();
}
// ELEMENT: query
final List<Query> query = entityBean.query;
if (query != null) {
for (final Query queryItem : query) {
if (queryItem != null) {
writer.writeStartElement(prefix, "query", "http://java.sun.com/xml/ns/javaee");
writeQuery(writer, queryItem, context);
writer.writeEndElement();
} else {
context.unexpectedNullValue(entityBean, "query");
}
}
}
context.afterMarshal(entityBean, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
}
Aggregations