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 interfaceImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE>private classImportResolver.Key(package private) static interfaceImportResolver.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 voidcollectAll(ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper, java.util.Map<ImportResolver.Key,COLLECTIBLE> aAllCollectibleObjects)private DESCRIPTORgetOrLoadDescription(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.DescriptorAdapter<DESCRIPTOR,COLLECTIBLE> aWrapper)private DESCRIPTORloadDescriptor(Import aImport, java.net.URL aAbsUrl, java.util.Map<java.lang.String,XMLizable> aImportCache, ImportResolver.ParserFunction<DESCRIPTOR> aParserFunction)(package private) voidresolveImports(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) voidresolveImports(DESCRIPTOR aDesc, ResourceManager aResourceManager)Resolves the imports in the given descriptor.private voidresolveImports(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 isnullthen 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 isnullthen 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
-
-