com.im.df.api 5.9

com.im.df.api.ddl
Interface DFItem

All Superinterfaces:
PropertiesEditingConfigurable
All Known Subinterfaces:
DFDataTree, DFEntity, DFField, DFList, DFQuery, DFRelationship, DFSchema, DFScript, DFScriptParent, DFUserItem, DFView

public interface DFItem
extends PropertiesEditingConfigurable

The root item and super-interface of all core DDL items in DIF. There are fixed number of these core items. All of them can be extended using capabilities (DFCapability).

All DFItems are DDL (data definition) objects. For data manipulation you need to obtain data providers from DFSchema.


Nested Class Summary
static interface DFItem.Handle<T extends DFItem>
          Represents a handle-like identifier of the item.
 
Nested classes/interfaces inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
PropertiesEditingConfigurable.Extra
 
Field Summary
static String PROP_CAPABILITIES
           
static String PROP_DESCRIPTION
           
static String PROP_ID
           
static String PROP_NAME
           
static String PROP_TYPE
           
static String PROP_VALID
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Registers PropertyChangeListener to receive events.
 List<DFCapability> getCapabilities()
          Get list of all capabilities of this DFItem.
 String getDescription()
          Provides a description of the DFItem.
 DFItem.Handle<? extends DFItem> getHandle()
          Returns a handle to the Item.
 String getId()
          Getter for property Id.
 String getName()
          Getter for property name.
 String getType()
          Getter for property type.
 boolean isValid()
          Return the validity of this item.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes PropertyChangeListener from the list of listeners.
 void setDescription(String description, DFEnvironmentRW env)
          Sets the description.
 void setName(String name, DFEnvironmentRW env)
          Setter for property name.
 
Methods inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
isPropertyEditable
 

Field Detail

PROP_ID

static final String PROP_ID
See Also:
Constant Field Values

PROP_NAME

static final String PROP_NAME
See Also:
Constant Field Values

PROP_TYPE

static final String PROP_TYPE
See Also:
Constant Field Values

PROP_VALID

static final String PROP_VALID
See Also:
Constant Field Values

PROP_CAPABILITIES

static final String PROP_CAPABILITIES
See Also:
Constant Field Values

PROP_DESCRIPTION

static final String PROP_DESCRIPTION
See Also:
Constant Field Values
Method Detail

getId

String getId()
Getter for property Id.

Id provides a globally unique ID for the item, something by which it can be identified. Potentially two different databases could contain information about the same entity. There should be always only one valid instance of the same id. It is implementation's responsibility to generate id big enough to be unique Note that multiple items with the same ID may created, e.g. by replicating the Schema.

Returns:
The ID of this item

getName

String getName()
Getter for property name. Name is the display name that is seen by the user. The name should be a single line String as most of UI present the name in single line visual components (tree items, lists, text fields...).

Returns:
Value of property name.

setName

void setName(String name,
             DFEnvironmentRW env)
Setter for property name.

Parameters:
name - New value of property name.

getDescription

String getDescription()
Provides a description of the DFItem. Initialy null (not set), may be an arbitrary string, usually a description set by the DFSchema creator for better understanding of the DFSChema contents by DIF users.

Returns:
The description, or null if none is set.

setDescription

void setDescription(String description,
                    DFEnvironmentRW env)
Sets the description. Passing null will clear the description. The DFItem must be locked, and the DFLock passed in the 'env'.

Parameters:
description - The new description or null
env - The environment

getType

String getType()
Getter for property type. This is code name (not human readable string), which represents the type of instance (usually main type implementation name with combination of capabilities). The value can change during lifetime of DFItem instance (e.g. when converting field to a different type). The well know values should be part of each implementations documentation.

Returns:
Value of property name.

getCapabilities

List<DFCapability> getCapabilities()
Get list of all capabilities of this DFItem. Check DIFUtilities to get convenience methods, for example method which find an appropriate DFCapability of the given class. The list of capabilities can change during DFItem lifetime and so you should listen to PROP_CAPABILITIES changes.


isValid

boolean isValid()
Return the validity of this item. The item becomes invalid when it's removed from it's parent or when it's parent become invalid. It's possible to listen to changes of this flag. It's impossible for invalid object to become valid again. When object become invalid, all changes are ignored (are not persistent) and DFItem's method calls can throw unpredictable exceptions.


addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener listener)
Registers PropertyChangeListener to receive events. This registration method can be used also for property change events fired from all DFItem's capabilities. It's recommended to use weak listeners when listening to DFItems property changes.

Parameters:
listener - The listener to register.

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners.

Parameters:
listener - The listener to remove.

getHandle

DFItem.Handle<? extends DFItem> getHandle()
Returns a handle to the Item. The handle uniquely identifies the Item, even though the schema data may be copied or otherwise replicated. Use the Handle instead of DFItem.getId() when registering an Item in collections that extend beyond the DFItem's parent Schema.

Returns:
The handle to the DFItem.

com.im.df.api 5.9