public final class ReservedWordsBuilder
extends java.lang.Object
ReservedWords implementation from explicit
mappings and from line-delimited files that contain reserved words.| Constructor and Description |
|---|
ReservedWordsBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ReservedWords |
build()
Builds the reserved words.
|
ReservedWordsBuilder |
loadCaseInsensitiveWords(java.net.URL location)
Load a list of case-insensitive, line-delimited reserved words from a file.
|
ReservedWordsBuilder |
loadCaseInsensitiveWords(java.net.URL location,
java.util.function.Function<java.lang.String,java.lang.String> escaper)
Load a list of case-insensitive, line-delimited reserved words from a file.
|
ReservedWordsBuilder |
loadWords(java.net.URL location)
Load a list of case-sensitive, line-delimited reserved words from a file.
|
ReservedWordsBuilder |
loadWords(java.net.URL location,
java.util.function.Function<java.lang.String,java.lang.String> escaper)
Load a list of case-sensitive, line-delimited reserved words from a file.
|
ReservedWordsBuilder |
put(java.lang.String reservedWord,
java.lang.String conversion)
Add a new reserved words.
|
public ReservedWords build()
public ReservedWordsBuilder put(java.lang.String reservedWord, java.lang.String conversion)
reservedWord - Reserved word to convert.conversion - Word to convert to.public ReservedWordsBuilder loadWords(java.net.URL location)
This method will escape words by prefixing them with "_". Use
loadWords(URL, Function) to customize how words are escaped.
Blank lines and lines that start with # are ignored.
location - URL of the file to load.public ReservedWordsBuilder loadWords(java.net.URL location, java.util.function.Function<java.lang.String,java.lang.String> escaper)
Blank lines and lines that start with # are ignored.
location - URL of the file to load.escaper - Function used to escape reserved words.public ReservedWordsBuilder loadCaseInsensitiveWords(java.net.URL location)
This method will escape words by prefixing them with "_". Use
loadCaseInsensitiveWords(URL, Function) to customize how words
are escaped.
Blank lines and lines that start with # are ignored.
location - URL of the file to load.public ReservedWordsBuilder loadCaseInsensitiveWords(java.net.URL location, java.util.function.Function<java.lang.String,java.lang.String> escaper)
Blank lines and lines that start with # are ignored.
location - URL of the file to load.escaper - Function used to escape reserved words.