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 org.apache.uima.resource.metadata.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 org.apache.uima.resource.metadata.FsIndexCollection
createFsIndexCollection
(Class<?> componentClass) Create index configuration data for a given class definition using reflection and the configuration parameter annotation.static org.apache.uima.resource.metadata.FsIndexCollection
createFsIndexCollection
(String... descriptorNames) Creates aFsIndexCollection
from descriptor names.static org.apache.uima.resource.metadata.FsIndexCollection
createFsIndexCollection
(Collection<? extends org.apache.uima.resource.metadata.FsIndexDescription> descriptions) Create a index collection from a set of descriptions.static org.apache.uima.resource.metadata.FsIndexCollection
createFsIndexCollection
(org.apache.uima.resource.metadata.FsIndexDescription... descriptions) Create a index collection from a set of descriptions.static org.apache.uima.resource.metadata.FsIndexDescription
createFsIndexDescription
(String label, String kind, String typeName, boolean useTypePriorities, org.apache.uima.resource.metadata.FsIndexKeyDescription... keys) static org.apache.uima.resource.metadata.FsIndexKeyDescription
createFsIndexKeyDescription
(String featureName) static org.apache.uima.resource.metadata.FsIndexKeyDescription
createFsIndexKeyDescription
(String featureName, int comparator) static org.apache.uima.resource.metadata.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
public static org.apache.uima.resource.metadata.FsIndexCollection createFsIndexCollection(Class<?> componentClass) 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 org.apache.uima.resource.metadata.FsIndexDescription createFsIndexDescription(String label, String kind, String typeName, boolean useTypePriorities, org.apache.uima.resource.metadata.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
public static org.apache.uima.resource.metadata.FsIndexCollection createFsIndexCollection(org.apache.uima.resource.metadata.FsIndexDescription... descriptions) Create a index collection from a set of descriptions.- Parameters:
descriptions
- the index descriptions- Returns:
- the index collection
-
createFsIndexCollection
public static org.apache.uima.resource.metadata.FsIndexCollection createFsIndexCollection(Collection<? extends org.apache.uima.resource.metadata.FsIndexDescription> descriptions) Create a index collection from a set of descriptions.- Parameters:
descriptions
- the index descriptions- Returns:
- the index collection
-
createFsIndexKeyDescription
public static org.apache.uima.resource.metadata.FsIndexKeyDescription createFsIndexKeyDescription(String featureName) - Parameters:
featureName
- the feature to index- Returns:
- the index key description
-
createFsIndexKeyDescription
public static org.apache.uima.resource.metadata.FsIndexKeyDescription createFsIndexKeyDescription(String featureName, int comparator) - Parameters:
featureName
- the feature to indexcomparator
- the index comparator- Returns:
- the index key description
-
createFsIndexCollection
public static org.apache.uima.resource.metadata.FsIndexCollection createFsIndexCollection(String... descriptorNames) 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
public static org.apache.uima.resource.metadata.FsIndexCollection createTypeSystemDescriptionFromPath(String... descriptorURIs) 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
public static org.apache.uima.resource.metadata.FsIndexCollection createFsIndexCollection() throws org.apache.uima.resource.ResourceInitializationExceptionCreates 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:
org.apache.uima.resource.ResourceInitializationException
- if the index collection could not be assembled
-
scanIndexDescriptors
public static String[] scanIndexDescriptors() throws org.apache.uima.resource.ResourceInitializationExceptionGet 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:
org.apache.uima.resource.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.
-