{new} Predefined Helper Beans
The {@link oajr.helper} package contains several predefined beans to help when constructing REST interfaces.
The {@link oajr.helper.ResourceDescription} class is a bean with name/description
properties for labeling and linking to child resources.
The following examples is pulled from the REST examples:
It get rendered as a table of name/description columns with links to child methods:
The internals of the class show it simply has two bean properties with a link annotation defined on the name property:
{@link oajr.helper.ResourceDescriptions} is a convenience class for doing the same.
The example above can also be written as follows (which you'll notice is more concise):
The {@link oaj.html.annotation.HtmlLink @HtmlLink} annotation can also be useful for rendering custom hyperlinks:
The {@link oaj.dto.LinkString LinkString} bean is a predefined
The following is equivalent to above.
Both examples render the following consisting of a list of hyperlinks:
In all other languages, it gets serialized as a simple bean with two properties.
The {@link oajr.helper.BeanDescription} class provides a simple view of a bean and it's properties.
This example renders the following:
The {@link oajr.helper.ChildResourceDescriptions} is a convenience bean for generating a table of child resources.
The {@link oajr.BasicRestServletGroup} class uses this to generate router pages:
Note that all it requires is a {@link oajr.RestRequest} object and it will generate a router page using reflection against the resource class.
For example, the RootResources page in the REST examples renders the child resources attached to the root resource:
The RootResources page consists of the following and extends from the {@link oajr.BasicRestServletGroup} class:
The {@link oajr.helper.SeeOtherRoot} class can be used to redirect to the root URI of a resource class.
The runtime behavior is the same as the following:
One distinction is that the former defines the description