org.LexGrid.LexBIG.Impl.loaders
Class TextLoaderImpl
java.lang.Object
org.LexGrid.LexBIG.Impl.Extensions.AbstractExtendable
org.LexGrid.LexBIG.Impl.loaders.BaseLoader
org.LexGrid.LexBIG.Impl.loaders.TextLoaderImpl
- All Implemented Interfaces:
- java.io.Serializable, Extendable, Loader, Text_Loader, StatusReporter
public class TextLoaderImpl
- extends BaseLoader
- implements Text_Loader
Class to load a Text files into the LexBIG API.
- Version:
- subversion $Revision: $ checked in on $Date: $
- Author:
- Dan Armbrust
- See Also:
- Serialized Form
Methods inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader |
addBooleanOptionValue, baseLoad, buildRootNode, clearLog, constructVersionPairsFromCodingSchemes, createCachingMessageDirectorIF, createDefaultInserter, createDefaultInserter, doesOptionExist, doIndex, doPostProcessing, doTransitiveAndIndex, doTransitiveTable, getAbsoluteCodingSchemeVersionReferenceFromOptionString, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getDescription, getLoaderPreferences, getLog, getLogger, getManifestUtil, getMessageDirector, getName, getOptions, getPostProcessor, getProvider, getResourceUri, getStatus, getStringFromURI, getVersion, isDoApplyPostLoadManifest, isDoComputeTransitiveClosure, isDoIndexing, isDoRegister, isDoRemoveOnFailure, isInUse, load, lock, persistCodingSchemeToDatabase, persistCodingSchemeToDatabase, register, register, setCachingMessageDirectorIF, setCodingSchemeManifest, setCodingSchemeManifestURI, setCodingSchemeReferences, setDoApplyPostLoadManifest, setDoComputeTransitiveClosure, setDoIndexing, setDoRegister, setDoRemoveOnFailure, setInUse, setLoaderPreferences, setLoaderPreferences, setManifestUtil, setOptions, setResourceUri, setStatus, unlock, urnVersionPairToAbsoluteCodingSchemeVersionReference |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.LexGrid.LexBIG.Extensions.Load.Loader |
clearLog, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getLoaderPreferences, getLog, getOptions, getStatus, load, setCodingSchemeManifest, setCodingSchemeManifestURI, setLoaderPreferences, setLoaderPreferences |
DELIMITER_OPTION
public static final java.lang.String DELIMITER_OPTION
- See Also:
- Constant Field Values
FORCE_FORMAT_B_OPTION
public static java.lang.String FORCE_FORMAT_B_OPTION
TextLoaderImpl
public TextLoaderImpl()
validate
public void validate(java.net.URI uri,
java.lang.Character delimiter,
boolean triplesFormat,
int validationLevel)
throws LBParameterException
- Description copied from interface:
Text_Loader
- Validate content for a candidate resource without performing a load.
Returns without exception if validation succeeds.
- Specified by:
validate
in interface Text_Loader
- Parameters:
uri
- URI corresponding to the text file.delimiter
- Optional - defaults to tab the character used to delimit pair
or triple components and the nesting.triplesFormat
- Force the converter to read a doubles file (name/description)
as a triples file (code/name/description) So it reads codes
and names intead of names and descriptionsvalidationLevel
- Supported levels of validation include: 0 = Verify file syntax
against the indicated format.
- Throws:
LBParameterException
load
public void load(java.net.URI source,
java.lang.Character delimiter,
boolean readDoublesAsTriples,
boolean stopOnErrors,
boolean async)
throws LBException
- Description copied from interface:
Text_Loader
- Load content from a candidate resource. This will also result in implicit
generation of standard indices required by the LexBIG runtime.
An exception is raised if resources cannot be accessed or another load
operation is already in progress.
- Specified by:
load
in interface Text_Loader
- Parameters:
source
- URI corresponding to the text file.delimiter
- Optional - defaults to tab the character used to delimit pair
or triple components and the nesting.readDoublesAsTriples
- Force the converter to read a doubles file (name/description)
as a triples file (code/name/description) So it reads codes
and names instead of names and descriptions.stopOnErrors
- True means stop if any load error is detected. False means
attempt to load what can be loaded if recoverable errors are
encountered.async
- Flag controlling whether load occurs in the calling thread.
If true, the load will occur in a separate asynchronous process.
If false, this method blocks until the load operation
completes or fails. Regardless of setting, the getStatus and
getLog calls are used to fetch results.
- Throws:
LBException
doLoad
protected URNVersionPair[] doLoad()
throws CodingSchemeAlreadyLoadedException
- Specified by:
doLoad
in class BaseLoader
- Throws:
CodingSchemeAlreadyLoadedException
main
public static void main(java.lang.String[] args)
declareAllowedOptions
protected OptionHolder declareAllowedOptions(OptionHolder holder)
- Specified by:
declareAllowedOptions
in class BaseLoader
buildExtensionDescription
protected ExtensionDescription buildExtensionDescription()
- Description copied from class:
AbstractExtendable
- Builds the extension description.
- Specified by:
buildExtensionDescription
in class AbstractExtendable
- Returns:
- the extension description
getOntologyFormat
public OntologyFormat getOntologyFormat()
- Description copied from interface:
Loader
- Return the ontology format the loader can handle
- Specified by:
getOntologyFormat
in interface Loader
- Overrides:
getOntologyFormat
in class BaseLoader