Class FileSchema

  • All Implemented Interfaces:
    Schema

    class FileSchema
    extends AbstractSchema
    Schema mapped onto a set of URLs / HTML tables. Each table in the schema is an HTML table on a URL.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File baseDirectory  
      private com.google.common.collect.ImmutableList<java.util.Map<java.lang.String,​java.lang.Object>> tables  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileSchema​(SchemaPlus parentSchema, java.lang.String name, java.io.File baseDirectory, java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> tables)
      Creates an HTML tables schema.
    • Field Detail

      • tables

        private final com.google.common.collect.ImmutableList<java.util.Map<java.lang.String,​java.lang.Object>> tables
      • baseDirectory

        private final java.io.File baseDirectory
    • Constructor Detail

      • FileSchema

        FileSchema​(SchemaPlus parentSchema,
                   java.lang.String name,
                   java.io.File baseDirectory,
                   java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> tables)
        Creates an HTML tables schema.
        Parameters:
        parentSchema - Parent schema
        name - Schema name
        baseDirectory - Base directory to look for relative files, or null
        tables - List containing HTML table identifiers
    • Method Detail

      • trim

        private static java.lang.String trim​(java.lang.String s,
                                             java.lang.String suffix)
        Looks for a suffix on a string and returns either the string with the suffix removed or the original string.
      • trimOrNull

        private static java.lang.String trimOrNull​(java.lang.String s,
                                                   java.lang.String suffix)
        Looks for a suffix on a string and returns either the string with the suffix removed or null.
      • addTable

        private boolean addTable​(com.google.common.collect.ImmutableMap.Builder<java.lang.String,​Table> builder,
                                 java.util.Map<java.lang.String,​java.lang.Object> tableDef)
                          throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • addTable

        private boolean addTable​(com.google.common.collect.ImmutableMap.Builder<java.lang.String,​Table> builder,
                                 Source source,
                                 java.lang.String tableName,
                                 java.util.Map<java.lang.String,​java.lang.Object> tableDef)