Class StoreProvider.Peek

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

private static final class StoreProvider.Peek extends FirstKeywordPeek
The object to use for verifying if the first keyword is the expected one.
  • Field Details

  • Constructor Details

    • Peek

      private Peek()
      Creates a new instance.
  • Method Details

    • isKeywordChar

      protected int isKeywordChar(int c)
      Returns whether the given character is valid for the keyword. This implementation accepts '@' in addition of the alphanumeric characters accepted by the parent class.
      Overrides:
      isKeywordChar in class FirstKeywordPeek
      Parameters:
      c - the character to test.
      Returns:
      FirstKeywordPeek.ACCEPT if the given character should be accepted, FirstKeywordPeek.REJECT if the character is not valid for the keyword, or FirstKeywordPeek.IGNORE if the character should be accepted but not stored.
    • 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.