| java.lang.Object net.sf.jga.parser.GenericParser
GenericParser | public class GenericParser implements IParser(Code) | | FunctorParser wrapper that adds runtime type-safe entry points to the non-generified
base parser. 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-2005 David A. Hall
author: David A. Hall |
Method Summary | |
public void | bindThis(Object thisBinding) | public void | deportClass(String alias) | protected Object | getBoundObject() | public java.lang.reflect.Field | getImportedField(String name) | public java.lang.reflect.Method[] | getImportedMethods(String name) | public static synchronized GenericParser | getInstance() Returns a globally accessible default instance of a GenericParser. | public Class | getReturnType() Returns the type of object returned by the last functor parsed. | public void | importClass(Class clasz) | public void | importClass(String alias, Class clasz) | public void | importField(Class clasz, String name) | public void | importField(java.lang.reflect.Field field) | public void | importMethod(Class clasz, String name) | public void | importMethod(java.lang.reflect.Method meth) | public void | importMethod(String name, java.lang.reflect.Method meth) | public void | importStatics(Class clasz) | public boolean | isUndecoratedDecimal() | public static Generator<R> | parse(String str, Class<R> returnType) Parses the string to create a Generator. | public static UnaryFunctor<T, R> | parse(String str, Class<T> argType, Class<R> returnType) Parses the string to create a UnaryFunctor that takes an argument of the
given type. | public static BinaryFunctor<T1, T2, R> | parse(String str, Class<T1> arg1Type, Class<T2> arg2Type, Class<R> returnType) Parses the string to create a BinaryFunctor that takes arguments of the
given types. | public BinaryFunctor<T1, T2, R> | parseBinary(String str, Class<T1> arg1Type, Class<T2> arg2Type, Class<R> returnType) Parses the string to create a BinaryFunctor that takes arguments of the
given types. | public BinaryFunctor | parseBinary(String str, Class arg1Type, Class arg2Type) Parses the string to create a BinaryFunctor that takes arguments of the
given types. | public Generator<R> | parseGenerator(String str, Class<R> returnType) Parses the string to create a Generator. | public Generator | parseGenerator(String str) Parses the string to create a Generator. | public UnaryFunctor<T, R> | parseUnary(String str, Class<T> argType, Class<R> returnType) Parses the string to create a UnaryFunctor that takes an argument of the
given type. | public UnaryFunctor | parseUnary(String str, Class argType) Parses the string to create a UnaryFunctor that takes an argument of the
given type. | public void | setUndecoratedDecimal(boolean flag) |
GenericParser | public GenericParser()(Code) | | |
getInstance | public static synchronized GenericParser getInstance()(Code) | | Returns a globally accessible default instance of a GenericParser.
|
getReturnType | public Class getReturnType()(Code) | | Returns the type of object returned by the last functor parsed.
throws: IllegalStateException - if the parser has not been used or if parsing the last functor resulted in an exception being thrown. |
importStatics | public void importStatics(Class clasz)(Code) | | |
isUndecoratedDecimal | public boolean isUndecoratedDecimal()(Code) | | |
parseBinary | public BinaryFunctor parseBinary(String str, Class arg1Type, Class arg2Type) throws ParseException(Code) | | Parses the string to create a BinaryFunctor that takes arguments of the
given types.
|
parseGenerator | public Generator parseGenerator(String str) throws ParseException(Code) | | Parses the string to create a Generator.
|
parseUnary | public UnaryFunctor parseUnary(String str, Class argType) throws ParseException(Code) | | Parses the string to create a UnaryFunctor that takes an argument of the
given type.
|
setUndecoratedDecimal | public void setUndecoratedDecimal(boolean flag)(Code) | | |
|
|