public interface ConnectorDescriptor extends PropertySet
This interface is not intended to be implemented by clients.
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_DIAGRAM_PROVIDER
String property that can be used to support diagrams in doc templates.
|
static String |
PROPERTY_SINGLE_THREAD
Boolean property that can be used to tell MDWorkbench the underlying connector does not support multi-threaded environments.
|
Modifier and Type | Method and Description |
---|---|
String |
getClassName()
Returns the implementation class name, subclass of
ModelReader or ModelWriter ,
which is used to do the job of reading/writing the model. |
MetamodelConfiguration |
getConfiguration()
Returns the configuration from which this connector originates.
|
FileExtensionDescriptor |
getDefaultFileExtension()
Returns the default file extension this connector expects to deal with.
|
List<FileExtensionDescriptor> |
getFileExtensions()
Returns the registered file extension descriptors.
|
ConnectorKind |
getKind()
Returns the connector kind, which describes the type of uri (resource locator) this connector expects.
|
Metamodel |
getMetamodel()
Returns the metamodel to which this connector is registered.
|
String |
getName()
Returns the connector name.
|
Object |
getProperty(String name)
Returns the value mapped to the specified property name.
|
Set<String> |
getPropertyNames()
Returns the property names registered to this connector.
|
boolean |
isReader()
Determines whether this connector is meant to read models.
|
boolean |
isResourceSetReader()
Determines whether this connector is meant to read resource sets.
|
boolean |
isWriter()
Determines whether this connector is meant to write models.
|
void |
setProperty(String name,
Object value)
Associates the specified value with the specified property name.
|
getProperties, getProperty, getProperty, getProperty, getProperty, loadProperties, saveProperties, setProperties, setProperties, setProperty, setProperty, setProperty, setProperty
static final String PROPERTY_SINGLE_THREAD
static final String PROPERTY_DIAGRAM_PROVIDER
DiagramProvider
.DiagramProvider
,
Constant Field ValuesMetamodel getMetamodel()
MetamodelConfiguration getConfiguration()
This configuration may differ from the metamodel's one if the connector is declared externally. If connector related resources are required, always use this configuration rather than the metamodel's one, as you don't necessary have the knowledge of how this connector is declared.
String getName()
This name is expected to be unique for a particular metamodel.
Model.read(String, String)
,
Model.write(String, String)
String getClassName()
ModelReader
or ModelWriter
,
which is used to do the job of reading/writing the model.
Note : this is an advanced facility that is not needed in regular cases You should not have to consider this property in typical uses, since the model framework will instantiate and configure by itself the implementation class as requested.
ConnectorKind getKind()
boolean isReader()
ModelReader
.
A connector descriptor is either a reader or a writer, but not both.true
if this connector descriptor is a model reader, false
otherwise.boolean isResourceSetReader()
ResourceSetReader
.true
if this connector descriptor is a resource set reader, false
otherwise.boolean isWriter()
ModelWriter
.
A connector descriptor is either a reader or a writer, but not both.true
if this connector descriptor is a model writer, false
otherwise.List<FileExtensionDescriptor> getFileExtensions()
Typical use of these extensions is to provide a comprehensive file selection dialog box to the end-user. The file uri passed to the underlying connector is not guaranteed to have one of these extensions.
If the connector does not deal with files, the returned list is likely to be empty but this is not required. Always check the
getKind()
to determine the type of uri this connector expects.
FileExtensionDescriptor
,
an empty list if no extensions is registered.FileExtensionDescriptor
FileExtensionDescriptor getDefaultFileExtension()
Typical use is to select this extension as the default one in a file selection dialog box.
null
if not specified.Set<String> getPropertyNames()
These properties may comes from the connector descriptor declaration file. They also can be set dynamically using
setProperty(String, Object)
. As the underlying ModelReader
or ModelWriter
has access to this descriptor,
this can be a facility to pass extra parameters to configure the reader/writer.
getPropertyNames
in interface PropertySet
Object getProperty(String name)
null
if the property is not defined or if it maps to null
.getProperty
in interface PropertySet
name
- the property namevoid setProperty(String name, Object value)
setProperty
in interface PropertySet
name
- the property name.value
- the property value (can be null
)