org.eclipse.wst.common.frameworks.datamodel
Class DataModelFactory

java.lang.Object
  extended by org.eclipse.wst.common.frameworks.datamodel.DataModelFactory

public class DataModelFactory
extends java.lang.Object

DataModelFactory is used to create IDataModel instances.

Since:
1.0

Method Summary
static IDataModel createDataModel(java.lang.Class aClass)
           Builds an IDataModel using the specified Class.
static IDataModel createDataModel(IDataModelProvider provider)
           Creates a new IDataModel using the the specified instance of an IDataModelProvider.
static IDataModel createDataModel(java.lang.String dataModelProviderID)
           Looks up the appropriate IDataModelProvider by the specified id and constructs a new IDataModel.
static java.lang.String[] getDataModelProviderIDsForKind(java.lang.String dataModelProviderKindID)
           Looks up the appropriate dataModelProviderIDs by the specified dataModelProviderKindID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDataModel

public static IDataModel createDataModel(java.lang.String dataModelProviderID)

Looks up the appropriate IDataModelProvider by the specified id and constructs a new IDataModel. If the IDataModelProvider is not found then a RuntimeException is logged and null is returned.

Parameters:
dataModelProviderID - the id of the IDataModelProvider
Returns:
a new IDataModel

getDataModelProviderIDsForKind

public static java.lang.String[] getDataModelProviderIDsForKind(java.lang.String dataModelProviderKindID)

Looks up the appropriate dataModelProviderIDs by the specified dataModelProviderKindID.

Parameters:
dataModelProviderKindID - the String id of the dataModelProviderKindID
Returns:
the array of valid dataModelProviderIDs or an empty array if there are none.

createDataModel

public static IDataModel createDataModel(java.lang.Class aClass)

Builds an IDataModel using the specified Class. This Class will normally be a sub interface of IDataModelProperties. If the Class it is an IDataModelProperties.class then this method will attempt to use the IDataModelProperties#_provider_class field to load the IDataModelProvider with which to back the IDataModel. If this fails, or if the Class is not an interface, then this method is equavalent to createDataModel(aClass.getName()).

Parameters:
aClass - an IDataModelProperties.class or the class whose name is the id of the IDataModelProvider
Returns:
a new IDataModel

createDataModel

public static IDataModel createDataModel(IDataModelProvider provider)

Creates a new IDataModel using the the specified instance of an IDataModelProvider.

Parameters:
provider -
Returns:
a new IDataModel