public class ProxyCondition extends AbstractSlotCondition
ICondition
. This
allows one to use arbitrary conditions in a model without futzing with the
parsers. If the delegate ICondition
is also an ISlotContainer
, the slots added to this proxy will be added to the delegate instead and the
delegate will be responsible for the variable resolution. If the delegate is
not an ISlotContainer
, it will have to query the variable bindings
for the slot values.Modifier | Constructor and Description |
---|---|
|
ProxyCondition(java.lang.Class<? extends ICondition> proxyClass,
java.util.Collection<? extends ISlot> slots) |
protected |
ProxyCondition(ICondition delegate,
java.util.Collection<? extends ISlot> slots) |
|
ProxyCondition(java.lang.String className) |
|
ProxyCondition(java.lang.String className,
java.util.Collection<? extends ISlot> slots) |
Modifier and Type | Method and Description |
---|---|
void |
addSlot(ISlot slot)
route to delegate if it implements
ISlotContainer |
int |
bind(IModel model,
VariableBindings variableBindings,
boolean iterativeCall)
Iteratively perform the resolution and binding for this condition.
|
ProxyCondition |
clone(IModel model,
VariableBindings variableBindings)
attempt to clone this condition before it will be bound in the
instantiation phase.
|
ICondition |
getDelegate() |
java.lang.String |
getDelegateClassName() |
void |
removeSlot(ISlot slot)
remove a slot
|
void |
setDelegateClass(java.lang.Class<? extends ICondition> proxyClass) |
void |
setDelegateClassName(java.lang.String name) |
clearToString, createToString, dispose, getConditionalSlots, getRequest, getSlots, getSlots, setRequest, toString
public ProxyCondition(java.lang.String className) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public ProxyCondition(java.lang.String className, java.util.Collection<? extends ISlot> slots) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public ProxyCondition(java.lang.Class<? extends ICondition> proxyClass, java.util.Collection<? extends ISlot> slots) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
protected ProxyCondition(ICondition delegate, java.util.Collection<? extends ISlot> slots)
public ICondition getDelegate()
public java.lang.String getDelegateClassName()
public void setDelegateClassName(java.lang.String name) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public void setDelegateClass(java.lang.Class<? extends ICondition> proxyClass) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public void addSlot(ISlot slot)
ISlotContainer
addSlot
in interface ISlotContainer
addSlot
in class AbstractSlotCondition
slot
- AbstractSlotCondition.addSlot(org.jactr.core.slot.ISlot)
public void removeSlot(ISlot slot)
ISlotContainer
removeSlot
in interface ISlotContainer
removeSlot
in class AbstractSlotCondition
slot
- Description of ParameterISlotContainer.removeSlot(ISlot)
public ProxyCondition clone(IModel model, VariableBindings variableBindings) throws CannotMatchException
ICondition
CannotMatchException
- if there is no way this condition can be matchedpublic int bind(IModel model, VariableBindings variableBindings, boolean iterativeCall) throws CannotMatchException
ICondition
CannotMatchException