protected void finalize() throws Throwable { destroy(); } }
public void destroy() { mAnnotator.destroy(); }
/** * This default implementation calls {@link #destroy()} followed by * {@link #initialize(AnnotatorContext)} and {@link #typeSystemInit(TypeSystem)}. The * <code>typeSystemInit</code> method will be passed the last known TypeSystem. * * @see org.apache.uima.analysis_engine.annotator.BaseAnnotator#reconfigure() */ public void reconfigure() throws AnnotatorConfigurationException, AnnotatorInitializationException { destroy(); initialize(getContext()); if (mTypeSystem != null) { typeSystemInit(mTypeSystem); } }
private int detectSearchStrategy(String strategyString) throws AnnotatorConfigurationException { if ((strategyString == null) || (strategyString.equals(""))) { return DefaultSearchStrategy; } else if (strategyString.equals(PARAMVALUE_CONTIGUOUSMATCH)) { return ContiguousMatch; } else if (strategyString.equals(PARAMVALUE_SKIPANYMATCH)) { return SkipAnyMatch; } else if (strategyString.equals(PARAMVALUE_SKIPANYMATCHALLOWOVERLAP)) { return SkipAnyMatchAllowOverlap; } else { throw new AnnotatorConfigurationException(); } }
/** * Acquires Resource InputStreams using the ResourceManager, or, if that fails, the ClassLoader. * * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceAsStream(String) */ public InputStream getResourceAsStream(String aKey) throws AnnotatorContextException { try { return mUimaContext.getResourceAsStream(aKey); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
/** * vng use the constructor identified during initialization to create the * lookup token * * @param bta * @return * @throws AnnotatorInitializationException */ private LookupToken annoToLookupToken(Annotation bta) throws AnnotatorInitializationException { try { return (LookupToken) lookupTokenAdapterCtor.newInstance(bta); } catch (InvocationTargetException e) { throw new AnnotatorInitializationException(e); } catch (IllegalArgumentException e) { throw new AnnotatorInitializationException(e); } catch (InstantiationException e) { throw new AnnotatorInitializationException(e); } catch (IllegalAccessException e) { throw new AnnotatorInitializationException(e); } }
public void initialize(UimaContext aContext) throws ResourceInitializationException { try { // wrap UimaContext in AnnotatorContext AnnotatorContext actxt = new AnnotatorContext_impl((UimaContextAdmin) aContext); mAnnotator.initialize(actxt); } catch (AnnotatorInitializationException e) { throw new ResourceInitializationException(e); } catch (AnnotatorConfigurationException e) { throw new ResourceInitializationException(e); } }
public void reconfigure() throws ResourceConfigurationException, ResourceInitializationException { try { mAnnotator.reconfigure(); } catch (AnnotatorConfigurationException e) { throw new ResourceConfigurationException(e); } catch (AnnotatorInitializationException e) { throw new ResourceInitializationException(e); } }
/** * Locates Resource URL's using the ResourceManager, or, if that fails, the ClassLoader. * * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceURL(String) */ public URL getResourceURL(String aKey) throws AnnotatorContextException { try { return mUimaContext.getResourceURL(aKey); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
/** * vng use the constructor identified during initialization to create the * lookup token * * @param bta * @return * @throws AnnotatorInitializationException */ private LookupToken annoToLookupToken(Annotation bta) throws AnnotatorInitializationException { try { return (LookupToken) lookupTokenAdapterCtor.newInstance(bta); } catch (InvocationTargetException e) { throw new AnnotatorInitializationException(e); } catch (IllegalArgumentException e) { throw new AnnotatorInitializationException(e); } catch (InstantiationException e) { throw new AnnotatorInitializationException(e); } catch (IllegalAccessException e) { throw new AnnotatorInitializationException(e); } }
/** * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceAsStream(java.lang.String, * java.lang.String[]) */ public InputStream getResourceAsStream(String aKey, String[] aParams) throws AnnotatorContextException { try { return mUimaContext.getResourceAsStream(aKey, aParams); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
public URI getResourceURI(String aKey, String[] aParams) throws AnnotatorContextException { try { return mUimaContext.getResourceURI(aKey, aParams); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
public String getResourceFilePath(String aKey, String[] aParams) throws AnnotatorContextException { try { return mUimaContext.getResourceFilePath(aKey, aParams); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
/** * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceURL(java.lang.String, * java.lang.String[]) */ public URL getResourceURL(String aKey, String[] aParams) throws AnnotatorContextException { try { return mUimaContext.getResourceURL(aKey, aParams); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
public String getResourceFilePath(String aKey) throws AnnotatorContextException { try { return mUimaContext.getResourceFilePath(aKey); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
/** * Acquires a Resource object using the ResourceManager. * * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceObject(String) */ public Object getResourceObject(String aKey) throws AnnotatorContextException { try { return mUimaContext.getResourceObject(aKey); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
/** * @see org.apache.uima.analysis_engine.annotator.AnnotatorContext#getResourceObject(java.lang.String, * java.lang.String[]) */ public Object getResourceObject(String aKey, String[] aParams) throws AnnotatorContextException { try { return mUimaContext.getResourceObject(aKey, aParams); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
public URI getResourceURI(String aKey) throws AnnotatorContextException { try { return mUimaContext.getResourceURI(aKey); } catch (ResourceAccessException e) { throw new AnnotatorContextException(e); } }
static private String getName( final String elementName, final Element element ) throws AnnotatorContextException { final String name = element.getChildText( NAME_KEY ); if ( name == null || name.isEmpty() ) { throw new AnnotatorContextException( "Missing name for " + elementName, EMPTY_OBJECT_ARRAY ); } return name; }
static private String getName( final String elementName, final Element element ) throws AnnotatorContextException { final String name = element.getChildText( NAME_KEY ); if ( name == null || name.isEmpty() ) { throw new AnnotatorContextException( "Missing name for " + elementName, EMPTY_OBJECT_ARRAY ); } return name; }