Class MapperProvider


  • public class MapperProvider
    extends java.lang.Object
    The main class of the mapper library. It loads all the valid IMappingFormats and gets information from them.
    • Constructor Summary

      Constructors 
      Constructor Description
      MapperProvider()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> fetchFromLocalOrRemote​(java.lang.String location)
      Gets a resource and parses it into a List of Strings.
      static IMappingFormat getMapper​(java.util.List<java.lang.String> data)
      Loads all valid parsers available in the classpath (via the Java Service API), attempts to load the resource at given location and to populate a mapper with its data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapperProvider

        public MapperProvider()
    • Method Detail

      • getMapper

        public static IMappingFormat getMapper​(java.util.List<java.lang.String> data)
        Loads all valid parsers available in the classpath (via the Java Service API), attempts to load the resource at given location and to populate a mapper with its data.
        Parameters:
        data - the file as a list of strings
        Returns:
        a IMappingFormat (populating it is left to the user)
      • fetchFromLocalOrRemote

        public static java.util.List<java.lang.String> fetchFromLocalOrRemote​(java.lang.String location)
        Gets a resource and parses it into a List of Strings.
        Parameters:
        location - either a URL or a local path
        Returns:
        a List containing the lines of the resource
        Throws:
        InvalidResourceException - if provided an invalid resource