KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > xpdl > XMLInterface


1 package org.enhydra.shark.xpdl;
2
3 import java.util.Collection JavaDoc;
4 import java.util.List JavaDoc;
5 import java.util.Map JavaDoc;
6
7 import org.enhydra.shark.xpdl.elements.Package;
8
9 /**
10 * Class which purpose is to provide methods which are
11 * used by classes that represents program apstraction of
12 * XML elements. These methods offers support for reading or
13 * writting an XML document.
14  *
15  * @author Sasa Bojanic
16  */

17 public interface XMLInterface {
18
19    void setValidation (boolean isActive);
20
21    public void clearParserErrorMessages ();
22
23    public boolean isPackageOpened (String JavaDoc pkgId);
24
25    public Package JavaDoc getPackageById (String JavaDoc pkgId);
26
27    public Package JavaDoc getPackageByIdAndVersion (String JavaDoc pkgId,String JavaDoc version);
28
29    public Package JavaDoc getPackageByFilename (String JavaDoc filename);
30
31    public Package JavaDoc getExternalPackageByRelativeFilePath (
32    String JavaDoc relativePathToExtPkg,Package JavaDoc rootPkg);
33
34    public String JavaDoc getAbsoluteFilePath (Package JavaDoc pkg);
35
36    public Collection JavaDoc getAllPackages ();
37
38    public Collection JavaDoc getAllPackageIds ();
39
40    public Collection JavaDoc getAllPackageVersions (String JavaDoc pkgId);
41
42    public Collection JavaDoc getAllPackageFilenames ();
43
44    public boolean doesPackageFileExists (String JavaDoc xmlFile);
45
46    public String JavaDoc getParentDirectory (Package JavaDoc pkg);
47
48    public Package JavaDoc openPackage (String JavaDoc pkgReference,boolean handleExternalPackages);
49
50    public Package JavaDoc openPackagesFromStreams (List JavaDoc pkgContents,boolean isFileStream) throws Exception JavaDoc;
51
52    public Package JavaDoc openPackageFromStream (byte[] pkgContent,boolean isFileStream) throws Exception JavaDoc;
53
54    public Package JavaDoc parseDocument (String JavaDoc toParse,boolean isFile);
55
56    /**
57     * This method should be called immediatelly after opening a document,
58     * otherwise, messages could be invalid.
59     * @return The map which keys are opened packages, and values are the sets
60     * of errors for corresponding package.
61     */

62    public Map JavaDoc getParsingErrorMessages ();
63
64    public List JavaDoc closePackages (String JavaDoc pkgId);
65
66    public Package JavaDoc closePackageVersion (String JavaDoc pkgId,String JavaDoc version);
67
68    public void closeAllPackages ();
69
70    public String JavaDoc getIdFromFile (String JavaDoc xmlFile);
71
72    public void synchronizePackages (XMLInterface xmlInterface);
73 }
74
75
Popular Tags