@PersistantProperty(property="ifTrue") @PersistantProperty(property="ifFalse") public class MTernaryAccessor extends AbstractConditionWrapperAccessor
IReadAccessor.Standalone
Modifier and Type | Field and Description |
---|---|
static String |
TERNARY_ID |
Constructor and Description |
---|
MTernaryAccessor() |
MTernaryAccessor(ICondition condition) |
MTernaryAccessor(ICondition condition,
IReadAccessor ifTrue,
IReadAccessor ifFalse) |
Modifier and Type | Method and Description |
---|---|
MTernaryAccessor |
clone()
Clones the Addon.
|
<G,C extends Collection<G>> |
compileCollection(ICompilationContext ctxt,
Class<C> expectedType,
Class<G> expectedGenericType)
Unsupported.
|
void |
compileValue(ICompilationContext ctxt,
Class<?> expectedType)
Implementation to handle case when expected result is a single value.
|
boolean |
equals(Object o) |
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. |
IReadAccessor |
getIfFalse() |
IReadAccessor |
getIfTrue() |
String |
getImplementationId()
Unique addon implementation ID.
|
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.
|
int |
hashCode() |
protected Object |
internalGet(IExecutionContext ctxt)
Specific addon implementation must be here.
|
boolean |
isCacheUsed()
Returns false by default.
|
boolean |
isShouldIterate()
If this iterator is dedicated to iterate over values, then it should be precised.
|
void |
setIfFalse(IReadAccessor ifFalse) |
void |
setIfTrue(IReadAccessor ifTrue) |
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
getCondition, setCondition
castToExpected, compileRead, compileRead, compileRead, compileRead, get, isConstantValue, 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 TERNARY_ID
public MTernaryAccessor()
public MTernaryAccessor(ICondition condition)
public MTernaryAccessor(ICondition condition, IReadAccessor ifTrue, IReadAccessor ifFalse)
public void compileValue(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
AbstractReadAccessor
compileValue
in class AbstractConditionWrapperAccessor
MRuleValidationException
public <G,C extends Collection<G>> void compileCollection(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType) throws MRuleValidationException
AbstractConditionWrapperAccessor
compileCollection
in class AbstractConditionWrapperAccessor
MRuleValidationException
public CostInfo getEstimatedReadCost(ICompilationContext ctxt) throws MRuleValidationException
IReadAccessor
getEstimatedReadCost
in interface IReadAccessor
getEstimatedReadCost
in class AbstractConditionWrapperAccessor
ctxt
- Compilation context.MRuleValidationException
- if validation problem detected.protected Object internalGet(IExecutionContext ctxt) throws MAccessorException
AbstractReadAccessor
internalGet
in class AbstractConditionWrapperAccessor
MAccessorException
public Class<?> getType(IContext ctxt) throws MAccessorException
IAccessor
getType
in interface IAccessor
getType
in class AbstractConditionWrapperAccessor
MAccessorException
public Class<?> getGenericCollectionType(IContext ctxt) throws MAccessorException
IAccessor
getGenericCollectionType
in interface IAccessor
getGenericCollectionType
in class AbstractConditionWrapperAccessor
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
isShouldIterate
in class AbstractConditionWrapperAccessor
public String getImplementationId()
IAddon
public boolean isCacheUsed()
AbstractAddon
isCacheUsed
in interface IAddon
isCacheUsed
in class AbstractConditionWrapperAccessor
public MTernaryAccessor clone()
IAddon
clone
in interface IAccessor
clone
in interface IReadAccessor
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in class AbstractConditionWrapperAccessor
public boolean equals(Object o)
equals
in class AbstractConditionWrapperAccessor
public int hashCode()
hashCode
in class AbstractConditionWrapperAccessor
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.toString
in interface Outable
toString
in class AbstractConditionWrapperAccessor
IOException
public IReadAccessor getIfTrue()
public void setIfTrue(IReadAccessor ifTrue)
public IReadAccessor getIfFalse()
public void setIfFalse(IReadAccessor ifFalse)