public class ExImportHelperService
extends java.lang.Object
ExportService,
ImportService| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COLLECTION_VALUE_ELEMENT |
static java.lang.String |
DOCUMENT_DATA_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_DATE_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_DESCRIPTION_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_NAME_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_USER_ELEMENT |
static java.lang.String |
DOCUMENT_HEAD_VERSION_ELEMENT |
static java.lang.String |
DOCUMENT_ROOT_ELEMENT |
static java.lang.String |
EXIMPORT_XML_NAMESPACE |
static java.lang.String |
EXIMPORT_XML_NAMESPACE_PREFIX |
static java.lang.String |
EXPORTED_ITEM_ELEMENT_NAME |
static java.lang.String |
EXPORTED_PROPERTY_ELEMENT_NAME |
static java.lang.String |
EXPORTER_BASE_ELEMENT |
static java.lang.String |
EXPORTER_TYPE |
static java.lang.String |
IS_COLLECTION_ATTRIBUTE |
static java.lang.String |
IS_ENCLOSED_ATTRIBUTE |
static java.lang.String |
IS_NULL_ATTRIBUTE |
static java.lang.String |
IS_OPTIONAL_REFERENCE |
static java.lang.String |
NAME_ATTRIBUTE |
static java.util.Map<java.lang.String,java.lang.String> |
namespaceMap |
static java.lang.String |
PROPERTY_TYPE |
static java.lang.String |
REFERENCE_ID |
static java.lang.String |
TYPE_ATTRIBUTE |
static java.lang.String |
VALUE_ATTRIBUTE |
static java.lang.String |
XML_TRUE |
| Constructor and Description |
|---|
ExImportHelperService(ExImportIdService idService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String entityId)
Adds an entityId to the attribute xml:id in the given
XMLStreamWriter |
void |
addNamespaces(javax.xml.stream.XMLStreamWriter xsw) |
java.util.Set<java.lang.Class<?>> |
getAllowedReferenceTypesFor(java.lang.Object node,
java.util.List<Exporter> exporters) |
java.lang.String |
getIdAttribute(Element el)
Returns the id attribute of the given
Element |
java.lang.String |
getIdFor(java.lang.Object object) |
java.util.Map |
getNamespaceMap() |
void |
setAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String name,
java.lang.String value)
Sets the attribute name to the given value
|
void |
setEnclosedAttributes(javax.xml.stream.XMLStreamWriter xsw,
Exporter exporter)
Sets the
XMLStreamWriters EXPORTER_TYPE and
IS_ENCLOSED_ATTRIBUTE attributes |
void |
setExporterType(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<? extends Exporter> type)
Sets the EXPORTER_TYPE attribute of the given
XMLStreamWriter |
void |
setExporterType(javax.xml.stream.XMLStreamWriter xsw,
Exporter exporter)
Sets the EXPORTER_TYPE attribute of the given
XMLStreamWriter |
void |
setIsCollectionAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<?> propertyType)
Sets the IS_COLLECTION_ATTRIBUTE attribute of the given
XMLStreamWriter to XML_TRUE and the PROPERTY_TYPE to
propertyType.getName() |
void |
setIsNullAttribute(javax.xml.stream.XMLStreamWriter xsw)
Sets the IS_NULL_ATTRIBUTE attribute of the given
XMLStreamWriter to XML_TRUE |
void |
setNameAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String name)
Sets the NAME_ATTRIBUTE to the given name
|
void |
setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
java.lang.Class<?> exporterType,
boolean optional)
Sets the following attributes to the corresponding values:
TYPE_ATTRIBUTE <- type.getName()
REFERENCE_ID <- id
EXPORTER_TYPE <- exporterType.getName()
If optional is true:
IS_OPTIONAL_REFERENCE <- XML_TRUE
|
void |
setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
Exporter exporter)
Sets the following attributes to the corresponding values:
TYPE_ATTRIBUTE <- type.getName()
REFERENCE_ID <- id
EXPORTER_TYPE <- exporter.getClass().getName()
|
void |
setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
Exporter exporter,
boolean optional)
Sets the following attributes to the corresponding values:
TYPE_ATTRIBUTE <- type.getName()
REFERENCE_ID <- id
EXPORTER_TYPE <- exporter.getClass().getName()
If optional is true:
IS_OPTIONAL_REFERENCE <- XML_TRUE
|
void |
setTypeAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<?> type)
Sets the TYPE_ATTRIBUTE attribute of the given
XMLStreamWriter
to the given type |
void |
setValueAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String value)
Sets the VALUE_ATTRIBUTE attribute of the given
XMLStreamWriter to the given value |
void |
writeExImportNamespace(javax.xml.stream.XMLStreamWriter xsw) |
XPathContext |
xpathContext() |
java.lang.String |
xqueryNamespaces() |
public static final java.lang.String EXIMPORT_XML_NAMESPACE
public static final java.lang.String EXIMPORT_XML_NAMESPACE_PREFIX
public static final java.lang.String DOCUMENT_ROOT_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_USER_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_NAME_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_DESCRIPTION_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_DATE_ELEMENT
public static final java.lang.String DOCUMENT_DATA_ELEMENT
public static final java.lang.String XML_TRUE
public static final java.lang.String VALUE_ATTRIBUTE
public static final java.lang.String TYPE_ATTRIBUTE
public static final java.lang.String IS_NULL_ATTRIBUTE
public static final java.lang.String IS_ENCLOSED_ATTRIBUTE
public static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String IS_COLLECTION_ATTRIBUTE
public static final java.lang.String PROPERTY_TYPE
public static final java.lang.String EXPORTER_TYPE
public static final java.lang.String REFERENCE_ID
public static final java.lang.String IS_OPTIONAL_REFERENCE
public static final java.lang.String COLLECTION_VALUE_ELEMENT
public static final java.lang.String EXPORTED_ITEM_ELEMENT_NAME
public static final java.lang.String EXPORTED_PROPERTY_ELEMENT_NAME
public static final java.lang.String EXPORTER_BASE_ELEMENT
public static final java.lang.String DOCUMENT_HEAD_VERSION_ELEMENT
public static java.util.Map<java.lang.String,java.lang.String> namespaceMap
public ExImportHelperService(ExImportIdService idService)
public java.lang.String getIdFor(java.lang.Object object)
public void setAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String name,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
xsw - The XMLStreamWriter holding the attributename - The name of the attributevalue - The value of the attributejavax.xml.stream.XMLStreamExceptionpublic void addIdAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String entityId)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterxsw - The XMLStreamWriter holding the xml:id
attributeentityId - The ID to addjavax.xml.stream.XMLStreamExceptionpublic java.lang.String getIdAttribute(Element el)
Elementel - The Element holding the attributeElementpublic void setIsNullAttribute(javax.xml.stream.XMLStreamWriter xsw)
throws javax.xml.stream.XMLStreamException
XMLStreamWriter to XML_TRUExsw - The XMLStreamWriter to set the attribute onjavax.xml.stream.XMLStreamExceptionpublic void setValueAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
XMLStreamWriter to the given valuexsw - The XMLStreamWriter to set the attribute onvalue - The value to setjavax.xml.stream.XMLStreamExceptionpublic void setTypeAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<?> type)
throws javax.xml.stream.XMLStreamException
XMLStreamWriter
to the given typexsw - The XMLStreamWriter to set the attribute ontype - The type to setjavax.xml.stream.XMLStreamExceptionpublic void setIsCollectionAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<?> propertyType)
throws javax.xml.stream.XMLStreamException
XMLStreamWriter to XML_TRUE and the PROPERTY_TYPE to
propertyType.getName()xsw - The XMLStreamWriter to set the attributes onpropertyType - The type to setjavax.xml.stream.XMLStreamExceptionpublic void setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
Exporter exporter)
throws javax.xml.stream.XMLStreamException
xsw - The XMLStreamWriter to set the attributes onid - The ID to set REFERENCE_ID toexporter - The Exporter to set EXPORTER_TYPE tojavax.xml.stream.XMLStreamExceptionpublic void setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
Exporter exporter,
boolean optional)
throws javax.xml.stream.XMLStreamException
xsw - The XMLStreamWriter to set the attributes onid - The ID to set REFERENCE_ID toexporter - The Exporter to set EXPORTER_TYPE tooptional - Whether to set IS_OPTIONAL_REFERENCE or notjavax.xml.stream.XMLStreamExceptionpublic void setReferenceAttributes(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String id,
java.lang.Class<?> exporterType,
boolean optional)
throws javax.xml.stream.XMLStreamException
xsw - The XMLStreamWriter to set the attributes onid - The ID to set REFERENCE_ID toexporterType - The type to set EXPORTER_TYPE tooptional - Whether to set IS_OPTIONAL_REFERENCE or notjavax.xml.stream.XMLStreamExceptionpublic void setExporterType(javax.xml.stream.XMLStreamWriter xsw,
Exporter exporter)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterxsw - The XMLStreamWriter to set the attribute onexporter - The Exporter to set the EXPORTER_TYPE
attribute tojavax.xml.stream.XMLStreamExceptionpublic void setExporterType(javax.xml.stream.XMLStreamWriter xsw,
java.lang.Class<? extends Exporter> type)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterxsw - The XMLStreamWriter to set the attribute ontype - The type to set the EXPORTER_TYPE attribute tojavax.xml.stream.XMLStreamExceptionpublic void setEnclosedAttributes(javax.xml.stream.XMLStreamWriter xsw,
Exporter exporter)
throws javax.xml.stream.XMLStreamException
XMLStreamWriters EXPORTER_TYPE and
IS_ENCLOSED_ATTRIBUTE attributesxsw - The XMLStreamWriter to set the attributes onexporter - The Exporter to set the EXPORTER_TYPE tojavax.xml.stream.XMLStreamExceptionpublic void setNameAttribute(javax.xml.stream.XMLStreamWriter xsw,
java.lang.String name)
throws javax.xml.stream.XMLStreamException
xsw - The XMLStreamWriter to set the attribute onname - The name to set the NAME_ATTRIBUTE tojavax.xml.stream.XMLStreamExceptionpublic void addNamespaces(javax.xml.stream.XMLStreamWriter xsw)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void writeExImportNamespace(javax.xml.stream.XMLStreamWriter xsw)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic java.util.Map getNamespaceMap()
public java.lang.String xqueryNamespaces()
public XPathContext xpathContext()
public java.util.Set<java.lang.Class<?>> getAllowedReferenceTypesFor(java.lang.Object node,
java.util.List<Exporter> exporters)