KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > xml > XMLInterface


1 /* XMLInterface.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.xml;
12
13 import org.enhydra.jawe.xml.elements.*;
14 import org.enhydra.jawe.xml.elements.Package;
15
16 import java.util.*;
17
18 /**
19 * Class which purpose is to provide methods which are
20 * used by classes that represents program apstraction of
21 * XML elements. These methods offers support for reading or
22 * writting an XML document.
23 */

24 public interface XMLInterface {
25
26    void setValidation (boolean isActive);
27
28    public void clearParserErrorMessages ();
29
30    /**
31     * This method has to be called from the newly created package after its
32     * Id is entered.
33     * @param pkg
34     */

35    public void register (Package JavaDoc pkg);
36
37    /**
38     * This method is called when first saving new package, or when saving it with
39     * a different name.
40     * @param filename
41     * @param pkg
42     */

43    public void registerPackageFilename (String JavaDoc filename,Package JavaDoc pkg);
44
45    public boolean isPackageOpened (String JavaDoc pkgId);
46
47    public void putPkgIdToFileContentMapping (String JavaDoc pkgId,String JavaDoc fileContent);
48
49    public String JavaDoc getPackageFileContent (String JavaDoc pkgId);
50
51    public Package JavaDoc getPackageById (String JavaDoc pkgId);
52
53    public Package JavaDoc getPackageByFilename (String JavaDoc filename);
54
55    public Package JavaDoc getExternalPackageByRelativeFilePath (
56    String JavaDoc relativePathToExtPkg,Package JavaDoc rootPkg);
57
58    public String JavaDoc getAbsoluteFilePath (Package JavaDoc pkg);
59
60    public Collection getAllPackages ();
61
62    public Collection getAllPackageIds ();
63
64    public Collection getAllPackageFilenames ();
65
66    public boolean doesPackageFileExists (String JavaDoc xmlFile);
67
68    public String JavaDoc getParentDirectory (Package JavaDoc pkg);
69
70    public Package JavaDoc openPackage (String JavaDoc pkgReference,boolean openFromStream);
71
72    public Package JavaDoc parseDocument (String JavaDoc toParse,boolean isFile);
73
74    /**
75     * This method should be called immediatelly after opening a document,
76     * otherwise, messages could be invalid.
77     * @return The map which keys are opened packages, and values are the sets
78     * of errors for corresponding package.
79     */

80    public Map getParsingErrorMessages ();
81
82    public void closePackage (String JavaDoc pkgId);
83
84    public void closeAllPackages ();
85
86    public String JavaDoc getIDFromFile (String JavaDoc xmlFile);
87
88 }
89
90
Popular Tags