T
- public class ClassificationFactory<T extends Classification> extends DataObjectFactory<T> implements java.lang.Comparable<ClassificationFactory>, HistoryFieldContributor, NameFinder<T>, NameInputProvider<T>
Modifier and Type | Class and Description |
---|---|
class |
ClassificationFactory.ClassificationCodeListInput |
class |
ClassificationFactory.ClassificationCreator |
static class |
ClassificationFactory.ClassificationUpdater<C extends Classification> |
class |
ClassificationFactory.NameItemInput
An
DataObjectItemInput that uses the ParseFactory.findFromString(String) method to locate
Note this is not constrained by the select filter so can be used to locate retired objects. |
DataObjectFactory.AbstractDataObjectInput, DataObjectFactory.AbstractFinder<X>, DataObjectFactory.DataObjectAcceptFilter, DataObjectFactory.DataObjectInput, DataObjectFactory.DataObjectIntegerInput, DataObjectFactory.DestAcceptFilter<T extends DataObject>, DataObjectFactory.FilterAdapter, DataObjectFactory.FilterCounter, DataObjectFactory.FilterExists, DataObjectFactory.FilterIterator, DataObjectFactory.FilterSelector, DataObjectFactory.FilterSet, DataObjectFactory.Finder, DataObjectFactory.MakeRemoteFilterVisitor<R extends DataObject>, DataObjectFactory.MatchFilter, DataObjectFactory.ReferencedAdapter<I extends Indexed>, DataObjectFactory.ReferenceIterator<I extends Indexed>, DataObjectFactory.SortingDataObjectInput, DataObjectFactory.TimeAcceptFilter<T extends DataObject>, DataObjectFactory.TimeFilter
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
Modifier | Constructor and Description |
---|---|
protected |
ClassificationFactory() |
|
ClassificationFactory(AppContext ctx,
java.lang.String homeTable) |
Modifier and Type | Method and Description |
---|---|
void |
addToHistorySpecification(TableSpecification spec)
add fields to the history table default specification.
|
protected boolean |
allowNameChange()
Does the update allow name changes.
|
protected boolean |
allowSpacesInName() |
int |
compareTo(ClassificationFactory o) |
void |
customiseForm(Form f)
Extension hook to allow additional Form customisation generic to all
types of Form For example adding a FormValidator or adding min, max
values to NumberInputs.
|
T |
findFromString(java.lang.String name)
Find an existing entry by name
This should use the same logic as
NameFinder.getStringFinderFilter(String) . |
DataObjectItemInput<T> |
getAutocompleteInput(BaseFilter<T> fil,
boolean create,
boolean restrict) |
java.lang.String |
getCanonicalName(T object)
Get a canonical name of an object in a format that can be parsed by the
ParseFactory.findFromString(String) method. |
IndexedDataCache<java.lang.String,T> |
getDataCache()
get a DataCache for fetching the target
|
TableSpecification |
getDefaultTableSpecification(AppContext c,
java.lang.String homeTable)
Get the default table specification if the table is to be created.
|
FormCreator |
getFormCreator(AppContext c)
Create a default FormCreator for the target object
The form may be customised according to the requesting AppUser
|
FormUpdate<T> |
getFormUpdate(AppContext c)
produce a FormUpdate for the target type appropriate for
the requesting user
|
HistoryFactory<T,HistoryFactory.HistoryRecord<T>> |
getHistoryFactory() |
DataObjectItemInput<T> |
getInput(BaseFilter<T> fil,
boolean restrict)
Generate the default input type.
|
CodeListInput<T> |
getNameInput()
Get a String valued pull-down input for the classifiers
|
CodeListInput<T> |
getNameInput(BaseFilter<T> fil) |
protected java.util.Set<java.lang.String> |
getOptional()
generate the set of optional fields to be used to provide class specific defaults
in form creation/update.
|
protected java.util.List<OrderClause> |
getOrder() |
SQLValueFilter<T> |
getStringFinderFilter(java.lang.String name)
get a filter than locates the target object from a String.
|
java.lang.Class<T> |
getTarget()
Get a bound on the type of object produced by this factory for run-time checking.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getTranslations()
return a default set of translation between field names and text labels.
|
protected T |
makeBDO(Repository.Record res)
Construct a new Blank DataObject of the correct Class
This method takes a Record as an argument.
|
T |
makeFromString(java.lang.String name)
Same as
NameFinder.findFromString(String) but attempts to create a matching entry if one does not exist and this
is supported by the implementing class. |
protected void |
postCreateTableSetup(AppContext c,
java.lang.String table) |
protected void |
postMakeByName(T c,
java.lang.String name)
extension point to allow side effects when a new object is auto-created.
|
boolean |
useAutoCompleteInput(BaseFilter<T> fil) |
void |
validateNameFormat(java.lang.String name)
Check formatting constraints on the input string.
|
all, allowPreSelect, canCreate, canUpdate, checkComposite, convertToDestinationFilter, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getComposites, getConfigTag, getContext, getCount, getDefaultRelationshipFilter, getDefaults, getDestFilter, getExcludeFilter, getFieldConstraints, getFieldHelp, getFilter, getFilter, getFilter, getFinalSelectFilter, getFinalTableSpecification, getFindFilter, getID, getIndex, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getSelectors, getSupress, getTableSpecification, getTableStructureContributers, getTag, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeObject, makeRecord, makeReference, makeReference, matches, narrowSelector, narrowSelector, observeComposite, OrderBy, postSetContext, release, restrictDefaultInput, setComposites, setContext, setContext, setContextWithMake, setProperty, toString, updateTable
protected ClassificationFactory()
public ClassificationFactory(AppContext ctx, java.lang.String homeTable)
public HistoryFactory<T,HistoryFactory.HistoryRecord<T>> getHistoryFactory()
public TableSpecification getDefaultTableSpecification(AppContext c, java.lang.String homeTable)
DataObjectFactory
getDefaultTableSpecification
in class DataObjectFactory<T extends Classification>
c
- AppContexthomeTable
- String table name.protected void postCreateTableSetup(AppContext c, java.lang.String table)
postCreateTableSetup
in class DataObjectFactory<T extends Classification>
protected T makeBDO(Repository.Record res) throws DataFault
DataObjectFactory
makeBDO
in class DataObjectFactory<T extends Classification>
res
- Record to create object fromDataFault
public java.lang.Class<T> getTarget()
DataObjectFactory
IndexedProducer.getTarget()
. Normally this method should be overridden
each time we make a sub-class that narrows the produced type. However
checks should still pass if the super-type method is retained.getTarget
in interface IndexedProducer<T extends Classification>
getTarget
in interface Targetted<T extends Classification>
getTarget
in class DataObjectFactory<T extends Classification>
public T findFromString(java.lang.String name)
NameFinder
NameFinder.getStringFinderFilter(String)
.findFromString
in interface NameFinder<T extends Classification>
findFromString
in interface ParseFactory<T extends Classification>
public SQLValueFilter<T> getStringFinderFilter(java.lang.String name)
NameFinder
NameFinder.findFromString(String)
getStringFinderFilter
in interface NameFinder<T extends Classification>
name
- public T makeFromString(java.lang.String name) throws DataFault
NameFinder
NameFinder.findFromString(String)
but attempts to create a matching entry if one does not exist and this
is supported by the implementing class.makeFromString
in interface NameFinder<T extends Classification>
DataFault
protected void postMakeByName(T c, java.lang.String name)
protected boolean allowNameChange()
protected boolean allowSpacesInName()
public FormCreator getFormCreator(AppContext c)
FormCreatorProducer
getFormCreator
in interface FormCreatorProducer
getFormCreator
in class DataObjectFactory<T extends Classification>
c
- AppContextpublic IndexedDataCache<java.lang.String,T> getDataCache()
NameFinder
getDataCache
in interface NameFinder<T extends Classification>
public int compareTo(ClassificationFactory o)
compareTo
in interface java.lang.Comparable<ClassificationFactory>
protected java.util.List<OrderClause> getOrder()
getOrder
in class DataObjectFactory<T extends Classification>
public FormUpdate<T> getFormUpdate(AppContext c)
FormUpdateProducer
getFormUpdate
in interface FormUpdateProducer<T extends Classification>
getFormUpdate
in class DataObjectFactory<T extends Classification>
c
- AppContextpublic void customiseForm(Form f)
DataObjectFactory
customiseForm
in class DataObjectFactory<T extends Classification>
f
- Form to modifypublic final CodeListInput<T> getNameInput()
getNameInput
in interface NameInputProvider<T extends Classification>
public final CodeListInput<T> getNameInput(BaseFilter<T> fil)
getNameInput
in interface NameInputProvider<T extends Classification>
protected java.util.Map<java.lang.String,java.lang.String> getTranslations()
DataObjectFactory
getTranslations
in class DataObjectFactory<T extends Classification>
DataObjectFormFactory
protected java.util.Set<java.lang.String> getOptional()
DataObjectFactory
DataObjectFactory.getNullable()
and remove any fields that should be forced to be mandatory.
Alternatively you can start with an empty set (defaulting to all fields mandatory) and add exceptions
Note that for legacy reasons a non-nullable String field CAN be made optional (the Repository
will map null values to the empty string)getOptional
in class DataObjectFactory<T extends Classification>
DataObjectFactory.getNullable()
public java.lang.String getCanonicalName(T object)
ParseFactory
ParseFactory.findFromString(String)
method.getCanonicalName
in interface ParseFactory<T extends Classification>
public final DataObjectItemInput<T> getAutocompleteInput(BaseFilter<T> fil, boolean create, boolean restrict)
public void validateNameFormat(java.lang.String name) throws ParseException
NameFinder
validateNameFormat
in interface NameFinder<T extends Classification>
ParseException
public boolean useAutoCompleteInput(BaseFilter<T> fil)
public DataObjectItemInput<T> getInput(BaseFilter<T> fil, boolean restrict)
DataObjectFactory
ListInput
but can be overidden to return an auto-complete input.
Note that the error message when agetInput
in class DataObjectFactory<T extends Classification>
fil
- BaseFilter
for suggested valuesrestrict
- boolean should filter restrict resultspublic void addToHistorySpecification(TableSpecification spec)
HistoryFieldContributor
addToHistorySpecification
in interface HistoryFieldContributor