Class MetadataDiscoveryUtil


  • public class MetadataDiscoveryUtil
    extends Object
    • Constructor Detail

      • MetadataDiscoveryUtil

        public MetadataDiscoveryUtil()
    • 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