public class QueryConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logger |
static String |
XMLNS_PATH_CCP |
static String |
XMLNS_PATH_COMMON |
static String |
XMLNS_PATH_OSSE |
| Modifier and Type | Method and Description |
|---|---|
static QueryResult |
ccpXmlToQueryResult(String xml)
Deserialize a CCP query result from XML.
|
static Error |
convertCcpErrorToCommonError(Error ccpError)
Transforms a CCP Error to a common Error.
|
static Query |
convertCcpQueryToCommonQuery(Query ccpQuery)
Transforms a CCP Query to a common Query.
|
static View |
convertCcpViewToCommonView(View ccpView)
Transforms a CCP View to a common View.
|
static Error |
convertCommonErrorToCcpError(Error commonError)
Transforms a Common Error to a CCP Error.
|
static Error |
convertCommonErrorToOsseError(Error commonError)
Transforms a common Error to an OSSE Error.
|
static QueryResultStatistic |
convertCommonQrsToOsseQrs(QueryResultStatistic commonQueryResultStatistic)
Transforms a common QueryResultStatistic to an OSSE QueryResultStatistic.
|
static Query |
convertCommonQueryToCcpQuery(Query commonQuery)
Transforms a Common Query to a CCP Query.
|
static Query |
convertCommonQueryToOsseQuery(Query commonQuery)
Transforms a common Query to an OSSE Query.
|
static View |
convertCommonViewToCcpView(View commonView)
Transforms a Common View to a CCP View.
|
static View |
convertCommonViewToOsseView(View commonView)
Transforms a common View to an OSSE View.
|
static Error |
convertOsseErrorToCommonError(Error osseError)
Transforms an OSSE Error to a common Error.
|
static QueryResultStatistic |
convertOsseQueryResultStatisticToCommonQueryResult(QueryResultStatistic osseQueryResultStatistic)
Transforms an OSSE QueryResultStatistic to a common QueryResultStatistic.
|
static Query |
convertOsseQueryToCommonQuery(Query osseQuery)
Transforms an OSSE Query to a common Query.
|
static View |
convertOsseViewToCommonView(View osseView)
Transforms an OSSE View to a common View.
|
static Query |
insertRootGroup(Query oldQuery)
Insert an "AND" conjunction group as first child of the Where - if there is no "AND" or "OR"
yet.
|
static <T> String |
marshal(T object,
JAXBContext context)
Marshal an object to xml.
|
static QueryResult |
osseXmlToQueryResult(String xml)
Deserialize an OSSE query result from XML.
|
static String |
queryToXml(Query query)
Serialize a query to XML.
|
static Query |
removeAttributesFromQuery(Query query,
List<String> attributes)
Remove any given attribute from the query.
|
static View |
removeAttributesFromView(View view,
List<String> attributes)
Removes all provided attributes (and their parent nodes if necessary) from a view.
|
static void |
removeEmptyNodes(Node node)
Removes the empty nodes below a given node.
|
static Query |
substituteOperators(Query query)
Currently, Centraxx does not know of the "between" and "in" operators.
|
static <T> T |
unmarshal(String xml,
JAXBContext context,
Class<T> clazz)
Unmarshal an object from xml.
|
static String |
viewToXml(View view)
Serialize a view to XML.
|
static String |
viewToXml(View view) |
static Query |
xmlToQuery(String xml)
Deserialize a common query from XML.
|
static View |
xmlToView(String xml)
Deserialize a common view from XML.
|
public static final org.slf4j.Logger logger
public static final String XMLNS_PATH_COMMON
public static final String XMLNS_PATH_CCP
public static final String XMLNS_PATH_OSSE
public static <T> T unmarshal(String xml, JAXBContext context, Class<T> clazz) throws JAXBException
T - the target typexml - the source xml stringcontext - the jaxb contextclazz - the target classJAXBExceptionpublic static <T> String marshal(T object, JAXBContext context)
T - the type of the object to marshalobject - the object to marshalcontext - the jaxb context, which has to be initalized with the correct classpublic static Query convertCcpQueryToCommonQuery(Query ccpQuery) throws JAXBException
ccpQuery - the query in the ccp namespaceJAXBExceptionpublic static Query convertOsseQueryToCommonQuery(Query osseQuery) throws JAXBException
osseQuery - the query in the osse namespaceJAXBExceptionpublic static Query convertCommonQueryToCcpQuery(Query commonQuery) throws JAXBException
commonQuery - the query in the common namespaceJAXBExceptionpublic static Query convertCommonQueryToOsseQuery(Query commonQuery) throws JAXBException
commonQuery - the query in the common namespaceJAXBExceptionpublic static View convertCcpViewToCommonView(View ccpView) throws JAXBException
ccpView - the view in the ccp namespaceJAXBExceptionpublic static View convertOsseViewToCommonView(View osseView) throws JAXBException
osseView - the view in the osse namespaceJAXBExceptionpublic static View convertCommonViewToCcpView(View commonView) throws JAXBException
commonView - the view in the common namespaceJAXBExceptionpublic static View convertCommonViewToOsseView(View commonView) throws JAXBException
commonView - the view in the common namespaceJAXBExceptionpublic static Error convertCcpErrorToCommonError(Error ccpError) throws JAXBException
ccpError - the error in the ccp namespaceJAXBExceptionpublic static Error convertOsseErrorToCommonError(Error osseError) throws JAXBException
osseError - the error in the osse namespaceJAXBExceptionpublic static Error convertCommonErrorToCcpError(Error commonError) throws JAXBException
commonError - the error in the common namespaceJAXBExceptionpublic static Error convertCommonErrorToOsseError(Error commonError) throws JAXBException
commonError - the error in the common namespaceJAXBExceptionpublic static QueryResultStatistic convertOsseQueryResultStatisticToCommonQueryResult(QueryResultStatistic osseQueryResultStatistic) throws JAXBException
osseQueryResultStatistic - the QueryResultStatistic in the osse namespaceJAXBExceptionpublic static QueryResultStatistic convertCommonQrsToOsseQrs(QueryResultStatistic commonQueryResultStatistic) throws JAXBException
commonQueryResultStatistic - the QueryResultStatistic in the common namespaceJAXBExceptionpublic static String queryToXml(Query query) throws JAXBException
query - the queryJAXBExceptionpublic static Query xmlToQuery(String xml) throws JAXBException
xml - the query in XML representationJAXBExceptionpublic static String viewToXml(View view) throws JAXBException
view - the View to be serializedJAXBExceptionpublic static String viewToXml(View view) throws JAXBException
JAXBExceptionpublic static View xmlToView(String xml) throws JAXBException
xml - XML representation of the viewJAXBExceptionpublic static QueryResult ccpXmlToQueryResult(String xml) throws JAXBException
xml - XML representation of the query resultJAXBExceptionpublic static QueryResult osseXmlToQueryResult(String xml) throws JAXBException
xml - XML representation of the query resultJAXBExceptionpublic static Query insertRootGroup(Query oldQuery)
oldQuery - the query to modifypublic static Query substituteOperators(Query query)
query - the original querypublic static View removeAttributesFromView(View view, List<String> attributes)
view - the viewattributes - the attributes to removepublic static Query removeAttributesFromQuery(Query query, List<String> attributes)
query - the query in which the attributes shall be removedattributes - a list of attributes to removepublic static void removeEmptyNodes(Node node)
node - the rootnodeCopyright © 2021 Samply Community. All rights reserved.