Class BaseEvalContext
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.BaseEvalContext
-
- All Implemented Interfaces:
EvalContext,LocaleContext
- Direct Known Subclasses:
ColEvalContext,RowEvalContext
public abstract class BaseEvalContext extends Object implements EvalContext
- Author:
- James Ahlborn
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollectIdentifiers(Collection<Identifier> identifiers)DateTimeFormattercreateDateFormatter(String formatStr)DecimalFormatcreateDecimalFormat(String formatStr)Objecteval()Objectget(String key)BindingsgetBindings()ValuegetIdentifierValue(Identifier identifier)LocalegetLocale()NumericConfiggetNumericConfig()floatgetRandom(Integer seed)Value.TypegetResultType()TemporalConfiggetTemporalConfig()ValuegetThisColumnValue()ZoneIdgetZoneId()voidput(String key, Object value)Sets the value of the given key to the given value in the currently configuredBindings.StringtoString()static Value.TypetoValueType(DataType dType)
-
-
-
Method Detail
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceLocaleContext- Returns:
- the currently configured Locale
-
getTemporalConfig
public TemporalConfig getTemporalConfig()
- Specified by:
getTemporalConfigin interfaceLocaleContext- Returns:
- the currently configured TemporalConfig (from the
EvalConfig)
-
createDateFormatter
public DateTimeFormatter createDateFormatter(String formatStr)
- Specified by:
createDateFormatterin interfaceLocaleContext- Returns:
- an appropriately configured (i.e. locale) DateTimeFormatter for the given format.
-
getZoneId
public ZoneId getZoneId()
- Specified by:
getZoneIdin interfaceLocaleContext- Returns:
- the currently configured ZoneId
-
getNumericConfig
public NumericConfig getNumericConfig()
- Specified by:
getNumericConfigin interfaceLocaleContext- Returns:
- the currently configured NumericConfig (from the
EvalConfig)
-
createDecimalFormat
public DecimalFormat createDecimalFormat(String formatStr)
- Specified by:
createDecimalFormatin interfaceLocaleContext- Returns:
- an appropriately configured (i.e. DecimalFormatSymbols) DecimalFormat for the given format.
-
getRandom
public float getRandom(Integer seed)
- Specified by:
getRandomin interfaceEvalContext- Parameters:
seed- the seed for the random value, following the rules for the "Rnd" function- Returns:
- a random value for the given seed following the statefulness rules for the "Rnd" function
-
getResultType
public Value.Type getResultType()
- Specified by:
getResultTypein interfaceEvalContext- Returns:
- the expected type of the result value for the current expression evaluation (for "default value" and "calculated" expressions)
-
getThisColumnValue
public Value getThisColumnValue()
- Specified by:
getThisColumnValuein interfaceEvalContext- Returns:
- the value of the "current" column (for "field validator" expressions)
-
getIdentifierValue
public Value getIdentifierValue(Identifier identifier)
- Specified by:
getIdentifierValuein interfaceEvalContext- Returns:
- the value of the entity identified by the given identifier (for "calculated" and "row validator" expressions)
-
getBindings
public Bindings getBindings()
- Specified by:
getBindingsin interfaceEvalContext- Returns:
- the currently configured Bindings (from the
EvalConfig)
-
get
public Object get(String key)
- Specified by:
getin interfaceEvalContext- Returns:
- the value of the current key from the currently configured
Bindings
-
put
public void put(String key, Object value)
Description copied from interface:EvalContextSets the value of the given key to the given value in the currently configuredBindings.- Specified by:
putin interfaceEvalContext
-
eval
public Object eval() throws IOException
- Throws:
IOException
-
collectIdentifiers
public void collectIdentifiers(Collection<Identifier> identifiers)
-
toValueType
public static Value.Type toValueType(DataType dType)
-
-