public abstract class ForBean extends AbstractFormComponent
IPrimaryKeyConverter
,
DefaultPrimaryKeyConverter
Modifier and Type | Class and Description |
---|---|
protected class |
ForBean.CompleteRepSource
An implementation of RepSource that provides the string representation of the given value
using all methods.
|
protected class |
ForBean.KeyExpressionRepSource
An implementation of RepSource that provides the string representation of the given value
using just the 'keyExpression' parameter.
|
protected static interface |
ForBean.RepSource
An interface that provides the string representation of a given value
|
Constructor and Description |
---|
ForBean() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Iterator |
evaluateFullSourceIterator()
Returns a new iterator of the values in 'fullSource'.
|
protected java.util.Iterator |
evaluateSourceIterator()
Returns a new iterator of the values in 'source'.
|
protected java.lang.Object |
findValueWithStringRep(java.util.Iterator sourceIterator,
java.util.Iterator fullSourceIterator,
java.util.Map repToValueMap,
java.lang.String rep,
ForBean.RepSource repSource)
Attempt to find a value in 'source' or 'fullSource' that generates the provided string
representation.
|
protected java.lang.Object |
findValueWithStringRepInIterator(java.util.Iterator it,
java.util.Map repToValueMap,
java.lang.String rep,
ForBean.RepSource repSource)
Attempt to find a value in the provided collection that generates the required string
representation.
|
protected boolean |
getCanTakeFocus()
For component can not take focus.
|
java.lang.String |
getClientId()
Returns the component's client-side element id.
|
abstract IPrimaryKeyConverter |
getConverter() |
protected java.lang.Object |
getConverterFromValue(java.lang.Object value)
Uses the 'converter' parameter to determine the primary key of the given value
|
abstract DataSqueezer |
getDataSqueezer() |
abstract java.lang.Object |
getDefaultValue() |
java.lang.String |
getDisplayName()
May be implemented to return a user-presentable, localized name for the component, which is
used in labels or error messages.
|
abstract java.lang.String |
getElement() |
abstract ExpressionEvaluator |
getExpressionEvaluator() |
int |
getIndex()
The index number, within the
source , of the the current value. |
abstract java.lang.String |
getKeyExpression() |
protected java.lang.Object |
getKeyExpressionFromValue(java.lang.Object value)
Uses the 'keyExpression' parameter to determine the primary key of the given value
|
abstract boolean |
getMatch() |
protected java.lang.Object |
getPrimaryKeyFromValue(java.lang.Object value)
Returns the primary key of the given value.
|
protected java.util.Iterator |
getStoredData(IRequestCycle cycle,
java.lang.String name)
Returns a list of the values stored as Hidden fields in the form.
|
protected java.lang.String |
getStringRepFromValue(java.lang.Object value)
Returns the string representation of the value.
|
java.lang.Object |
getValue()
Returns the most recent value extracted from the source parameter.
|
abstract ValueConverter |
getValueConverter() |
protected java.lang.Object |
getValueFromStringRep(java.util.Iterator sourceIterator,
java.util.Iterator fullSourceIterator,
java.util.Map repToValueMap,
java.lang.String rep)
Determines the value that corresponds to the given string representation.
|
abstract boolean |
getVolatile() |
boolean |
isDisabled()
Returns true if the component is disabled.
|
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Gets the source binding and iterates through its values.
|
protected void |
renderFormComponent(IMarkupWriter writer,
IRequestCycle cycle) |
protected void |
rewindFormComponent(IMarkupWriter writer,
IRequestCycle cycle) |
protected java.util.Iterator |
storeSourceData(IForm form,
java.lang.String name)
Stores the provided data in the form and then returns the data as an iterator.
|
protected void |
updateOutputParameters()
Updates the index and value output parameters if bound.
|
protected void |
updatePrimaryKeysParameter(java.lang.String[] stringReps)
Updates the primaryKeys parameter if bound.
|
getAlwaysRenderBodyOnRewind, getForm, getIdParameter, getName, isRequired, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName, setName
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
public ForBean()
public abstract java.lang.String getElement()
public abstract java.lang.String getKeyExpression()
public abstract IPrimaryKeyConverter getConverter()
public abstract java.lang.Object getDefaultValue()
public abstract boolean getMatch()
public abstract boolean getVolatile()
public abstract DataSqueezer getDataSqueezer()
public abstract ValueConverter getValueConverter()
public abstract ExpressionEvaluator getExpressionEvaluator()
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
public final java.lang.Object getValue()
org.apache.tapestry.ApplicationRuntimeException
- if the For is not currently rendering.public int getIndex()
source
, of the the current value.org.apache.tapestry.ApplicationRuntimeException
- if the For is not currently rendering.public boolean isDisabled()
IFormComponent
protected void updateOutputParameters()
protected void updatePrimaryKeysParameter(java.lang.String[] stringReps)
protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
renderFormComponent
in class AbstractFormComponent
protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
rewindFormComponent
in class AbstractFormComponent
protected java.util.Iterator getStoredData(IRequestCycle cycle, java.lang.String name)
cycle
- The current request cyclename
- The name of the HTTP parameter whether the valuesprotected java.util.Iterator storeSourceData(IForm form, java.lang.String name)
form
- The form where the data will be storedname
- The name under which the data will be storedprotected java.lang.String getStringRepFromValue(java.lang.Object value)
value
- protected java.lang.Object getPrimaryKeyFromValue(java.lang.Object value)
value
- The value from which the primary key should be extractedprotected java.lang.Object getKeyExpressionFromValue(java.lang.Object value)
value
- The value from which the primary key should be extractedprotected java.lang.Object getConverterFromValue(java.lang.Object value)
value
- The value from which the primary key should be extractedprotected java.lang.Object getValueFromStringRep(java.util.Iterator sourceIterator, java.util.Iterator fullSourceIterator, java.util.Map repToValueMap, java.lang.String rep)
rep
- the string representation for which a value should be returnedprotected java.lang.Object findValueWithStringRep(java.util.Iterator sourceIterator, java.util.Iterator fullSourceIterator, java.util.Map repToValueMap, java.lang.String rep, ForBean.RepSource repSource)
rep
- the string representation for which a value should be returnedrepSource
- an interface providing the string representation of a given valueprotected java.lang.Object findValueWithStringRepInIterator(java.util.Iterator it, java.util.Map repToValueMap, java.lang.String rep, ForBean.RepSource repSource)
rep
- the string representation for which a value should be returnedrepSource
- an interface providing the string representation of a given valueit
- the iterator of the collection in which a value should be searchedprotected java.util.Iterator evaluateSourceIterator()
protected java.util.Iterator evaluateFullSourceIterator()
protected boolean getCanTakeFocus()
getCanTakeFocus
in class AbstractFormComponent
public java.lang.String getClientId()
IFormComponent
IRequestCycle.getUniqueId(String)
to ensure that it is unique.
The component is expected to write an id attribute (if it has a non null id). As with
IFormComponent.getName()
, if a component renders more than once (such as inside a loop) then on
each render it will have a different clientId.public java.lang.String getDisplayName()
IFormComponent