Package org.apache.uima.fit.factory
Class FsIndexFactory
java.lang.Object
org.apache.uima.fit.factory.FsIndexFactory
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Comparator that orders FeatureStructures according to the reverse order of their key features (the opposite order as that defined by STANDARD_COMPARE).static final int
Comparator that orders FeatureStructures according to the standard order of their key features. -
Method Summary
Modifier and TypeMethodDescriptionstatic FsIndexCollection
Creates aFsIndexCollection
from all index descriptions that can be found via the pattern specified in the system propertyorg.apache.uima.fit.fsindex.import_pattern
or via theMETA-INF/org.apache.uima.fit/fsindexes.txt
files in the classpath.static FsIndexCollection
createFsIndexCollection
(Class<?> componentClass) Create index configuration data for a given class definition using reflection and the configuration parameter annotation.static FsIndexCollection
createFsIndexCollection
(String... descriptorNames) Creates aFsIndexCollection
from descriptor names.static FsIndexCollection
createFsIndexCollection
(Collection<? extends FsIndexDescription> descriptions) Create a index collection from a set of descriptions.static FsIndexCollection
createFsIndexCollection
(FsIndexDescription... descriptions) Create a index collection from a set of descriptions.static FsIndexDescription
createFsIndexDescription
(String label, String kind, String typeName, boolean useTypePriorities, FsIndexKeyDescription... keys) static FsIndexKeyDescription
createFsIndexKeyDescription
(String featureName) static FsIndexKeyDescription
createFsIndexKeyDescription
(String featureName, int comparator) static FsIndexCollection
createTypeSystemDescriptionFromPath
(String... descriptorURIs) Creates aFsIndexCollection
from a descriptor filestatic void
Force rescan of index descriptors.static String[]
Get all currently accessible index descriptor locations.
-
Field Details
-
STANDARD_COMPARE
public static final int STANDARD_COMPAREComparator that orders FeatureStructures according to the standard order of their key features. For integer and float values, this is the standard linear order, and for strings it is lexicographic order.- See Also:
-
REVERSE_STANDARD_COMPARE
public static final int REVERSE_STANDARD_COMPAREComparator that orders FeatureStructures according to the reverse order of their key features (the opposite order as that defined by STANDARD_COMPARE).- See Also:
-
-
Method Details
-
createFsIndexCollection
Create index configuration data for a given class definition using reflection and the configuration parameter annotation.- Parameters:
componentClass
- the class to analyze- Returns:
- the index collection
-
createFsIndexDescription
public static FsIndexDescription createFsIndexDescription(String label, String kind, String typeName, boolean useTypePriorities, FsIndexKeyDescription... keys) - Parameters:
label
- the index labelkind
- the type of indextypeName
- the indexed feature structure typeuseTypePriorities
- whether to respect type prioritieskeys
- the index keys- Returns:
- the index description
-
createFsIndexCollection
Create a index collection from a set of descriptions.- Parameters:
descriptions
- the index descriptions- Returns:
- the index collection
-
createFsIndexCollection
public static FsIndexCollection createFsIndexCollection(Collection<? extends FsIndexDescription> descriptions) Create a index collection from a set of descriptions.- Parameters:
descriptions
- the index descriptions- Returns:
- the index collection
-
createFsIndexKeyDescription
- Parameters:
featureName
- the feature to index- Returns:
- the index key description
-
createFsIndexKeyDescription
- Parameters:
featureName
- the feature to indexcomparator
- the index comparator- Returns:
- the index key description
-
createFsIndexCollection
Creates aFsIndexCollection
from descriptor names.- Parameters:
descriptorNames
- The fully qualified, Java-style, dotted descriptor names.- Returns:
- a
FsIndexCollection
that includes the indexes from all of the specified files.
-
createTypeSystemDescriptionFromPath
Creates aFsIndexCollection
from a descriptor file- Parameters:
descriptorURIs
- The descriptor file paths.- Returns:
- A
FsIndexCollection
that includes the indexes from all of the specified files.
-
createFsIndexCollection
Creates aFsIndexCollection
from all index descriptions that can be found via the pattern specified in the system propertyorg.apache.uima.fit.fsindex.import_pattern
or via theMETA-INF/org.apache.uima.fit/fsindexes.txt
files in the classpath.- Returns:
- the auto-scanned indexes.
- Throws:
ResourceInitializationException
- if the index collection could not be assembled
-
scanIndexDescriptors
Get all currently accessible index descriptor locations. A scan is actually only performed on the first call and the locations are cached. To force a re-scan useforceIndexDescriptorsScan()
.- Returns:
- an array of locations.
- Throws:
ResourceInitializationException
- if the locations could not be resolved.
-
forceIndexDescriptorsScan
public static void forceIndexDescriptorsScan()Force rescan of index descriptors. The next call toscanIndexDescriptors()
will rescan all auto-import locations.
-