public interface IReadAccessor extends IAccessor
Modifier and Type | Interface and Description |
---|---|
static interface |
IReadAccessor.Standalone
Annotating a read accessor with the Standalone interface
just points out that this particular accessor may have side effects and should be able
to be called in a standalone way, i.e. ignoring its returing value.
|
Modifier and Type | Method and Description |
---|---|
IReadAccessor |
clone()
Clones the Accessor.
|
void |
compileRead(ICompilationContext ctxt)
Compiles this accessor to retrieve a value or a Collection, with no constraint.
|
void |
compileRead(ICompilationContext ctxt,
Class<?> expectedType)
Compiles this accessor to retrieve a value or a Collection, for witch generic type should be automatically detected if possible.
|
<G,C extends Collection<G>> |
compileRead(ICompilationContext ctxt,
Class<C> expectedType,
Class<G> expectedGenericType)
Compiles this accessor to retrieve a collection, for witch generic type should be automatically detected if not provided and possible.
|
void |
compileRead(ICompilationContext ctxt,
IAccessor accessor)
Compiles this accessor to retrieve a value or a Collection, in order to conform to what the provided one awaits for.
|
Object |
get(IExecutionContext ctxt)
Gets the value.
|
CostInfo |
getEstimatedReadCost(ICompilationContext ctxt)
Estimates the reading complexity, to allow callers to optimize calls.
|
boolean |
isConstantValue()
Tells if this accessor returns a constant value for all executions.
|
boolean |
isShouldBeWrappedToConstantValue()
Tells if this accessor should be wrapped into a constant value for optimization.
|
boolean |
isShouldIterate()
If this iterator is dedicated to iterate over values, then it should be precised.
|
getGenericCollectionType, getGenericTypes, getType
getImplementationId, getInternalCacheIdentifier, isCacheUsed, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
void compileRead(ICompilationContext ctxt) throws MRuleValidationException
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.void compileRead(ICompilationContext ctxt, IAccessor accessor) throws MRuleValidationException
ctxt
- Compilation context.accessor
- Compilation base.MRuleValidationException
- if validation problem detected.void compileRead(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
ctxt
- Compilation context.expectedType
- If any type is expected. Null if none.MRuleValidationException
- if validation problem detected.<G,C extends Collection<G>> void compileRead(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType) throws MRuleValidationException
ctxt
- Compilation context.expectedType
- If any specific implem is expected for the collection. Null (or "Collection.class") if none.expectedGenericType
- If any generic type is expected for the collection. Null if none.MRuleValidationException
- if validation problem detected.CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.Object get(IExecutionContext ctxt) throws MAccessorException
ctxt
- Compilation context.MAccessorException
boolean isShouldIterate()
MRuleInternalRuntimeException
if Exception must be thrown.IReadAccessor clone()
boolean isConstantValue()
boolean isShouldBeWrappedToConstantValue()