void processMatchedTargetAnnotation()

in ConfigurableFeatureExtractor/src/main/java/org/apache/uima/tools/cfe/CommonFeatureMatcher.java [501:549]


    void processMatchedTargetAnnotation(JCas                        jcas,
                                        Annotation                  enclosing,
                                        AnnotationMatchedValue      trg_mv,
                                        TargetAnnotationDescriptor  tad)
    throws IllegalArgumentException,
           IllegalAccessException,
           InvocationTargetException,
           SecurityException,
           NoSuchElementException,
           ClassNotFoundException,
           NoSuchFieldException
    {
        
        Map<PartialObjectMatcher, Collection<AnnotationMatchedValue>> allowedAnnotationsMap =
            createAllowedAnnotationsMap(jcas, tad.getFeatureAnnotationMatchers(), enclosing); 
        
        for (Iterator<FeatureObjectMatcher> it = tad.getFeatureAnnotationMatchers().iterator(); it.hasNext();) {
            // matcher for annotations from whose features are extracted
            FeatureObjectMatcher fom = it.next();
            Collection<AnnotationMatchedValue> allowedAnnotations = allowedAnnotationsMap.get(fom);
            
            if (fom.m_windowsizeLeft > 0) {
                int mask = fom.m_windowFlags & CONSTANT_STARTSLEFT;
                processFeatureAnnotationWindow(jcas, enclosing, trg_mv, tad, fom, allowedAnnotations,
                                               0 == mask ? CONSTANT_LEFTLEFT : mask,
                                               fom.m_windowsizeLeft, false);
            }
            if ((1 == fom.m_windowsizeInside) && tad.getTargetAnnotationMatcher().getMatcherClass().equals(fom.getMatcherClass())) {
                processFeatureAnnotation(jcas, enclosing, trg_mv, trg_mv, tad, fom, CONSTANT_INSIDEINSIDE, 1);
            }
            else if (fom.m_windowsizeInside > 0) {
                int mask = fom.m_windowFlags & CONSTANT_STARTSINSIDE;
                processFeatureAnnotationWindow(jcas, enclosing, trg_mv, tad, fom, allowedAnnotations,
                                               0 == mask ? CONSTANT_INSIDEINSIDE : mask,
                                               fom.m_windowsizeInside, true);
            }
            if (fom.m_windowsizeRight > 0) {
                int mask = fom.m_windowFlags & CONSTANT_STARTSRIGHT;
                processFeatureAnnotationWindow(jcas, enclosing, trg_mv, tad, fom, allowedAnnotations,
                                               0 == mask ? CONSTANT_RIGHTRIGHT : mask,
                                               fom.m_windowsizeRight, true);
            }
            if (fom.m_windowsizeEnclosed > 0) {
                processFeatureAnnotationWindow(jcas, enclosing, trg_mv, tad, fom, allowedAnnotations, 
                                               CONSTANT_ANYENCLOSED,
                                               fom.m_windowsizeEnclosed, true);
            }
        }
    }