Package ftbsc.lll.mapper
Class MapperProvider
- java.lang.Object
-
- ftbsc.lll.mapper.MapperProvider
-
public class MapperProvider extends java.lang.Object
The main class of the mapper library. It loads all the validIMappingFormat
s 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 aList
ofString
s.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.
-
-
-
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 aList
ofString
s.- 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
-
-