|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DFNewType<E extends DFItem>
NewType is the object with the ability to create new items. It is always related to the context where it was obtained from. If you get it from some specific fields container instance it will create new fields in this context (all newly created fields will belong to the same parent entity).
NewType is supposed to be used by user code (usually UI code) like wizards, menu actions; or by some macro style scripts which can create bunch of new items (e.g. new entity, some of its fields, empty datatree with only this entity as a root and some plain view).
Each new type can provide options (parameters for object creation). DFNewType always returns
the same instance. So you just need to take it (getOptions()) and set up it.
If you call create method, options must be in valid state otherwise create method fails.
NewType is prepared to be used by user interface code as well as by these code scripts. So there are basically two scenarios how to use newtype.
User interface code:
getName(). UI wizard
can also offer some type of filtering based on isForAddingExistingItem() method return valuecreate(DFEnvironmentRW) methodDFFieldIntegerCapability.
You can also filter out the newtypes which have some unwanted capabilities (e.g.
DFFieldChemicalTermsCapability). If you are
still not sure it is possible to use getType() method to find the exact implementation you need.DFNewTypeWellKnownOptions. For example if you are creating a new database field,
you can try to cast Options object to DFNewTypeWellKnownOptions.NewDBField and
set arguments using its methods.create(DFEnvironmentRW) method
| Method Summary | |
|---|---|
Collection<E> |
create(DFEnvironmentRW env)
Create one or more new DFItems is one step. |
List<Class> |
getCapabilityTypes()
Get the list of capabilities of the future DFItem(s) created by this newtype. |
String |
getName()
Human readable name of this new type. |
DFNewTypeOptions |
getOptions()
|
String |
getType()
Get the code-name (implementation unique name) of this newtype. |
boolean |
isForAddingExistingItem()
Is this new type used for creating new DFItem metaobject for some object on the physical level which
already exists? DFItems are usually metadata objects for some underlayed artefacts, but this is not necessary. |
boolean |
isForCreatingSingleItem()
Test the type of newtype. |
| Method Detail |
|---|
String getName()
List<Class> getCapabilityTypes()
DFItem(s) created by this newtype.
String getType()
DFItem.getType() method.
boolean isForAddingExistingItem()
DFItem metaobject for some object on the physical level which
already exists? DFItems are usually metadata objects for some underlayed artefacts, but this is not necessary.
It always depends on the specific implementations and on the type of DFItem. For example DFEntity can
represents database table as well as file. But there can also be only memory implementation, which does not
have anything under it.
Some DFItems are really virtual and have no artefacts - typically DFDataTrees and
DFViews.
If there is no underlayed artefacts (database, file,..) all newtypes will return false from this method.
Please note that this flag is related to the DFContainer remove(..) method's argument called destroyArtefacts.
It has also meaning also only for some types and some implementations of DFItems.
DFNewTypeOptions getOptions()
This method returns always the same instance of options, so be careful if you modify it, the new settings will be used in create method.
boolean isForCreatingSingleItem()
Collection<E> create(DFEnvironmentRW env)
|
com.im.df.api 5.9 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||