Overview |
Package |
Class |
Tree |
Deprecated |
Index |
Help |
|
|
PREV CLASS
NEXT CLASS |
FRAMES
NO FRAMES
|
SUMMARY: NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD |
net.sf.jga.parser
Class GenericParser
java.lang.Object
net.sf.jga.parser.FunctorParser
net.sf.jga.parser.GenericParser
- All Implemented Interfaces:
- FunctorParserConstants
public class GenericParser
- extends FunctorParser
FunctorParser that add runtime type-safe entry points (to the degree that
runtime type-safe is not an oxymoron). This class maps between the inherently
typeunsafe baseclass and the generic functors that are returned: if the
returned functor does not return the correct type, then a ClassCastException
will be thrown by the entry point.
Copyright © 2004 David A. Hall
- Author:
- David A. Hall
Fields inherited from interface net.sf.jga.parser.FunctorParserConstants |
CHARACTER_LITERAL, DECIMAL_LITERAL, DEFAULT, DIGIT, EOF, EXPONENT, FALSE, FLOATING_POINT_LITERAL, HEX_LITERAL, IDENTIFIER, INTEGER_LITERAL, LETTER, LPAREN, NEW, NULL, OCTAL_LITERAL, STRING_LITERAL, tokenImage, TRUE |
Method Summary |
static GenericParser |
getInstance()
|
<T1,T2,R> BinaryFunctor<T1,T2,R> |
|
parseBinary(java.lang.String str,
java.lang.Class<T1> arg1Type,
java.lang.Class<T2> arg2Type,
java.lang.Class<R> returnType)
Parses the string to create a BinaryFunctor that takes arguments of the
given types. |
|
parseGenerator(java.lang.String str,
java.lang.Class<R> returnType)
Parses the string to create a Generator. |
|
parseUnary(java.lang.String str,
java.lang.Class<T> argType,
java.lang.Class<T> returnType)
Parses the string to create a UnaryFunctor that takes an argument of the
given type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericParser
public GenericParser()
GenericParser
public GenericParser(java.io.InputStream is)
GenericParser
public GenericParser(java.io.Reader reader)
GenericParser
public GenericParser(FunctorParserTokenManager tm)
getInstance
public static GenericParser getInstance()
parseGenerator
public <R> Generator<R> parseGenerator(java.lang.String str,
java.lang.Class<R> returnType)
throws java.lang.ClassCastException,
- Parses the string to create a Generator.
- Throws:
java.lang.ClassCastException
ParseException
parseUnary
public <T,R> UnaryFunctor<T,R> parseUnary(java.lang.String str,
java.lang.Class<T> argType,
java.lang.Class<T> returnType)
throws java.lang.ClassCastException,
ParseException
- Parses the string to create a UnaryFunctor that takes an argument of the
given type.
- Throws:
java.lang.ClassCastException
ParseException
parseBinary
public <T1,T2,R> BinaryFunctor<T1,T2,R> parseBinary(java.lang.String str,
java.lang.Class<T1> arg1Type,
java.lang.Class<T2> arg2Type,
java.lang.Class<R> returnType)
throws java.lang.ClassCastException,
ParseException
- Parses the string to create a BinaryFunctor that takes arguments of the
given types.
- Throws:
java.lang.ClassCastException
ParseException
Overview |
Package |
Class |
Tree |
Deprecated |
Index |
Help |
|
|
PREV CLASS
NEXT CLASS |
FRAMES
NO FRAMES
|
SUMMARY: NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2002-2004 David A. Hall. All Rights Reserved.