com.twitter.common.args
Interface Parser<T>

Type Parameters:
T - The base class this parser can parse all subtypes of.
All Known Implementing Classes:
AmountParser, BooleanParser, ByteParser, CharacterParser, ClassParser, DateParser, DoubleParser, DurationParser, EnumParser, FileParser, FloatParser, InetSocketAddressParser, IntegerParser, ListParser, LongParser, MapParser, NonParameterizedTypeParser, NumberParser, PairParser, RangeParser, SetParser, ShortParser, StringParser, TimeDurationParser, TypeParameterizedParser, UnitParser, URIParser, URLParser

public interface Parser<T>

An interface to a command line argument parser.


Method Summary
 T parse(ParserOracle parserOracle, Type type, String raw)
          Parses strings as arguments of a given subtype of T.
 

Method Detail

parse

T parse(ParserOracle parserOracle,
        Type type,
        String raw)
        throws IllegalArgumentException
Parses strings as arguments of a given subtype of T.

Parameters:
parserOracle - The registered parserOracle for delegation.
type - The target type of the parsed argument.
raw - The raw value of the argument.
Returns:
A value of the given type parsed from the raw value.
Throws:
IllegalArgumentException - if the raw value could not be parsed into a value of the given type.