@PersistantProperty(property="source") @PersistantProperty(property="beginIndex") @PersistantProperty(property="endIndex",defaultValue="-1") public class MSubPartAccessor extends AbstractReadAccessor implements IAccessorValueHandler
MValueAccessor
for example) this will be a
lose of performance.IReadAccessor.Standalone
Modifier and Type | Field and Description |
---|---|
static String |
SUBPART_ID |
Constructor and Description |
---|
MSubPartAccessor() |
MSubPartAccessor(IReadAccessor source,
int beginIndex) |
MSubPartAccessor(IReadAccessor source,
int beginIndex,
int endIndex) |
Modifier and Type | Method and Description |
---|---|
MSubPartAccessor |
clone()
Clones the Addon.
|
<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) |
int |
getBeginIndex() |
int |
getEndIndex() |
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<?>[] |
getGenericTypes(IContext ctxt)
By default, creates a 1 cell array with
IAccessor.getGenericCollectionType(IContext) return value if any,
or null if no value. |
String |
getImplementationId()
Unique addon implementation ID.
|
IReadAccessor |
getSource() |
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.
|
Object |
handleValue(IExecutionContext ctxt,
Object value)
Called for each value of the iterated element.
|
int |
hashCode() |
protected Object |
internalGet(IExecutionContext ctxt)
Specific addon implementation must be here.
|
boolean |
isCacheUsed()
Returns false by default.
|
boolean |
isConstantValue()
Default implementation returns "false".
|
boolean |
isShouldIterate()
If this iterator is dedicated to iterate over values, then it should be precised.
|
void |
setBeginIndex(int beginIndex) |
void |
setEndIndex(int endIndex) |
void |
setSource(IReadAccessor source) |
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
castToExpected, compileRead, compileRead, compileRead, compileRead, get, isShouldBeWrappedToConstantValue, isShouldNotCache
getInternalCacheIdentifier, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, toString, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
finalize, getClass, notify, notifyAll, wait, wait, wait
getInternalCacheIdentifier, isInternalCacheIdentifierNeeded, optimize, resetCachedData, setInternalCacheIdentifier, wasRegistered
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
public static final String SUBPART_ID
public MSubPartAccessor()
public MSubPartAccessor(IReadAccessor source, int beginIndex)
public MSubPartAccessor(IReadAccessor source, int beginIndex, int endIndex)
public void compileValue(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
AbstractReadAccessor
compileValue
in class AbstractReadAccessor
MRuleValidationException
public <G,C extends Collection<G>> void compileCollection(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType) throws MRuleValidationException
AbstractReadAccessor
compileCollection
in class AbstractReadAccessor
MRuleValidationException
public CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
IReadAccessor
getEstimatedReadCost
in interface IReadAccessor
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.public boolean isConstantValue()
AbstractReadAccessor
isConstantValue
in interface IReadAccessor
isConstantValue
in class AbstractReadAccessor
protected Object internalGet(IExecutionContext ctxt) throws MAccessorException
AbstractReadAccessor
internalGet
in class AbstractReadAccessor
MAccessorException
public Object handleValue(IExecutionContext ctxt, Object value) throws MAccessorException
IAccessorValueHandler
handleValue
in interface IAccessorValueHandler
MAccessorException
public Class<?> getType(IContext ctxt) throws MAccessorException
IAccessor
getType
in interface IAccessor
MAccessorException
public Class<?> getGenericCollectionType(IContext ctxt) throws MAccessorException
IAccessor
getGenericCollectionType
in interface IAccessor
MAccessorException
public Class<?>[] getGenericTypes(IContext ctxt) throws MAccessorException
AbstractReadAccessor
IAccessor.getGenericCollectionType(IContext)
return value if any,
or null if no value.getGenericTypes
in interface IAccessor
getGenericTypes
in class AbstractReadAccessor
MAccessorException
public boolean isShouldIterate()
IReadAccessor
MRuleInternalRuntimeException
if Exception must be thrown.isShouldIterate
in interface IReadAccessor
public String getImplementationId()
IAddon
getImplementationId
in interface IAddon
public boolean isCacheUsed()
AbstractAddon
isCacheUsed
in interface IAddon
isCacheUsed
in class AbstractAddon
public MSubPartAccessor clone()
IAddon
clone
in interface IAccessor
clone
in interface IReadAccessor
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in class AbstractReadAccessor
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.toString
in interface Outable
IOException
public IReadAccessor getSource()
public void setSource(IReadAccessor source)
public int getBeginIndex()
public void setBeginIndex(int beginIndex)
public int getEndIndex()
public void setEndIndex(int endIndex)