public class SlotBasedRequest extends java.lang.Object implements IRequest, ISlotContainer
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<ISlot> |
_slots |
protected java.util.Collection<ISlot> |
_unresolved |
Constructor and Description |
---|
SlotBasedRequest() |
SlotBasedRequest(java.util.Collection<? extends ISlot> slots) |
Modifier and Type | Method and Description |
---|---|
void |
addSlot(ISlot slot)
Adds a slot
|
int |
bind(IModel model,
java.lang.String containerName,
IUniqueSlotContainer container,
VariableBindings bindings,
boolean iterativeCall)
bind the slot values in this request against those slots contained in the
container.
|
int |
bind(IModel model,
VariableBindings bindings,
boolean iterativeCall)
attempt to resolve all the bindings, returning the number of unresolved.
|
void |
bindSlots(IModel model,
java.lang.String containerName,
IUniqueSlotContainer container,
VariableBindings bindings,
java.util.Collection<ISlot> slots)
attempt to resolve the slot values using a container
|
void |
bindSlots(IModel model,
VariableBindings bindings,
java.util.Collection<ISlot> slots)
bind and resolve as many slots in the collection as possible.
|
SlotBasedRequest |
clone()
duplicate this IRequest so that the clone can
be resolved against since the process is destructive
|
int |
countMatches(IChunk chunk,
VariableBindings bindings)
returns the number of slots in this container that match those in the
provided container.
|
java.util.Collection<? extends ISlot> |
getConditionalAndLogicalSlots() |
java.util.Collection<? extends IConditionalSlot> |
getConditionalSlots() |
java.util.Collection<? extends ISlot> |
getSlots()
return a duplicate copy of all the slots
|
java.util.Collection<ISlot> |
getSlots(java.util.Collection<ISlot> container) |
void |
removeSlot(ISlot slot)
remove a slot
|
protected boolean |
resolveConditionalSlot(IConditionalSlot slotToResolve,
VariableBindings bindings,
java.lang.String slotContainerName,
IUniqueSlotContainer slotContainer)
attempt to resolve a single (non logical) slot.
|
protected boolean |
resolveLogicalSlot(ILogicalSlot slotToResolve,
VariableBindings bindings,
java.lang.String slotContainerName,
IUniqueSlotContainer container)
resolve a logical slot.
|
protected boolean |
resolveSlot(ISlot slot,
VariableBindings bindings,
java.lang.String slotContainerName,
IUniqueSlotContainer container) |
protected void |
setLocked(boolean locked) |
protected java.util.Collection<ISlot> _slots
protected java.util.Collection<ISlot> _unresolved
public SlotBasedRequest()
public SlotBasedRequest(java.util.Collection<? extends ISlot> slots)
public int countMatches(IChunk chunk, VariableBindings bindings)
container
- protected boolean resolveSlot(ISlot slot, VariableBindings bindings, java.lang.String slotContainerName, IUniqueSlotContainer container) throws CannotMatchException
CannotMatchException
protected boolean resolveLogicalSlot(ILogicalSlot slotToResolve, VariableBindings bindings, java.lang.String slotContainerName, IUniqueSlotContainer container) throws CannotMatchException
slotToResolve
- bindings
- slotContainerName
- container
- CannotMatchException
protected boolean resolveConditionalSlot(IConditionalSlot slotToResolve, VariableBindings bindings, java.lang.String slotContainerName, IUniqueSlotContainer slotContainer) throws CannotMatchException
slotToResolve
- model
- bindings
- slotContainer
- CannotMatchException
public int bind(IModel model, VariableBindings bindings, boolean iterativeCall) throws CannotMatchException
IRequest
class. An alternative
entry call is available for those that want to bind against a specific slot
container
bind(IModel, String, IUniqueSlotContainer, VariableBindings, boolean)
bind
in interface IRequest
CannotMatchException
public int bind(IModel model, java.lang.String containerName, IUniqueSlotContainer container, VariableBindings bindings, boolean iterativeCall) throws CannotMatchException
model
- container
- bindings
- iterativeCall
- CannotMatchException
public void bindSlots(IModel model, java.lang.String containerName, IUniqueSlotContainer container, VariableBindings bindings, java.util.Collection<ISlot> slots) throws CannotMatchException
model
- containerName
- container
- bindings
- slots
- CannotMatchException
public void bindSlots(IModel model, VariableBindings bindings, java.util.Collection<ISlot> slots) throws CannotMatchException
CannotMatchException
- if there is a critical binding errorpublic SlotBasedRequest clone()
IRequest
protected void setLocked(boolean locked)
public void addSlot(ISlot slot)
ISlotContainer
addSlot
in interface ISlotContainer
slot
- The feature to be added to the ISlot attributepublic java.util.Collection<? extends IConditionalSlot> getConditionalSlots()
public java.util.Collection<? extends ISlot> getConditionalAndLogicalSlots()
public java.util.Collection<? extends ISlot> getSlots()
ISlotContainer
getSlots
in interface ISlotContainer
public void removeSlot(ISlot slot)
ISlotContainer
removeSlot
in interface ISlotContainer
slot
- Description of Parameterpublic java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> container)
getSlots
in interface ISlotContainer