public interface ModelReader
The implementation class specified by the connector descriptor must:
If you intent to read XML documents, the framework provides facilities you should consider.
Clients may implement this interface.
XMLUtils.newParser()
,
XMLDefaultHandler
Modifier and Type | Method and Description |
---|---|
void |
read(String uri,
Model model,
ConnectorContext context)
Reads a model from the specified uri (resource locator).
|
void read(String uri, Model model, ConnectorContext context) throws CoreException
The uri denotes a resource location to handle. The form of the uri depends on the connector kind. If this is a file connector, this uri is
expected to be a valid file path. If this is a "no uri" connector, this uri is expected to be null
or an empty String
.
The specified model is empty when the reader starts. The implementation is supposed to read the specified uri resource and to create model
elements. Model elements will generally be created using the model Model.create(String)
method. If these elements are created outside
of the model (using an EMF factory directly for example), they have to be attached to the model using the Model.add(MDWObject)
method.
The context can be used to access a variety of properties and is to be used to check for cancellation.
uri
- the location of a resource to read (can be null
).model
- the model in which model elements must be created.context
- the context in which this reader runs.CoreException
- if anything prevents the connector to read the model.ConnectorDescriptor.getKind()