Class MetadataDiscoveryUtil
- java.lang.Object
-
- org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.MetadataDiscoveryUtil
-
public class MetadataDiscoveryUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description MetadataDiscoveryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataFormatgetMetadataFormatFromXML(String xml)Unmarshals XML content to a MetadataFormat objectstatic org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.NamespaceCategoriesgetNamespaceCategoryFromListJsonObject(List<String> namespacesJson)Converts a list of JSON strings representing namespaces into a NamespaceCategories object.static StringgetXMLFromMetadataFormat(org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataFormat metadataFormat)Marshals a MetadataFormat object to XML string.
-
-
-
Method Detail
-
getMetadataFormatFromXML
public static org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataFormat getMetadataFormatFromXML(String xml) throws JAXBException
Unmarshals XML content to a MetadataFormat object- Parameters:
xml- the XML content to unmarshal- Returns:
- the MetadataFormat object
- Throws:
JAXBException- if an error occurs during unmarshalling
-
getXMLFromMetadataFormat
public static String getXMLFromMetadataFormat(org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataFormat metadataFormat) throws JAXBException
Marshals a MetadataFormat object to XML string.- Parameters:
metadataFormat- the metadata format object to marshal- Returns:
- the XML string representation
- Throws:
JAXBException- if an error occurs during marshalling
-
getNamespaceCategoryFromListJsonObject
public static org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.NamespaceCategories getNamespaceCategoryFromListJsonObject(List<String> namespacesJson) throws Exception
Converts a list of JSON strings representing namespaces into a NamespaceCategories object. Each element in the list can be either: - A single JSON object representing one NamespaceCategory - A JSON array containing multiple NamespaceCategory objects- Parameters:
namespacesJson- the list of JSON strings- Returns:
- the NamespaceCategories object
- Throws:
Exception- if an error occurs during conversion
-
-