GATE
Version 3.1-2270

gate.creole
Class AbstractLanguageResource

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.creole.AbstractLanguageResource
All Implemented Interfaces:
LanguageResource, Resource, FeatureBearer, NameBearer, Serializable
Direct Known Subclasses:
AnnotationSchema, CorpusImpl, DocumentFormat, DocumentImpl, GazetteerList, IndexFileWordNetImpl, LinearDefinition, MappingDefinition, MutableLexicalKnowledgeBaseImpl, OntoLexKBImpl, ProtegeProjectName, SerialCorpusImpl, TaxonomyImpl

public abstract class AbstractLanguageResource
extends AbstractResource
implements LanguageResource

A convenience implementation of LanguageResource with some default code.

See Also:
Serialized Form

Field Summary
protected  DataStore dataStore
          The data store this LR lives in.
protected  Object lrPersistentId
          The persistence ID of this LR.
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Constructor Summary
AbstractLanguageResource()
           
 
Method Summary
 void cleanup()
          Clear the internal state of the resource
 DataStore getDataStore()
          Get the data store that this LR lives in.
 Object getLRPersistenceId()
          Returns the persistence id of this LR, if it has been stored in a datastore.
 LanguageResource getParent()
          Returns the parent LR of this LR.
 boolean isModified()
          Returns true of an LR has been modified since the last sync.
 void setDataStore(DataStore dataStore)
          Set the data store that this LR lives in.
 void setLRPersistenceId(Object lrID)
          Sets the persistence id of this LR.
 void setParent(LanguageResource parentLR)
          Sets the parent LR of this LR.
 void sync()
          Save: synchonise the in-memory image of the LR with the persistent image.
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.Resource
getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

dataStore

protected transient DataStore dataStore
The data store this LR lives in.


lrPersistentId

protected transient Object lrPersistentId
The persistence ID of this LR. Only set, when dataStore is.

Constructor Detail

AbstractLanguageResource

public AbstractLanguageResource()
Method Detail

getDataStore

public DataStore getDataStore()
Get the data store that this LR lives in. Null for transient LRs.

Specified by:
getDataStore in interface LanguageResource

setDataStore

public void setDataStore(DataStore dataStore)
                  throws PersistenceException
Set the data store that this LR lives in.

Specified by:
setDataStore in interface LanguageResource
Throws:
PersistenceException

getLRPersistenceId

public Object getLRPersistenceId()
Returns the persistence id of this LR, if it has been stored in a datastore. Null otherwise.

Specified by:
getLRPersistenceId in interface LanguageResource

setLRPersistenceId

public void setLRPersistenceId(Object lrID)
Sets the persistence id of this LR. To be used only in the Factory and DataStore code.

Specified by:
setLRPersistenceId in interface LanguageResource

sync

public void sync()
          throws PersistenceException,
                 SecurityException
Save: synchonise the in-memory image of the LR with the persistent image.

Specified by:
sync in interface LanguageResource
Throws:
PersistenceException
SecurityException

cleanup

public void cleanup()
Clear the internal state of the resource

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractResource

isModified

public boolean isModified()
Returns true of an LR has been modified since the last sync. Always returns false for transient LRs.

Specified by:
isModified in interface LanguageResource

getParent

public LanguageResource getParent()
                           throws PersistenceException,
                                  SecurityException
Returns the parent LR of this LR. Only relevant for LRs that support shadowing. Most do not by default.

Specified by:
getParent in interface LanguageResource
Throws:
PersistenceException
SecurityException

setParent

public void setParent(LanguageResource parentLR)
               throws PersistenceException,
                      SecurityException
Sets the parent LR of this LR. Only relevant for LRs that support shadowing. Most do not by default.

Specified by:
setParent in interface LanguageResource
Throws:
PersistenceException
SecurityException

GATE
Version 3.1-2270