public final class DslUtils extends Object
Modifier and Type | Method and Description |
---|---|
static LexerParser |
identify(LexerParser parentParser,
Collection<Lexer> candidates,
boolean safeMode)
Identifies the lexer to use between provided candidates to handle the following source part.
|
static boolean |
isTypeExcluded(Set<Class<?>> excludedTypes,
Class<?> resolvedType)
Tells if type or its hierarchy is excluded.
|
static void |
matchEnd(LexerParser parser)
Calls
matchEnd(LexerParser) without safe mode. |
static boolean |
matchEnd(LexerParser parser,
boolean safeMode)
Identifies the lexer to use between provided candidates to handle the following source part.
|
static int |
skipSpaces(AdvancedReader source,
boolean clearThem)
Skips all space chars (\s, \t, \n, \r, \f) util a non-space is found.
|
static String |
skipUnusefulSpaces(String s)
Trims input string and replaces multiple space chars (\s, \t, \n, \r, \f) with only one.
|
public static final String skipUnusefulSpaces(String s)
public static int skipSpaces(AdvancedReader source, boolean clearThem) throws IOException
clearThem
- if true read spaces will not be "unreadable"IOException
public static boolean isTypeExcluded(Set<Class<?>> excludedTypes, Class<?> resolvedType)
public static LexerParser identify(LexerParser parentParser, Collection<Lexer> candidates, boolean safeMode) throws IOException, DslException
LexerBlockResolver.identify(LexerParser, boolean)
instead.parentParser
- Parent parsercandidates
- All candidate lexerssafeMode
- If false, an exception will be thrown if no lexer is identifiedIOException
DslException
public static void matchEnd(LexerParser parser) throws IOException, DslException
matchEnd(LexerParser)
without safe mode.IOException
DslException
public static boolean matchEnd(LexerParser parser, boolean safeMode) throws IOException, DslException
parser
- Parent parsersafeMode
- If false, an exception will be thrown if end does not matchIOException
DslException