org.hyphenType.lexerparser
Class LexerParser<T extends Options<?>>
java.lang.Object
org.hyphenType.lexerparser.LexerParser<T>
- Type Parameters:
T
-
public class LexerParser<T extends Options<?>>
- extends Object
A LexerParser is an object that can parse an array of strings and create a
list of tokens from it. To do so, the LexerParser's constructor performs a
deep analysis on the options interface.
Therefore, invoking the LexerParser
constructor can also be used to validate the options interface.
- Author:
- Aurelio Akira M. Matsui
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LexerParser
public LexerParser(Class<T> optionsInterfaceClass)
throws InvalidOptionsInterfaceException
- Parameters:
optionsInterfaceClass
-
- Throws:
InvalidOptionsInterfaceException
LexerParser
public LexerParser(Class<T> optionsInterfaceClass,
boolean loadFromResourceBundle)
throws InvalidOptionsInterfaceException
- Parameters:
optionsInterfaceClass
- loadFromResourceBundle
-
- Throws:
InvalidOptionsInterfaceException
getArgsObject
public final ArgumentsObject getArgsObject()
- Returns:
- TODO
getOptionsInterface
public final Class<T> getOptionsInterface()
- Returns:
- TODO
lexArguments
public final List<LexToken> lexArguments(String... arguments)
- Classifies arguments and creates tokens based on it.
LexOption
(as "version" in "-version")
LexOptionValue
(as "12" in "-x=12")
LexOptionMapValue
(as "a=b" in "-xa=b")
LexUnknown
(as "aa" and "bb" in "-x aa bb")
- Parameters:
arguments
- The arguments to be converted into lexer tokens.
- Returns:
- A list of tokens in the order they appear in the arguments.
getParsedOptions
public final List<StructureOption> getParsedOptions()
- Returns:
- TODO
getSimpleArguments
public final List<StructureSimpleArgument> getSimpleArguments()
- Returns:
- TODO
searchOption
public final StructureOption searchOption(String name)
- Parameters:
name
- TODO
- Returns:
- TODO
searchOptionPrefixing
public final String searchOptionPrefixing(String name)
- Parameters:
name
- TODO
- Returns:
- TODO
searchArgument
public final StructureSimpleArgument searchArgument(String name)
- Parameters:
name
- TODO
- Returns:
- TODO
searchElement
public final StructureElement searchElement(Method method)
- Parameters:
method
- TODO
- Returns:
- TODO
Copyright © 2013. All Rights Reserved.