public abstract static class DefaultVariablesManager.AbstractVariableAccessor extends AbstractReadAccessor
IReadAccessor.Standalone
Constructor and Description |
---|
AbstractVariableAccessor() |
Modifier and Type | Method and Description |
---|---|
<G,C extends Collection<G>> |
compileCollection(ICompilationContext ctxt,
Class<C> expectedType,
Class<G> expectedGenericType)
Implementation to handle case when expected result is a Collection.
|
void |
compileValue(ICompilationContext ctxt,
Class<?> expectedType)
Implementation to handle case when expected result is a single value.
|
boolean |
equals(Object o) |
abstract Class<?> |
getDefaultType(IContext ctxt)
Returns default type for this variable if no directive is provided.
|
CostInfo |
getEstimatedReadCost(ICompilationContext ctxt)
Estimates the reading complexity, to allow callers to optimize calls.
|
Class<?> |
getGenericCollectionType(IContext ctxt)
Returns the Generic type, if value is a collection or an array, evaluated :
at compilation time for standard compilation
at runtime for light compilation and execution phase
or null if the type can't be resolved or value is not a collection.
|
Class<?> |
getType(IContext ctxt)
Returns the value's class, evaluated :
at compilation time for standard compilation
at runtime for light compilation
or null if the type can't be resolved.
|
abstract Object |
getVarValue(IExecutionContext ctxt) |
int |
hashCode() |
protected Object |
internalGet(IExecutionContext ctxt)
Specific addon implementation must be here.
|
boolean |
isShouldBeWrappedToConstantValue()
Default implementation returns
AbstractReadAccessor.isConstantValue() && ! |
boolean |
isShouldIterate()
If this iterator is dedicated to iterate over values, then it should be precised.
|
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
castToExpected, clone, compileRead, compileRead, compileRead, compileRead, get, getGenericTypes, isConstantValue, isShouldNotCache
getInternalCacheIdentifier, isCacheUsed, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, toString, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
finalize, getClass, notify, notifyAll, wait, wait, wait
getImplementationId, getInternalCacheIdentifier, isCacheUsed, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
public final void compileValue(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
AbstractReadAccessor
compileValue
in class AbstractReadAccessor
MRuleValidationException
public final <G,C extends Collection<G>> void compileCollection(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType)
AbstractReadAccessor
compileCollection
in class AbstractReadAccessor
public CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
IReadAccessor
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.protected Object internalGet(IExecutionContext ctxt) throws MAccessorException
AbstractReadAccessor
internalGet
in class AbstractReadAccessor
MAccessorException
public abstract Object getVarValue(IExecutionContext ctxt) throws MAccessorException
MAccessorException
public boolean isShouldBeWrappedToConstantValue()
AbstractReadAccessor
AbstractReadAccessor.isConstantValue()
&& ! IReadAccessor.isShouldIterate()
.isShouldBeWrappedToConstantValue
in interface IReadAccessor
isShouldBeWrappedToConstantValue
in class AbstractReadAccessor
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.IOException
public final Class<?> getType(IContext ctxt)
IAccessor
public Class<?> getGenericCollectionType(IContext ctxt) throws MAccessorException
IAccessor
MAccessorException
public abstract Class<?> getDefaultType(IContext ctxt)
public boolean isShouldIterate()
IReadAccessor
MRuleInternalRuntimeException
if Exception must be thrown.