org.jdesktop.binding
Class DefaultDataModel
java.lang.Object
org.jdesktop.binding.AbstractDataModel
org.jdesktop.binding.DefaultDataModel
- All Implemented Interfaces:
- DataModel, MetaDataProvider
- Direct Known Subclasses:
- JavaBeanDataModel
public class DefaultDataModel
- extends AbstractDataModel
Default data model implementation designed to hold a single record of
field values. This class provides storage of the model's values and
may be used when there is no underlying data model.
- Version:
- 1.0
- Author:
- Amy Fowler
- See Also:
TableModelExtAdapter
,
JavaBeanDataModel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultDataModel
public DefaultDataModel()
DefaultDataModel
public DefaultDataModel(MetaData[] fieldMetaData)
addField
public void addField(MetaData fieldMetaData,
java.lang.Object defaultValue)
addField
public void addField(MetaData fieldMetaData)
removeField
public void removeField(MetaData fieldMetaData)
getFieldNames
public java.lang.String[] getFieldNames()
- Description copied from interface:
MetaDataProvider
- Note: if the type for id is changed to Object type this will
have to change to returning Object[].
- Specified by:
getFieldNames
in interface MetaDataProvider
- Specified by:
getFieldNames
in class AbstractDataModel
- Returns:
- array containing the names of all data fields in this map
getMetaData
public MetaData getMetaData(java.lang.String fieldName)
- Description copied from interface:
MetaDataProvider
- Note: String will likely be converted to type Object for the ID
- Specified by:
getMetaData
in interface MetaDataProvider
- Specified by:
getMetaData
in class AbstractDataModel
- Parameters:
fieldName
- String containing the id of the data object
- Returns:
- MetaData object which describes properties, edit constraints
and validation logic for a data object
getFieldCount
public int getFieldCount()
- Returns:
- integer containing the number of contained MetaData
getValue
public java.lang.Object getValue(java.lang.String fieldName)
- Specified by:
getValue
in interface DataModel
- Specified by:
getValue
in class AbstractDataModel
- Parameters:
fieldName
- String containing the name of the field
- Returns:
- Object containing the current value of the named field
setValueImpl
protected void setValueImpl(java.lang.String fieldName,
java.lang.Object value)
- Specified by:
setValueImpl
in class AbstractDataModel
getRecordCount
public int getRecordCount()
getRecordIndex
public int getRecordIndex()
setRecordIndex
public void setRecordIndex(int index)
Copyright © 2005 Sun Microsystems All Rights Reserved.