/** * For an aggregate AnalysisEngine only, gets a Map from each component's key to the specifier for * that component. * * @return a Map with String keys and ResourceSpecifier values */ protected Map<String, ResourceSpecifier> _getComponentCasProcessorSpecifierMap() { try { return mDescription.getDelegateAnalysisEngineSpecifiers(); } catch (InvalidXMLException e) { // this should not happen, because we resolve delegates during initialization throw new UIMARuntimeException(e); } }
/** * For an aggregate AnalysisEngine only, gets a Map from each component's key to the specifier for * that component. * * @return a Map with String keys and ResourceSpecifier values */ protected Map<String, ResourceSpecifier> _getComponentCasProcessorSpecifierMap() { try { return ((AnalysisEngineDescription)mDescription).getDelegateAnalysisEngineSpecifiers(); } catch (InvalidXMLException e) { // this should not happen, because we resolve delegates during // initialization throw new UIMARuntimeException(e); } }
/** * gets the Hash Map of resolved AE delegates Clones the description first because the getting * updates it in some cases. * * @param aed the aed * @return the Map of resolved AE delegates */ public Map getDelegateAEdescriptions(AnalysisEngineDescription aed) { Map result = new HashMap(); AnalysisEngineDescription aedClone = (AnalysisEngineDescription) ((AnalysisEngineDescription_impl) aed) .clone(); try { result = aedClone.getDelegateAnalysisEngineSpecifiers(createResourceManager()); } catch (InvalidXMLException e) { } return result; }
/** * Scan the given resource specifier for external resource dependencies and whenever a dependency * a compatible type is found, the given resource is bound to it. * * @param aDesc * a description. * @param aResDesc * the resource description. */ private static void bind(AnalysisEngineDescription aDesc, ExternalResourceDescription aResDesc) throws InvalidXMLException, ClassNotFoundException { // Recursively address delegates if (!aDesc.isPrimitive()) { for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { bindResource((ResourceSpecifier) delegate, aResDesc); } } // Bind if necessary Class<?> resClass = Class.forName(getImplementationName(aResDesc)); for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) { Class<?> apiClass = Class.forName(dep.getInterfaceName()); // Never bind fields of type Object. See also ExternalResourceInitializer#getApi() if (apiClass.equals(Object.class)) { continue; } if (apiClass.isAssignableFrom(resClass)) { bindExternalResource(aDesc, dep.getKey(), aResDesc); } } }
/** * Scan the given resource specifier for external resource dependencies and whenever a dependency * with the given key is encountered, the given resource is bound to it. * * @param aDesc * a description. * @param aKey * the key to bind to. * @param aResDesc * the resource description. */ private static void bind(AnalysisEngineDescription aDesc, String aKey, ExternalResourceDescription aResDesc) throws InvalidXMLException { // Recursively address delegates if (!aDesc.isPrimitive()) { for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { bindResource((ResourceSpecifier) delegate, aKey, aResDesc); } } // Bind if necessary for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) { if (aKey.equals(dep.getKey())) { bindExternalResource(aDesc, aKey, aResDesc); } } }
private static void consolidateAggregate(AnalysisEngineDescription aDesc, ResourceManager aResMgr) throws ResourceInitializationException, InvalidXMLException { if (aDesc.isPrimitive() || aDesc.getDelegateAnalysisEngineSpecifiers().isEmpty()) { return; for (ResourceSpecifier delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { consolidateAggregate((AnalysisEngineDescription) delegate, aResMgr); for (ResourceSpecifier delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { AnalysisEngineDescription aeDelegate = (AnalysisEngineDescription) delegate; aeDelegate.getAnalysisEngineMetaData().setTypeSystem(null); for (ResourceSpecifier delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { AnalysisEngineDescription aeDelegate = (AnalysisEngineDescription) delegate; ResourceManagerConfiguration delegateResMgrCfg = aeDelegate.getResourceManagerConfiguration();
aeSpecifier.getDelegateAnalysisEngineSpecifiers(); aeSpecifier.getAnalysisEngineMetaData().resolveImports(resMgr);
Map delegates = aeSpecifier.getDelegateAnalysisEngineSpecifiers();
Map delegates = aeSpecifier.getDelegateAnalysisEngineSpecifiers();
.getDelegateAnalysisEngineSpecifiers(createResourceManager())); } catch (InvalidXMLException e) { throw new ResourceInitializationException(e);
try { mDescription.getDelegateAnalysisEngineSpecifiers(getResourceManager()); if (mDescription.getFlowControllerDeclaration() != null) { if (mDescription.getFlowControllerDeclaration().getImport() == null