In my UIMA application, I have a number of AnalysisEngines (as you might
expect). These were created using UIMAFramework.produceAnalysisEngine(...)
on my annotators, which all extend MyAnnotator (which in turn extends
JCasAnnotator_ImplBase).

I want to get from the AnalysisEngine back to the original class (cast to
MyAnnotator) so that I can access some of the additional functions I've
added to the class. However, I can't seem to work out how to do that. Could
someone give some pointers?

For clarity, I've included below some code of what I'm trying to acheive
(I'm aware that the code below doesn't work as I've tried it!)

----------------------------

AnalysisEngine ae = getAnalysisEngine(); //Get the analysis engine from
whereever it is, this bit's not important

MyAnnotator ma = (MyAnnotator) ae; //Throws ClassCastException
ma.callMyFunction(); //This is what I'm really trying to get to

----------------------------

Thanks,
James

Reply via email to