@Test public void testInitializeWithTypesSet() throws ResourceInitializationException { UimaContext aContext = Mockito.mock(UimaContext.class); Mockito.when(aContext.getConfigParameterValue("inputType")).thenReturn(new String[]{"gov.va.vinci.Token"}); Mockito.when(aContext.getConfigParameterValue("outputType")).thenReturn("gov.va.vinci.OutputToken"); Mockito.when(aContext.getConfigParameterValue("myParamRequired")).thenReturn("req"); new ExampleAnnotator().initialize(aContext); }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); ConfigurationParameterUtils.initParameterValues(this, aContext); if (this.getName() == null && aContext instanceof ChildUimaContext_impl ) { this.setName(((ChildUimaContext_impl)aContext).getManagementInterface().getName()); } }
LeoBaseAnnotator extends JCasAnnotator_ImplBase implements LeoAnnotator { @Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); ConfigurationParameterUtils.initParameterValues(this, aContext); if (this.getName() == null && aContext instanceof ChildUimaContext_impl ) { this.setName(((ChildUimaContext_impl)aContext).getManagementInterface().getName()); } } }
LeoBaseAnnotator extends JCasAnnotator_ImplBase implements LeoAnnotator { @Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); ConfigurationParameterUtils.initParameterValues(this, aContext); if (this.getName() == null && aContext instanceof ChildUimaContext_impl ) { this.setName(((ChildUimaContext_impl)aContext).getManagementInterface().getName()); } } LeoBaseAnnotator();  LeoBaseAnnotator(String outputType, String...inputTypes); }
LeoBaseAnnotator extends JCasAnnotator_ImplBase implements LeoAnnotator { @Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); ConfigurationParameterUtils.initParameterValues(this, aContext); if (this.getName() == null && aContext instanceof ChildUimaContext_impl ) { this.setName(((ChildUimaContext_impl)aContext).getManagementInterface().getName()); } } LeoBaseAnnotator();  LeoBaseAnnotator(String outputType, String...inputTypes); String[] getInputTypes(); T setInputTypes(String...inputTypes); String getOutputType(); T setOutputType(String outputType); int getNumInstances(); T setNumInstances(int numInstances); String getName(); T setName(String name); String[] getIncludeTypesFilter(); T setIncludeTypesFilter(String...includeTypesFilterNames); String[] getExcludeTypesFilter(); T setExcludeTypesFilter(String...excludeTypesFilterNames); @Override void initialize(UimaContext aContext); InputStream getResourceAsInputStream(String resourcePath); String getResourceFileAsString(String resourcePath); long getNumberOfCASesProcessed(); T resetNumberOfCASesProcessed(); long getNumberOfFilteredCASesProcessed(); T resetNumberOfFilteredCASesProcessed(); @Override final void process(JCas aJCas); abstract void annotate(JCas aJCas); @Override void collectionProcessComplete(); LeoDelegate getDescriptor(); LeoAEDescriptor getLeoAEDescriptor(); LeoTypeSystemDescription getLeoTypeSystemDescription(); T addLeoTypeSystemDescription(LeoTypeSystemDescription typeSystemDescription); T setLeoTypeSystemDescription(LeoTypeSystemDescription typeSystemDescription); }
LeoBaseAnnotator extends JCasAnnotator_ImplBase implements LeoAnnotator { @Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); ConfigurationParameterUtils.initParameterValues(this, aContext); if (this.getName() == null && aContext instanceof ChildUimaContext_impl ) { this.setName(((ChildUimaContext_impl)aContext).getManagementInterface().getName()); } } LeoBaseAnnotator();  LeoBaseAnnotator(String outputType, String...inputTypes); String[] getInputTypes(); T setInputTypes(String...inputTypes); String getOutputType(); T setOutputType(String outputType); int getNumInstances(); T setNumInstances(int numInstances); String getName(); T setName(String name); String[] getIncludeTypesFilter(); T setIncludeTypesFilter(String...includeTypesFilterNames); String[] getExcludeTypesFilter(); T setExcludeTypesFilter(String...excludeTypesFilterNames); @Override void initialize(UimaContext aContext); InputStream getResourceAsInputStream(String resourcePath); String getResourceFileAsString(String resourcePath); long getNumberOfCASesProcessed(); T resetNumberOfCASesProcessed(); long getNumberOfFilteredCASesProcessed(); T resetNumberOfFilteredCASesProcessed(); @Override final void process(JCas aJCas); abstract void annotate(JCas aJCas); @Override void collectionProcessComplete(); LeoDelegate getDescriptor(); LeoAEDescriptor getLeoAEDescriptor(); LeoTypeSystemDescription getLeoTypeSystemDescription(); T addLeoTypeSystemDescription(LeoTypeSystemDescription typeSystemDescription); T setLeoTypeSystemDescription(LeoTypeSystemDescription typeSystemDescription);  }