Class ImportResolver<DESCRIPTOR extends MetaDataObject,COLLECTIBLE extends MetaDataObject>
java.lang.Object
org.apache.uima.resource.metadata.impl.ImportResolver<DESCRIPTOR,COLLECTIBLE>
class ImportResolver<DESCRIPTOR extends MetaDataObject,COLLECTIBLE extends MetaDataObject>
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
private class
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionImportResolver
(Function<DESCRIPTOR, ImportResolver.DescriptorAdapter> aAdapterFactory) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
collectAll
(ImportResolver.DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> aWrapper, Map<ImportResolver<DESCRIPTOR, COLLECTIBLE>.Key, COLLECTIBLE> aAllCollectibleObjects) private DESCRIPTOR
getOrLoadDescription
(Import aImport, URL aAbsUrl, Map<String, XMLizable> aImportCache, ImportResolver.DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> aWrapper) private DESCRIPTOR
loadDescriptor
(Import aImport, URL aAbsUrl, Map<String, XMLizable> aImportCache, ImportResolver.ParserFunction<DESCRIPTOR> aParserFunction) (package private) void
resolveImports
(DESCRIPTOR aDesc, Collection<String> aAlreadyImportedURLs, ResourceManager aResourceManager) Deprecated.(package private) void
resolveImports
(DESCRIPTOR aDesc, ResourceManager aResourceManager) Resolves the imports in the given descriptor.private void
resolveImports
(ImportResolver.DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> aWrapper, Set<String> aAlreadyVisited, Map<ImportResolver<DESCRIPTOR, COLLECTIBLE>.Key, COLLECTIBLE> aAllCollectedObjects, Deque<String> aStack, ResourceManager aResourceManager) Recursively traverses the import graph and collects all imported collectible objects.
-
Field Details
-
adapterFactory
private Function<DESCRIPTOR extends MetaDataObject,ImportResolver.DescriptorAdapter<DESCRIPTOR extends MetaDataObject, adapterFactoryCOLLECTIBLE extends MetaDataObject>>
-
-
Constructor Details
-
ImportResolver
ImportResolver(Function<DESCRIPTOR, ImportResolver.DescriptorAdapter> aAdapterFactory)
-
-
Method Details
-
resolveImports
Resolves the imports in the given descriptor.- Parameters:
aDesc
- the descriptor in which to resolve the imports.aResourceManager
- the resource manager used to load the imported descriptions. If this argument isnull
then a new default resource manager is created.- Throws:
InvalidXMLException
- if an import could not be processed.
-
resolveImports
@Deprecated void resolveImports(DESCRIPTOR aDesc, Collection<String> aAlreadyImportedURLs, ResourceManager aResourceManager) throws InvalidXMLException Deprecated.Exists only to support a deprecated methods likeTypeSystemDescription.resolveImports(Collection, ResourceManager)
. Scheduled for removal in UIMA 4.0.Resolves the imports in the given descriptor.- Parameters:
aDesc
- the descriptor in which to resolve the imports.aAlreadyImportedURLs
- URLs of already imported descriptors, so we don't import them again. This argument may benull
.aResourceManager
- the resource manager used to load the imported descriptions. If this argument isnull
then a new default resource manager is created.- Throws:
InvalidXMLException
- if an import could not be processed.
-
resolveImports
private void resolveImports(ImportResolver.DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> aWrapper, Set<String> aAlreadyVisited, Map<ImportResolver<DESCRIPTOR, throws InvalidXMLExceptionCOLLECTIBLE>.Key, COLLECTIBLE> aAllCollectedObjects, Deque<String> aStack, ResourceManager aResourceManager) Recursively traverses the import graph and collects all imported collectible objects.- Parameters:
aAllCollectedObjects
- all the collectible objects that are found in the (transitively) imported descriptors are collected in this list.aStack
- the path through the descriptor import graph that was walked to reach the current descriptor.aResourceManager
- the resource manager used to load the imported descriptors.- Throws:
InvalidXMLException
- if an import could not be processed.
-
collectAll
private void collectAll(ImportResolver.DescriptorAdapter<DESCRIPTOR, COLLECTIBLE> aWrapper, Map<ImportResolver<DESCRIPTOR, COLLECTIBLE>.Key, COLLECTIBLE> aAllCollectibleObjects) -
getOrLoadDescription
private DESCRIPTOR getOrLoadDescription(Import aImport, URL aAbsUrl, Map<String, XMLizable> aImportCache, ImportResolver.DescriptorAdapter<DESCRIPTOR, throws InvalidXMLExceptionCOLLECTIBLE> aWrapper) - Throws:
InvalidXMLException
-
loadDescriptor
private DESCRIPTOR loadDescriptor(Import aImport, URL aAbsUrl, Map<String, XMLizable> aImportCache, ImportResolver.ParserFunction<DESCRIPTOR> aParserFunction) throws InvalidXMLException- Throws:
InvalidXMLException
-
TypeSystemDescription.resolveImports(Collection, ResourceManager)
.