LanguageResource.java
01 /*
02  *  LanguageResource.java
03  *
04  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
05  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
06  *
07  *  This file is part of GATE (see http://gate.ac.uk/), and is free
08  *  software, licenced under the GNU Library General Public License,
09  *  Version 2, June 1991 (in the distribution as file licence.html,
10  *  and also available at http://gate.ac.uk/gate/licence.html).
11  *
12  *  Hamish Cunningham, 11/Feb/2000
13  *
14  *  $Id: LanguageResource.java 12006 2009-12-01 17:24:28Z thomas_heitz $
15  */
16 
17 package gate;
18 
19 import gate.persist.PersistenceException;
20 import gate.security.SecurityException;
21 
22 /** Models all sorts of language resources.
23   */
24 public interface LanguageResource extends Resource
25 {
26   /** Get the data store that this LR lives in. Null for transient LRs. */
27   public DataStore getDataStore();
28 
29   /** Set the data store that this LR lives in. */
30   public void setDataStore(DataStore dataStorethrows PersistenceException;
31 
32   /** Returns the persistence id of this LR, if it has been stored in
33    *  a datastore. Null otherwise.
34    */
35   public Object getLRPersistenceId();
36 
37   /** Sets the persistence id of this LR. To be used only in the
38    *  Factory and DataStore code.
39    */
40   public void setLRPersistenceId(Object lrID);
41 
42   /** Save: synchonise the in-memory image of the LR with the persistent
43     * image.
44     */
45   public void sync() throws PersistenceException,SecurityException;
46 
47   /**
48    * Returns true of an LR has been modified since the last sync.
49    * Always returns false for transient LRs.
50    */
51   public boolean isModified();
52 
53   /**
54    * Returns the parent LR of this LR.
55    * Only relevant for LRs that support shadowing. Most do not by default.
56    */
57   public LanguageResource getParent()
58     throws PersistenceException,SecurityException;
59 
60   /**
61    * Sets the parent LR of this LR.
62    * Only relevant for LRs that support shadowing. Most do not by default.
63    */
64   public void setParent(LanguageResource parentLR)
65     throws PersistenceException,SecurityException;
66 
67 // interface LanguageResource