Class StoreProvider.Peek
java.lang.Object
org.apache.sis.internal.storage.wkt.FirstKeywordPeek
org.apache.sis.internal.storage.wkt.StoreProvider.Peek
- Enclosing class:
StoreProvider
The object to use for verifying if the first keyword is a WKT one.
This object contains the set of recognized WKT keywords.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StoreProvider.Peek
The unique instance.The set of WKT keywords.(package private) static final int
Length of the shortest keyword.Fields inherited from class org.apache.sis.internal.storage.wkt.FirstKeywordPeek
ACCEPT, COMMENT, IGNORE, maxLength, READ_AHEAD_LIMIT, REJECT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProbeResult
forKeyword
(char[] keyword, int length) Returns the value to be returned byStoreProvider.probeContent(StorageConnector)
for the given WKT keyword.protected boolean
isPostKeyword
(int c) Returnstrue
if the given first non-white character after the keyword is one of the expected characters.keywords()
Returns the keywords for test purpose.Methods inherited from class org.apache.sis.internal.storage.wkt.FirstKeywordPeek
getAuxiliaryPath, isKeywordChar, probeContent, probeContent
-
Field Details
-
INSTANCE
The unique instance. -
MIN_LENGTH
static final int MIN_LENGTHLength of the shortest keyword.- See Also:
-
keywords
The set of WKT keywords.
-
-
Constructor Details
-
Peek
private Peek()Creates the unique instance.
-
-
Method Details
-
keywords
Returns the keywords for test purpose. -
isPostKeyword
protected boolean isPostKeyword(int c) Returnstrue
if the given first non-white character after the keyword is one of the expected characters.- Specified by:
isPostKeyword
in classFirstKeywordPeek
- 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
Returns the value to be returned byStoreProvider.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 classFirstKeywordPeek
- Parameters:
keyword
- the first keyword found in the input. May benull
iflength
is zero.length
- number of valid characters inkeyword
.- Returns:
ProbeResult.SUPPORTED
if the given storage seems to be readable.
-