Class StoreProvider.Peek

java.lang.Object
org.apache.sis.internal.storage.wkt.FirstKeywordPeek
org.apache.sis.internal.storage.wkt.StoreProvider.Peek
Enclosing class:
StoreProvider

static final class StoreProvider.Peek extends FirstKeywordPeek
The object to use for verifying if the first keyword is a WKT one. This object contains the set of recognized WKT keywords.
  • Field Details

    • INSTANCE

      static final StoreProvider.Peek INSTANCE
      The unique instance.
    • MIN_LENGTH

      static final int MIN_LENGTH
      Length of the shortest keyword.
      See Also:
    • keywords

      private final Set<String> keywords
      The set of WKT keywords.
  • Constructor Details

    • Peek

      private Peek()
      Creates the unique instance.
  • Method Details

    • keywords

      final Set<String> keywords()
      Returns the keywords for test purpose.
    • isPostKeyword

      protected boolean isPostKeyword(int c)
      Returns true if the given first non-white character after the keyword is one of the expected characters.
      Specified by:
      isPostKeyword in class FirstKeywordPeek
      Parameters:
      c - the first non-white character after the keyword, or -1 if we reached the end of stream.
      Returns:
      true if the given character is one of the expected post-keyword characters.
    • forKeyword

      protected ProbeResult forKeyword(char[] keyword, int length)
      Returns the value to be returned by StoreProvider.probeContent(StorageConnector) for the given WKT keyword. This method changes the case to match the one used in the keywords map, then verify if the keyword that we found is one of the known WKT keywords. Keywords with the "CRS" suffix are WKT 2 while keywords with the "CS" suffix are WKT 1.
      Specified by:
      forKeyword in class FirstKeywordPeek
      Parameters:
      keyword - the first keyword found in the input. May be null if length is zero.
      length - number of valid characters in keyword.
      Returns:
      ProbeResult.SUPPORTED if the given storage seems to be readable.