org.argouml.model
Interface XmiReader


public interface XmiReader

A wrapper around the genuine XmiReader that provides public access with no knowledge of actual UML implementation. Unlike many of the interfaces to the model there is no control to force a single instance of an XmiReader. This is to allow work objects generated by the imlementation to be garbage collected when an XmiReader instance falls out of scope.


Method Summary
 int getIgnoredElementCount()
          Return the count of elements read during the last XMI read which were on the ignore list.
 String[] getIgnoredElements()
          Returns list of element names which will be ignored during XMI import if they cause an error.
 Map getXMIUUIDToObjectMap()
           
 Collection parse(InputSource pIs)
          Parse a given inputsource to a collection of top level model elements.
 Collection parse(InputSource pIs, boolean profile)
          Parse a given inputsource to a collection of top level model elements.
 Object parseToModel(InputSource pIs)
          Deprecated. use parse()
 boolean setIgnoredElements(String[] elementNames)
          Set the list of element names for which errors should be ignored when reading the XMI file.
 

Method Detail

parseToModel

public Object parseToModel(InputSource pIs)
                    throws UmlException
Deprecated. use parse()

Parse a given inputsource to a model.

Parameters:
pIs - the input source for parsing
Returns:
MModel the UML model
Throws:
UmlException - on any error

parse

public Collection parse(InputSource pIs)
                 throws UmlException
Parse a given inputsource to a collection of top level model elements.

Parameters:
pIs - the input source for parsing
Returns:
a collection of top level elements
Throws:
UmlException - on any error

parse

public Collection parse(InputSource pIs,
                        boolean profile)
                 throws UmlException
Parse a given inputsource to a collection of top level model elements.

Parameters:
pIs - the input source for parsing
profile - true if the resulting model will be used as a profile. Profiles are read-only and will not be written back out when the model data is written.
Returns:
a collection of top level elements
Throws:
UmlException - on any error

getXMIUUIDToObjectMap

public Map getXMIUUIDToObjectMap()
Returns:
the map

setIgnoredElements

public boolean setIgnoredElements(String[] elementNames)
Set the list of element names for which errors should be ignored when reading the XMI file. The common one is "UML:Diagram" but it can be any element which is not in the metamodel.

This may not be supported by all implementations. The method will return false if unsupported.

Parameters:
elementNames - array of element names which reader should ignore
Returns:
returns false if the operation is unsupported

getIgnoredElements

public String[] getIgnoredElements()
Returns list of element names which will be ignored during XMI import if they cause an error.

Returns:
array of names (Strings)

getIgnoredElementCount

public int getIgnoredElementCount()
Return the count of elements read during the last XMI read which were on the ignore list.

Returns:
the count


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook