| java.lang.Object net.sf.jga.parser.ParserContext
ParserContext | class ParserContext (Code) | | Configuration settings for a JFXGParser.
Copyright © 2005 David A. Hall
|
Method Summary | |
public void | addPromotionRule(Class fromType, Class toType, UnaryFunctor converter) Registers a type-coercion rule that will promote values of the from type to
values of the to type for use in expressions. | public void | bindThis(Object thisBinding) | ParserContext | copy() Returns a copy of this context. | public void | declareArgument(String argName, Class argType) Declares a named argument to the functor being built, and its type. | public void | deportClass(String alias) Removes information about the class imported under the given name. | public void | deportPackage(String pkgName) Removes information about the package imported under the given name. | protected Object | getBoundObject() | public Class | getImportedClass(String alias) | public Field | getImportedField(String name) Returns the imported field with the given name, or null if no such field has
been imported. | public Method[] | getImportedMethods(String name) | public UnaryFunctor | getPromotionRule(Class fromType, Class toType) Returns a type-coercion rule that will promote values of the from type to
values of the to type for use in expressions, if any such rule exists. | public Class | getTypeForName(String name) | public void | importClass(Class clasz) Imports the given class into the parser. | public void | importClass(String alias, Class clasz) Imports the given class into the parser under the given alias. | public void | importField(Class clasz, String name) Imports the given static member. | public void | importField(Field field) Imports the given static member. | public void | importMethod(Class clasz, String name) Imports the given static method(s). | public void | importMethod(Method meth) Imports a static method into the parser. | public void | importMethod(String name, Method meth) Imports a static method into the parser under the given name. | public void | importPackage(String pkgName) Imports all classes in the given package into the parser. | public void | importStatics(Class clasz) Imports all of the static public methods and members in the given class. | public boolean | isUndecoratedDecimal() When true, an undecorated number containing a
decimal, for example 1.50 is interpreted as a BigDecimal
literal. | public void | removePromotionRule(Class fromType, Class toType) Removes the type-coercion rule (if any) that would have promoted values of the
from type to values of the to type for use in expressions. | public void | setUndecoratedDecimal(boolean flag) Enables/Disables the interpretation of undecorated decimal literals
as BigDecimals. |
ParserContext | ParserContext()(Code) | | |
addPromotionRule | public void addPromotionRule(Class fromType, Class toType, UnaryFunctor converter)(Code) | | Registers a type-coercion rule that will promote values of the from type to
values of the to type for use in expressions.
|
bindThis | public void bindThis(Object thisBinding)(Code) | | Binds the object to which 'this' refers
|
declareArgument | public void declareArgument(String argName, Class argType)(Code) | | Declares a named argument to the functor being built, and its type.
|
deportClass | public void deportClass(String alias)(Code) | | Removes information about the class imported under the given name.
|
deportPackage | public void deportPackage(String pkgName)(Code) | | Removes information about the package imported under the given name.
|
getBoundObject | protected Object getBoundObject()(Code) | | Returns the current object to which 'this' refers
|
getImportedClass | public Class getImportedClass(String alias)(Code) | | Returns the class associated with the given alias
|
getImportedField | public Field getImportedField(String name)(Code) | | Returns the imported field with the given name, or null if no such field has
been imported.
|
getImportedMethods | public Method[] getImportedMethods(String name)(Code) | | Returns a list of methods with the given name
|
getPromotionRule | public UnaryFunctor getPromotionRule(Class fromType, Class toType)(Code) | | Returns a type-coercion rule that will promote values of the from type to
values of the to type for use in expressions, if any such rule exists.
Returns null if no such rule exists.
|
getTypeForName | public Class getTypeForName(String name)(Code) | | Returns the type of the named argument, or null if the name is unrecognized
|
importClass | public void importClass(Class clasz)(Code) | | Imports the given class into the parser. The class will not need to be
fully qualified for use in expressions. This will replace any existing
imported class that happens to have the same name.
|
importClass | public void importClass(String alias, Class clasz)(Code) | | Imports the given class into the parser under the given alias. The alias
may be used in place of the fully qualified name of the class hereafter.
This will replace any existing imported class associated with the alias.
|
importMethod | public void importMethod(Method meth)(Code) | | Imports a static method into the parser. The method will not need to be
qualified with its classname for use in expressions. Multiple methods
may be imported with the same name: the first best fit will be used when
the method name is used.
throws: java.lang.NoSuchMethodException - if the named method does not exist throws: java.lang.IllegalArgumentException - if the named method is not static |
importMethod | public void importMethod(String name, Method meth)(Code) | | Imports a static method into the parser under the given name. The method
will not need to be qualified with its classname for use in expressions.
Multiple methods may be imported with the same name: the first best fit
will be used when the method name is used.
throws: java.lang.IllegalArgumentException - if the method is not static |
importPackage | public void importPackage(String pkgName)(Code) | | Imports all classes in the given package into the parser.
|
importStatics | public void importStatics(Class clasz)(Code) | | Imports all of the static public methods and members in the given class.
|
isUndecoratedDecimal | public boolean isUndecoratedDecimal()(Code) | | When true, an undecorated number containing a
decimal, for example 1.50 is interpreted as a BigDecimal
literal. When false, the same token is interpreted as a Double, as
is the case in standard java
|
removePromotionRule | public void removePromotionRule(Class fromType, Class toType)(Code) | | Removes the type-coercion rule (if any) that would have promoted values of the
from type to values of the to type for use in expressions.
|
setUndecoratedDecimal | public void setUndecoratedDecimal(boolean flag)(Code) | | Enables/Disables the interpretation of undecorated decimal literals
as BigDecimals. When true, an undecorated number containing a
decimal, for example 1.50 is interpreted as a BigDecimal
literal. When false, the same token is interpreted as a Double, as
is the case in standard java
|
|
|