Package net.datenwerke.eximport
Class ExImportHelperService
java.lang.Object
net.datenwerke.eximport.ExImportHelperService
Helper service used during im and export.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdAttribute(XMLStreamWriter xsw, String entityId) Adds an entityId to the attribute xml:id in the givenXMLStreamWritervoidgetAllowedReferenceTypesFor(Object node, List<Exporter> exporters) getIdAttribute(Element el) Returns the id attribute of the giveninvalid reference
ElementvoidsetAttribute(XMLStreamWriter xsw, String name, String value) Sets the attribute name to the given valuevoidsetEnclosedAttributes(XMLStreamWriter xsw, Exporter exporter) Sets theXMLStreamWriters EXPORTER_TYPE and IS_ENCLOSED_ATTRIBUTE attributesvoidsetExporterType(XMLStreamWriter xsw, Class<? extends Exporter> type) Sets the EXPORTER_TYPE attribute of the givenXMLStreamWritervoidsetExporterType(XMLStreamWriter xsw, Exporter exporter) Sets the EXPORTER_TYPE attribute of the givenXMLStreamWritervoidsetIsCollectionAttribute(XMLStreamWriter xsw, Class<?> propertyType) Sets the IS_COLLECTION_ATTRIBUTE attribute of the givenXMLStreamWriterto XML_TRUE and the PROPERTY_TYPE to propertyType.getName()voidSets the IS_NULL_ATTRIBUTE attribute of the givenXMLStreamWriterto XML_TRUEvoidsetNameAttribute(XMLStreamWriter xsw, String name) Sets the NAME_ATTRIBUTE to the given namevoidsetReferenceAttributes(XMLStreamWriter xsw, String id, 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_TRUEvoidsetReferenceAttributes(XMLStreamWriter xsw, String id, Exporter exporter) Sets the following attributes to the corresponding values: TYPE_ATTRIBUTE <- type.getName() REFERENCE_ID <- id EXPORTER_TYPE <- exporter.getClass().getName()voidsetReferenceAttributes(XMLStreamWriter xsw, 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_TRUEvoidsetTypeAttribute(XMLStreamWriter xsw, Class<?> type) Sets the TYPE_ATTRIBUTE attribute of the givenXMLStreamWriterto the given typevoidsetValueAttribute(XMLStreamWriter xsw, String value) Sets the VALUE_ATTRIBUTE attribute of the givenXMLStreamWriterto the given valuevoidXPathContext
-
Field Details
-
EXIMPORT_XML_NAMESPACE
- See Also:
-
EXIMPORT_XML_NAMESPACE_PREFIX
- See Also:
-
DOCUMENT_ROOT_ELEMENT
- See Also:
-
DOCUMENT_HEAD_ELEMENT
- See Also:
-
DOCUMENT_HEAD_USER_ELEMENT
- See Also:
-
DOCUMENT_HEAD_NAME_ELEMENT
- See Also:
-
DOCUMENT_HEAD_DESCRIPTION_ELEMENT
- See Also:
-
DOCUMENT_HEAD_DATE_ELEMENT
- See Also:
-
DOCUMENT_DATA_ELEMENT
- See Also:
-
XML_TRUE
- See Also:
-
VALUE_ATTRIBUTE
- See Also:
-
TYPE_ATTRIBUTE
- See Also:
-
IS_NULL_ATTRIBUTE
- See Also:
-
IS_ENCLOSED_ATTRIBUTE
- See Also:
-
NAME_ATTRIBUTE
- See Also:
-
IS_COLLECTION_ATTRIBUTE
- See Also:
-
PROPERTY_TYPE
- See Also:
-
EXPORTER_TYPE
- See Also:
-
REFERENCE_ID
- See Also:
-
IS_OPTIONAL_REFERENCE
- See Also:
-
COLLECTION_VALUE_ELEMENT
- See Also:
-
EXPORTED_ITEM_ELEMENT_NAME
- See Also:
-
EXPORTED_PROPERTY_ELEMENT_NAME
- See Also:
-
EXPORTER_BASE_ELEMENT
- See Also:
-
DOCUMENT_HEAD_VERSION_ELEMENT
- See Also:
-
namespaceMap
-
-
Constructor Details
-
ExImportHelperService
-
-
Method Details
-
getIdFor
-
setAttribute
Sets the attribute name to the given value- Parameters:
xsw- TheXMLStreamWriterholding the attributename- The name of the attributevalue- The value of the attribute- Throws:
XMLStreamException
-
addIdAttribute
Adds an entityId to the attribute xml:id in the givenXMLStreamWriter- Parameters:
xsw- TheXMLStreamWriterholding the xml:id attributeentityId- The ID to add- Throws:
XMLStreamException
-
getIdAttribute
Returns the id attribute of the giveninvalid reference
Element- Parameters:
el- Theholding the attributeinvalid reference
Element- Returns:
- The id attribute of the given
invalid reference
Element
-
setIsNullAttribute
Sets the IS_NULL_ATTRIBUTE attribute of the givenXMLStreamWriterto XML_TRUE- Parameters:
xsw- TheXMLStreamWriterto set the attribute on- Throws:
XMLStreamException
-
setValueAttribute
Sets the VALUE_ATTRIBUTE attribute of the givenXMLStreamWriterto the given value- Parameters:
xsw- TheXMLStreamWriterto set the attribute onvalue- The value to set- Throws:
XMLStreamException
-
setTypeAttribute
Sets the TYPE_ATTRIBUTE attribute of the givenXMLStreamWriterto the given type- Parameters:
xsw- TheXMLStreamWriterto set the attribute ontype- The type to set- Throws:
XMLStreamException
-
setIsCollectionAttribute
public void setIsCollectionAttribute(XMLStreamWriter xsw, Class<?> propertyType) throws XMLStreamException Sets the IS_COLLECTION_ATTRIBUTE attribute of the givenXMLStreamWriterto XML_TRUE and the PROPERTY_TYPE to propertyType.getName()- Parameters:
xsw- TheXMLStreamWriterto set the attributes onpropertyType- The type to set- Throws:
XMLStreamException
-
setReferenceAttributes
public void setReferenceAttributes(XMLStreamWriter xsw, String id, Exporter exporter) throws XMLStreamException Sets the following attributes to the corresponding values:- TYPE_ATTRIBUTE <- type.getName()
- REFERENCE_ID <- id
- EXPORTER_TYPE <- exporter.getClass().getName()
- Parameters:
xsw- TheXMLStreamWriterto set the attributes onid- The ID to set REFERENCE_ID toexporter- TheExporterto set EXPORTER_TYPE to- Throws:
XMLStreamException
-
setReferenceAttributes
public void setReferenceAttributes(XMLStreamWriter xsw, String id, Exporter exporter, boolean optional) throws XMLStreamException Sets the following attributes to the corresponding values:- TYPE_ATTRIBUTE <- type.getName()
- REFERENCE_ID <- id
- EXPORTER_TYPE <- exporter.getClass().getName()
- IS_OPTIONAL_REFERENCE <- XML_TRUE
- Parameters:
xsw- TheXMLStreamWriterto set the attributes onid- The ID to set REFERENCE_ID toexporter- TheExporterto set EXPORTER_TYPE tooptional- Whether to set IS_OPTIONAL_REFERENCE or not- Throws:
XMLStreamException
-
setReferenceAttributes
public void setReferenceAttributes(XMLStreamWriter xsw, String id, Class<?> exporterType, boolean optional) throws XMLStreamException Sets the following attributes to the corresponding values:- TYPE_ATTRIBUTE <- type.getName()
- REFERENCE_ID <- id
- EXPORTER_TYPE <- exporterType.getName()
- IS_OPTIONAL_REFERENCE <- XML_TRUE
- Parameters:
xsw- TheXMLStreamWriterto 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 not- Throws:
XMLStreamException
-
setExporterType
Sets the EXPORTER_TYPE attribute of the givenXMLStreamWriter- Parameters:
xsw- TheXMLStreamWriterto set the attribute onexporter- TheExporterto set the EXPORTER_TYPE attribute to- Throws:
XMLStreamException
-
setExporterType
public void setExporterType(XMLStreamWriter xsw, Class<? extends Exporter> type) throws XMLStreamException Sets the EXPORTER_TYPE attribute of the givenXMLStreamWriter- Parameters:
xsw- TheXMLStreamWriterto set the attribute ontype- The type to set the EXPORTER_TYPE attribute to- Throws:
XMLStreamException
-
setEnclosedAttributes
Sets theXMLStreamWriters EXPORTER_TYPE and IS_ENCLOSED_ATTRIBUTE attributes- Parameters:
xsw- TheXMLStreamWriterto set the attributes onexporter- TheExporterto set the EXPORTER_TYPE to- Throws:
XMLStreamException
-
setNameAttribute
Sets the NAME_ATTRIBUTE to the given name- Parameters:
xsw- TheXMLStreamWriterto set the attribute onname- The name to set the NAME_ATTRIBUTE to- Throws:
XMLStreamException
-
addNamespaces
- Throws:
XMLStreamException
-
writeExImportNamespace
- Throws:
XMLStreamException
-
getNamespaceMap
-
xqueryNamespaces
-
xpathContext
public XPathContext xpathContext() -
getAllowedReferenceTypesFor
-