|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.wrappers.AutoMedWrapperFactory
public abstract class AutoMedWrapperFactory
An AutoMedWrapperFactory class able to produce AutoMedWrapper instances, together with any data that the wrapper requires to be present in the repository. Once created in this manner, new instances of the datasource wrapper may be created using the AccessMethod recorded in the repository.
| Field Summary | |
|---|---|
protected java.lang.String |
automedModelName
|
protected java.lang.String |
baseName
|
protected static java.lang.String[] |
empty
|
protected boolean |
factoryInUse
|
protected java.lang.String |
modelName
|
static java.lang.String |
SOURCE_PREFIX
String prefixed to AutoMed oriented Model names in order to obtain source oriented Model names. |
| Constructor Summary | |
|---|---|
AutoMedWrapperFactory()
|
|
| Method Summary | |
|---|---|
void |
clearFeatures()
Clear all the features for this factory. |
abstract Schema |
createAutoMedSchema(AutoMedWrapper wrapper,
java.lang.String schemaName)
Create an AutoMed oriented schema from the source oriented schema. |
java.util.List |
getAttributeDomains()
Return the attribute domain specifications |
abstract Model |
getAutoMedModel()
Return the AutoMed oriented Model used to represent the
Schema of the datasource. |
java.lang.String |
getAutoMedModelName()
Find the name of the Model that will be used to
represent an AutoMed oriented view of the data source. |
abstract java.lang.String[] |
getFeatureNames()
Return the list of feature names provided by the wrapper factory. |
int |
getFeatures()
Return the bitwise or of all the features in use for a wrapper. |
abstract Model |
getModel()
Return the source oriented Model used to represent the
Schema of the datasource. |
java.lang.String |
getModelBaseName()
Return text used as basis for generating Model names |
java.lang.String |
getModelName()
Find the name of the Model that will be used when a new
wrapper is generated |
boolean |
isFeatureInUse(int features)
Test if a certain group of features is being implemented in the representation of the datasource model in the AutoMed repository |
protected abstract AutoMedWrapper |
newAutoMedWrapper()
Create a new empty wrapper instance that this wrapper factory is then able to populate. |
protected abstract void |
populateSchema(AutoMedWrapper wrapper)
Read the metadata from the wrapper connection, and store in existing Schema within the wrapper. |
static java.lang.String |
safeIQL(java.lang.String unsafeIQL)
Process an indentifier to make it safe to use in the IQL language. |
void |
setAttributeDomains(java.util.List domainSpec)
Manually set the domain information for some attributes. |
void |
setFeatures(int features)
Allows certain features of the Model used for Schemas
generated by this wrapper factory. |
void |
setFeatures(int[] features)
Allows certain features of the Model used for Schemas
generated by this wrapper factory. |
void |
setModelBaseName(java.lang.String baseName)
Each implementing class gives a name for the Models that
will be generated for Schemas. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean factoryInUse
protected java.lang.String baseName
protected java.lang.String modelName
protected java.lang.String automedModelName
protected static final java.lang.String[] empty
public static final java.lang.String SOURCE_PREFIX
| Constructor Detail |
|---|
public AutoMedWrapperFactory()
| Method Detail |
|---|
public void setModelBaseName(java.lang.String baseName)
Models that
will be generated for Schemas. This same will be suffixed
by the value of getFeatures() (unless that is zero). Thus
one may create different wrappers with different features set,
and they obtain distinct Model names. Also
for source oriented Models that differ from AutoMed oriented
Models, it will be prefixed by SOURCE_PREFIX.
baseName - text that appears in the Model namepublic java.lang.String getModelBaseName()
Model names
public final boolean isFeatureInUse(int features)
features - is the bitwise `or' of feature flags to be
tested
public final java.lang.String getAutoMedModelName()
Model that will be used to
represent an AutoMed oriented view of the data source.
Model used for the Schema of new
wrappers.public final java.lang.String getModelName()
Model that will be used when a new
wrapper is generated
Model used for the Schema of new
wrappers.public final int getFeatures()
public final void clearFeatures()
public void setFeatures(int features)
throws IntegrityException
Model used for Schemas
generated by this wrapper factory.
features - a bitwise `or' of the feature flags.
By default no features are used.
IntegrityException - if the factory is already being used for
producing wrappers. You should create a new wrapper factory for your
settings.public abstract java.lang.String[] getFeatureNames()
#setFeature methods. In particular you may use the list
on javax.swing.JList#setListData()
public void setFeatures(int[] features)
throws IntegrityException
Model used for Schemas
generated by this wrapper factory.
features - an array of integers containing the bit position
of the feature to set. Note that is you create a JList
from the featureNames of the factory, then you may called this
method with the value of javax.swing.JList.getSelectedIndices()
IntegrityException - if the factory is already being used for
producing wrappers. You should create a new wrapper factory for your
settings.public abstract Model getModel()
Model used to represent the
Schema of the datasource. For some wrappers, this may be
the same as AutoMed oriented Model returned by
getAutoMedModel()
public abstract Model getAutoMedModel()
Model used to represent the
Schema of the datasource.
protected abstract void populateSchema(AutoMedWrapper wrapper)
throws DataSourceException
AutoMedWrapper
instances as part of the wrapper creation process.
DataSourceException
public abstract Schema createAutoMedSchema(AutoMedWrapper wrapper,
java.lang.String schemaName)
throws IntegrityException,
NotFoundException
wrapper - A wrapper containing the source oriented Schema from which the AutoMed oriented Schema should be
produced.schemaName - name of the new AutoMed construct oriented schema
that is to be created from the source oriented schema. This schema must
not yet exist.
IntegrityException - if schemaName already exists.
NotFoundException - if you have not previously wrapped the
datasource as a source oriented schema, using either #AutoMedWrapper.getSchema(String) or #AutoMedWrapper.selectNewAutoMedWrapperpublic static java.lang.String safeIQL(java.lang.String unsafeIQL)
unsafeIQL - String containing possibliy illegal characters
(e.g. $xyz)
protected abstract AutoMedWrapper newAutoMedWrapper()
public void setAttributeDomains(java.util.List domainSpec)
domainSpec - is a list of AttributeDomain objectspublic java.util.List getAttributeDomains()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||