@PersistantProperty(property="className") @PersistantProperty(property="arguments",alias="argument") @PersistantProperty(property="argumentsTypes",alias="argumentType") public class MNewInstanceAccessor extends AbstractReadAccessor
IReadAccessor.Standalone
Constructor and Description |
---|
MNewInstanceAccessor() |
MNewInstanceAccessor(String className) |
MNewInstanceAccessor(String className,
List<? extends IReadAccessor> arguments) |
MNewInstanceAccessor(String className,
List<? extends IReadAccessor> arguments,
List<String> argumentsTypes) |
Modifier and Type | Method and Description |
---|---|
MNewInstanceAccessor |
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.
|
protected Constructor<?> |
deepFindConstructor(Class<?> clazz,
Class<?>[] args,
boolean safe) |
boolean |
equals(Object o) |
List<? extends IReadAccessor> |
getArguments() |
List<String> |
getArgumentsTypes() |
String |
getClassName() |
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.
|
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()
Never.
|
void |
setArguments(List<? extends IReadAccessor> arguments) |
void |
setArgumentsTypes(List<String> argumentsTypes) |
void |
setClassName(String className) |
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
castToExpected, compileRead, compileRead, compileRead, compileRead, get, getGenericTypes, 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 NEW_ID
public MNewInstanceAccessor()
public MNewInstanceAccessor(String className)
public MNewInstanceAccessor(String className, List<? extends IReadAccessor> arguments)
public MNewInstanceAccessor(String className, List<? extends IReadAccessor> arguments, List<String> argumentsTypes)
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
protected Constructor<?> deepFindConstructor(Class<?> clazz, Class<?>[] args, boolean safe) throws MRuleInternalException
MRuleInternalException
public CostInfo getEstimatedReadCost(ICompilationContext ctxt)
IReadAccessor
ctxt
- Compilation context.protected Object internalGet(IExecutionContext ctxt) throws MAccessorException
AbstractReadAccessor
internalGet
in class AbstractReadAccessor
MAccessorException
public boolean isShouldIterate()
public Class<?> getType(IContext ctxt) throws MAccessorException
IAccessor
MAccessorException
public Class<?> getGenericCollectionType(IContext ctxt) throws MAccessorException
IAccessor
MAccessorException
public String getImplementationId()
IAddon
public boolean isCacheUsed()
AbstractAddon
isCacheUsed
in interface IAddon
isCacheUsed
in class AbstractAddon
public MNewInstanceAccessor 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
.IOException
public String getClassName()
public void setClassName(String className)
public List<? extends IReadAccessor> getArguments()
public void setArguments(List<? extends IReadAccessor> arguments)