F
- Factory typeT
- Target typepublic abstract class FormEntry<F extends Contexed,T> extends AbstractFormFactoryProvider<F,T> implements SummaryContentProvider<T>
FormEntry objects are often created as static instances and also recorded in a static collection. The register method is overridden to record the static instances in the collection. For this reason the FormEntry does not hold an AppContext reference or cache the Factory object. FormRegistry instances created to access the collection. This way we can refer to a particular FormType via the static instance and the ObjectServlet can create FormRegistry instances using AppContext.getFactory Organising the FormTypes into collections reduces the amount of additional configuration as only the FormRegistries need to be identified by a property name.
This mechanism assumes a default update/create form for each factory class. It would be better to re-write so that a factory can have many methods that can produce form classes and identify these by annotations. moving the access conditions to an annotation as well might be useful changing this type to a register of factory classes.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
config_tag |
Modifier | Constructor and Description |
---|---|
protected |
FormEntry(java.lang.String name,
java.lang.Class<? extends F> c,
FormPolicy policy) |
protected |
FormEntry(java.lang.String name,
java.lang.Class<? extends F> c,
java.lang.String config_tag,
FormPolicy policy) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowNullTag(AppContext c) |
protected boolean |
disabled(AppContext c) |
protected F |
getFactory(AppContext c)
Get the Factory associated with this entry.
|
<X extends ContentBuilder> |
getSummaryContent(AppContext c,
X cb,
T target) |
canCreate, canUpdate, compareTo, equals, getFormCreator, getFormUpdate, getName, hashCode, register, targets
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getID, getTarget
protected FormEntry(java.lang.String name, java.lang.Class<? extends F> c, FormPolicy policy)
protected FormEntry(java.lang.String name, java.lang.Class<? extends F> c, java.lang.String config_tag, FormPolicy policy)
public <X extends ContentBuilder> X getSummaryContent(AppContext c, X cb, T target)
getSummaryContent
in interface SummaryContentProvider<T>
protected F getFactory(AppContext c) throws java.lang.Exception
AbstractFormFactoryProvider
getFactory
in class AbstractFormFactoryProvider<F extends Contexed,T>
java.lang.Exception
public boolean allowNullTag(AppContext c)
protected boolean disabled(AppContext c)
disabled
in class AbstractFormFactoryProvider<F extends Contexed,T>