KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > xml > querying > impl > xtas > resource > Resource


1 package org.exoplatform.services.xml.querying.impl.xtas.resource;
2
3 import java.io.IOException JavaDoc;
4 import org.exoplatform.services.xml.querying.ConfigException;
5 import org.exoplatform.services.xml.querying.UniFormTransformationException;
6 import org.exoplatform.services.xml.querying.XMLWellFormedData;
7
8 /**
9  * Abstract class encapsulated Persistence storage for the XML data
10  * @version $Id: Resource.java 566 2005-01-25 12:50:49Z kravchuk $
11  */

12 abstract public class Resource
13 {
14     protected String JavaDoc resourceId;
15
16     /**
17      * Loads XML from some resource
18      */

19     public abstract XMLWellFormedData load() throws UniFormTransformationException, IOException JavaDoc ;
20
21     /**
22      * Stores XML into some resource
23      */

24     public abstract void save(XMLWellFormedData tree) throws UniFormTransformationException, IOException JavaDoc ;
25
26     /**
27      * Creates resource
28      */

29     public abstract void create(XMLWellFormedData initTree) throws IOException JavaDoc ;
30
31     /**
32      * drops resource
33      */

34     public abstract void drop() throws IOException JavaDoc;
35
36     /**
37      * Initializes Resource's context (if any)
38      */

39     public abstract void setContext(Object JavaDoc context);
40
41     /**
42      * Initializes Resource
43      */

44     public void init(String JavaDoc resourceId) throws ConfigException
45     {
46        this.resourceId = resourceId;
47     }
48
49     public String JavaDoc toString()
50     {
51        return this.resourceId;
52     }
53
54     /**
55      * Returns first element will be insert to any query on this resource
56      */

57     public String JavaDoc getXPathPrefix()
58     {
59        return null;
60     }
61
62     /**
63      * Closes Resource
64      */

65     public void close()
66     {
67     }
68
69 }
70
Popular Tags