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 java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE>
private class
ImportResolver.Key
(package private) static interface
ImportResolver.ParserFunction<DESCRIPTOR>
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<DESCRIPTOR,ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE>>
adapterFactory
-
Constructor Summary
Constructors Constructor Description ImportResolver(java.util.function.Function<DESCRIPTOR,ImportResolver.DescriptorAdapter> aAdapterFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
collectAll(ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper, java.util.Map<ImportResolver.Key,COLLECTIBLE> aAllCollectibleObjects)
private DESCRIPTOR
getOrLoadDescription(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper)
private DESCRIPTOR
loadDescriptor(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.ParserFunction<DESCRIPTOR> aParserFunction)
(package private) void
resolveImports(DESCRIPTOR aDesc, java.util.Collection<java.lang.String> aAlreadyImportedURLs, ResourceManager aResourceManager)
Deprecated.Exists only to support a deprecated methods likeTypeSystemDescription.resolveImports(Collection, ResourceManager)
.(package private) void
resolveImports(DESCRIPTOR aDesc, ResourceManager aResourceManager)
Resolves the imports in the given descriptor.private void
resolveImports(ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper, java.util.Set<java.lang.String> aAlreadyVisited, java.util.Map<ImportResolver.Key,COLLECTIBLE> aAllCollectedObjects, java.util.Deque<java.lang.String> aStack, ResourceManager aResourceManager)
Recursively traverses the import graph and collects all imported collectible objects.
-
-
-
Field Detail
-
adapterFactory
private java.util.function.Function<DESCRIPTOR extends MetaDataObject,ImportResolver.DescriptorAdapter<DESCRIPTOR extends MetaDataObject,COLLECTIBLE extends MetaDataObject>> adapterFactory
-
-
Constructor Detail
-
ImportResolver
ImportResolver(java.util.function.Function<DESCRIPTOR,ImportResolver.DescriptorAdapter> aAdapterFactory)
-
-
Method Detail
-
resolveImports
void resolveImports(DESCRIPTOR aDesc, ResourceManager aResourceManager) throws InvalidXMLException
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, java.util.Collection<java.lang.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, java.util.Set<java.lang.String> aAlreadyVisited, java.util.Map<ImportResolver.Key,COLLECTIBLE> aAllCollectedObjects, java.util.Deque<java.lang.String> aStack, ResourceManager aResourceManager) throws InvalidXMLException
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, java.util.Map<ImportResolver.Key,COLLECTIBLE> aAllCollectibleObjects)
-
getOrLoadDescription
private DESCRIPTOR getOrLoadDescription(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper) throws InvalidXMLException
- Throws:
InvalidXMLException
-
loadDescriptor
private DESCRIPTOR loadDescriptor(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.ParserFunction<DESCRIPTOR> aParserFunction) throws InvalidXMLException
- Throws:
InvalidXMLException
-
-