ca.grimoire.formtree
Interface FormElementReceiver

All Known Subinterfaces:
FormReceiver<T>
All Known Implementing Classes:
ArrayReceiver, CollectionReceiver, ConstructorReceiver, IgnoreReceiver, ListReceiver, SetReceiver, StringConstructorReceiver

public interface FormElementReceiver

Intermediate receivers for form elements (along with the final receiver) must implement this to provide FormDecoder with a way to navigate to the relevant part of the data model for each field.

The navigation methods (which return FormElementReceiver) must not return null when asked for an unsupported key. Implementations may ignore data; the easiest way is to return IgnoreReceiver.IGNORE. Similarly, the values(Iterable) method must silently ignore unexpected values.

See Also:
FormDecoder, FormElementReceiver

Method Summary
 FormElementReceiver index(int index)
          Adds an index to the decoded form.
 FormElementReceiver key(java.lang.String field)
          Adds a key to the decoded form.
 void values(java.lang.Iterable<java.lang.String> values)
          Add a terminal value to the decoded form.
 

Method Detail

values

void values(java.lang.Iterable<java.lang.String> values)
Add a terminal value to the decoded form.

Parameters:
values - the values to store.

index

FormElementReceiver index(int index)
Adds an index to the decoded form.

Parameters:
index - the index to decode.
Returns:
a form receiver for the index's contents.

key

FormElementReceiver key(java.lang.String field)
Adds a key to the decoded form.

Parameters:
field - the field to decode.
Returns:
a form receiver for the key's contents.


Copyright © 2011 Grimoire Alchymia. All Rights Reserved.