| org.apache.tapestry.PrimaryKeyEncoder
PrimaryKeyEncoder | public interface PrimaryKeyEncoder (Code) | | Used by
Loop and similar components to extract out an identifier, here termed a "primary
key", that can be stored on the client and later used to recover the same, or equivalent, server
side object.
< Parameters: K - >the type of the primary key, used to identify the value (which must be serializable)< Parameters: V - >the type of value identified by the key |
Method Summary | |
void | prepareForKeys(List<K> keys) Invoked as part of a form submission to alert the encoder that a series of keys may be
converted back to values. | K | toKey(V value) Given a particular value, this method extracts and returns the primary key that identifies
the value. | V | toValue(K key) For a particular primary key, previously obtained via
PrimaryKeyEncoder.toKey(Object) , this method
returns the same or equivalent object. |
prepareForKeys | void prepareForKeys(List<K> keys)(Code) | | Invoked as part of a form submission to alert the encoder that a series of keys may be
converted back to values. This is advisory only, and the keys passed to
PrimaryKeyEncoder.toValue(Serializable) may not include all keys in the list, or may include keys not
in the list. In general, though, the keys passed in will match the actual keys to be
converted, giving the encoder a chance to efficiently fetch the necessary value objects as a
group.
|
toKey | K toKey(V value)(Code) | | Given a particular value, this method extracts and returns the primary key that identifies
the value. The key will later be converted back into a value using
PrimaryKeyEncoder.toValue(Serializable) .
Parameters: value - whose primary key is needed the key for the value |
toValue | V toValue(K key)(Code) | | For a particular primary key, previously obtained via
PrimaryKeyEncoder.toKey(Object) , this method
returns the same or equivalent object.
Parameters: key - used to identify the object the value object for the key |
|
|