Search in sources :

Example 1 with ConditionalSerialAnalyserController

use of gate.creole.ConditionalSerialAnalyserController in project gate-core by GateNLP.

the class ConditionalSerialAnalyserControllerPersistence method createObject.

/**
 * Creates a new object from the data contained. This new object is supposed
 * to be a copy for the original object used as source for data extraction.
 */
@Override
public Object createObject() throws PersistenceException, ResourceInstantiationException {
    ConditionalSerialAnalyserController sac = (ConditionalSerialAnalyserController) super.createObject();
    sac.setCorpus((Corpus) PersistenceManager.getTransientRepresentation(corpus, resourceName, initParamOverrides));
    return sac;
}
Also used : ConditionalSerialAnalyserController(gate.creole.ConditionalSerialAnalyserController)

Example 2 with ConditionalSerialAnalyserController

use of gate.creole.ConditionalSerialAnalyserController in project gate-core by GateNLP.

the class ConditionalSerialAnalyserControllerPersistence method extractDataFromSource.

/**
 * Populates this Persistence with the data that needs to be stored from the
 * original source object.
 */
@Override
public void extractDataFromSource(Object source) throws PersistenceException {
    if (!(source instanceof ConditionalSerialAnalyserController)) {
        throw new UnsupportedOperationException(getClass().getName() + " can only be used for " + ConditionalSerialAnalyserController.class.getName() + " objects!\n" + source.getClass().getName() + " is not a " + ConditionalSerialAnalyserController.class.getName());
    }
    super.extractDataFromSource(source);
    ConditionalSerialAnalyserController sac = (ConditionalSerialAnalyserController) source;
    corpus = PersistenceManager.getPersistentRepresentation(sac.getCorpus());
}
Also used : ConditionalSerialAnalyserController(gate.creole.ConditionalSerialAnalyserController)

Aggregations

ConditionalSerialAnalyserController (gate.creole.ConditionalSerialAnalyserController)2