com.metamatrix.api.core.xmi
Interface XMIReaderAdapter


public interface XMIReaderAdapter

Interface through which metadata defined via XMI is processed. This interface should be implemented by a component that is to create business objects for XMI metadata content.

The XMI processor is designed to hide as much as possible the semantics of XMI by simply constructing FeatureInfo and EntityInfo instances as an XMI stream is processed. These info classes are thus similar to SAX events of a SAX XML document parser.

This interface is designed such that an implementation return business objects (which can be anyting, including null) in each of the methods. Then, when subsequent methods are invoked for XMI content related to that for previously invoked methods, the caller will pass in method calls the appropriate business object. Essentially, this hands back to the implementation a business object that it created and therefore knows what that related metadata represents.


Method Summary
 java.lang.Object createEntity(EntityInfo entityInfo, java.lang.Object parentBusObj)
          Create a new Entity with the specified information.
 void createFeature(FeatureInfo featureInfo, java.lang.Object parentBusObj)
          Create a new Feature with the specified information.
 void finishDocument()
          Notify the implementation that the XMI content has been completely processed.
 void finishEntity(java.lang.Object busObj)
          Notify the implementation that the specified entity has been completed and will have no additional features.
 void finishFeature(FeatureInfo featureInfo, java.lang.Object parentBusObj)
          Notify the implementation that the specified feature has been completed and will have no additions or changes.
 XMIHeader getHeader()
          Returns the information in the XMI header
 MessageList getMessages()
          Obtain any messages that have been generated during the use of this interface.
 java.lang.Object setHeader(XMIHeader xmiHeader)
          Define the information in the XMI header
 

Method Detail

getHeader

XMIHeader getHeader()
Returns the information in the XMI header

Returns:
The object that contains the information in the XMI header; may be null

setHeader

java.lang.Object setHeader(XMIHeader xmiHeader)
Define the information in the XMI header

Parameters:
xmiHeader - The object that contains the information in the XMI header; may not be null
Returns:
the info object created for the header information; may be null

createEntity

java.lang.Object createEntity(EntityInfo entityInfo,
                              java.lang.Object parentBusObj)
Create a new Entity with the specified information.

Parameters:
entityInfo - the EntityInfo that contains the information about the entity to be created; may not be null
parentBusObj - the object that was the object returned from this method when the this entity's parent entity was created; may be null
Returns:
the business object that represents the created entity; may be null. This object may be passed to subsequent method invocations on this interface when the created entity is to be referenced

createFeature

void createFeature(FeatureInfo featureInfo,
                   java.lang.Object parentBusObj)
Create a new Feature with the specified information. Note that this method may be called multiple times for the same featureInfo instance if that feature has multiple values.

Parameters:
featureInfo - the FeatureInfo that contains the information about the feature to be created; may not be null
parentBusObj - the object that was the object returned from this method when the this feature's parent entity was created; may be null

finishEntity

void finishEntity(java.lang.Object busObj)
Notify the implementation that the specified entity has been completed and will have no additional features.

Parameters:
busObj - the business object that is completed and that was returned from the corresponding createEntity method; may be null

finishFeature

void finishFeature(FeatureInfo featureInfo,
                   java.lang.Object parentBusObj)
Notify the implementation that the specified feature has been completed and will have no additions or changes.

Parameters:
featureInfo - the FeatureInfo that contains the information about the feature that is now completed; may not be null
parentBusObj - the business object returned from the createEntity method for the entity to which the feature applies; may be null

finishDocument

void finishDocument()
Notify the implementation that the XMI content has been completely processed.


getMessages

MessageList getMessages()
Obtain any messages that have been generated during the use of this interface.

Returns:
the collection of messages


Copyright © 2009. All Rights Reserved.