@PublicApi public class ParserOptions extends java.lang.Object
Parser behaves.| Modifier and Type | Class and Description |
|---|---|
static class |
ParserOptions.Builder |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_QUERY_TOKENS
An graphql hacking vector is to send nonsensical queries that burn lots of parsing CPU time and burn
memory representing a document that wont ever execute.
|
| Modifier and Type | Method and Description |
|---|---|
static ParserOptions |
getDefaultParserOptions()
By default the Parser will not capture ignored characters.
|
int |
getMaxTokens()
A graphql hacking vector is to send nonsensical queries that burn lots of parsing CPU time and burn
memory representing a document that won't ever execute.
|
ParsingListener |
getParsingListener() |
boolean |
isCaptureIgnoredChars()
Significant memory savings can be made if we do NOT capture ignored characters,
especially in SDL parsing.
|
boolean |
isCaptureLineComments()
Single-line
Comments do not have any semantic meaning in
GraphQL source documents, as such you may wish to ignore them. |
boolean |
isCaptureSourceLocation()
Memory savings can be made if we do NOT set
SourceLocations
on AST nodes, especially in SDL parsing. |
static ParserOptions.Builder |
newParserOptions() |
static void |
setDefaultParserOptions(ParserOptions options)
By default the Parser will not capture ignored characters.
|
ParserOptions |
transform(java.util.function.Consumer<ParserOptions.Builder> builderConsumer) |
public static final int MAX_QUERY_TOKENS
setDefaultParserOptions(ParserOptions) allows you to change this
JVM wide.public static ParserOptions getDefaultParserOptions()
IgnoredChar,
SourceLocationpublic static void setDefaultParserOptions(ParserOptions options)
options - - the new default JVM parser optionsIgnoredChar,
SourceLocationpublic boolean isCaptureIgnoredChars()
public boolean isCaptureSourceLocation()
SourceLocations
on AST nodes, especially in SDL parsing.SourceLocations should be captured as AST nodesSourceLocationpublic boolean isCaptureLineComments()
Comments do not have any semantic meaning in
GraphQL source documents, as such you may wish to ignore them.
This option does not ignore documentation Descriptions.
Comments should be captured as AST nodesSourceLocationpublic int getMaxTokens()
public ParsingListener getParsingListener()
public ParserOptions transform(java.util.function.Consumer<ParserOptions.Builder> builderConsumer)
public static ParserOptions.Builder newParserOptions()