org.nakedobjects.applib.adapters
Interface Parser<T>


public interface Parser<T>

Provides a mechanism for parsing and rendering string representations of objects.

Specifically, this interface embodies three related capabilties:

For custom-written (as opposed to third-party) value types, the ability for the Parser to provide a title responsibilities overlap with other conventions for domain objects. Specifically, normally we write a title() method to return a title. In such cases a typical implementation of Parser would just delegate to the value type itself to obtain the title (ie invoking the title() method directly rather than having the framework do this).

Similarly, the ability to return a typical length also overlaps with the TypicalLength annotation; which is why TypicalLength cannot be applied to types, only to properties and parameters.

For third-party value types, eg Time-and-Money there is no ability to write title() methods or annotated with TypicalLength; so this is the main reason that this interface has to deal with titles and lengths.

This interface is used in two complementary ways: