svn commit: r13281 - trunk/src/model/src/org/argouml/model/XmiReader.java
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: tfmorris
Date: 2007-08-09 12:43:02-0700
New Revision: 13281
Modified:
trunk/src/model/src/org/argouml/model/XmiReader.java
Log:
Extend XmiReader API to manage search path for resolving external references.
Enhance reference resolver to support cross file references, resource based profiles, and writing as well as reading
Modified: trunk/src/model/src/org/argouml/model/XmiReader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/XmiReader.java?view=diff&rev=13281&p1=trunk/src/model/src/org/argouml/model/XmiReader.java&p2=trunk/src/model/src/org/argouml/model/XmiReader.java&r1=13280&r2=13281
==============================================================================
--- trunk/src/model/src/org/argouml/model/XmiReader.java (original)
+++ trunk/src/model/src/org/argouml/model/XmiReader.java 2007-08-09 12:43:02-0700
@@ -24,23 +24,26 @@
package org.argouml.model;
+import java.net.URL;
import java.util.Collection;
+import java.util.List;
import java.util.Map;
import org.xml.sax.InputSource;
/**
- * 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.
- *
+ * XMI file reader to deserialize a model into the model repository.
+ * <p>
* @author Bob Tarling
*/
public interface XmiReader {
-
+ /* Implementation Note:
+ * 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 implementation to be garbage collected when an XmiReader instance
+ * falls out of scope.
+ */
+
/**
* Parse a given inputsource to a collection of top level model elements.
*
@@ -69,6 +72,7 @@
*/
Collection parse(InputSource pIs, boolean profile) throws UmlException;
+
/**
* @return the map
*/
@@ -109,4 +113,35 @@
* @return the tag name
*/
public String getTagName();
+
+ /**
+ * Get the list of paths to be searched when looking for XMI files to
+ * resolve external references with. The list is maintained in a static
+ * structure shared by all instances.
+ *
+ * @param paths an array of directory paths
+ */
+ public List<String> getSearchPath();
+
+ /**
+ * Add a path to the list of paths to be searched when looking for XMI files to
+ * resolve external references with. The list is maintained in a static
+ * structure shared by all instances.
+ * <p>
+ * TODO: It's desirable to have separate search paths for separate files,
+ * but more work is required in ArgoUML so that it knows how to maintain
+ * separate contexts for the profiles and user models.
+ *
+ * @param paths an array of directory paths
+ */
+ public void addSearchPath(String path);
+
+ /**
+ * Remove a path from the list of paths to be searched when looking for XMI files to
+ * resolve external references with. The list is maintained in a static
+ * structure shared by all instances.
+ *
+ * @param paths an array of directory paths
+ */
+ public void removeSearchPath(String path);
}