private FieldExtractor getAnnotationExtractBy(Class clazz, Field field) {
        FieldExtractor fieldExtractor = null;
        ExtractBy extractBy = field.getAnnotation(ExtractBy.class);
        if (extractBy != null) {
            Selector selector = ExtractorUtils.getSelector(extractBy);
            ExtractBy.Source extractSource = extractBy.source();
            if (extractBy.type()== ExtractBy.Type.JsonPath)
                extractSource = RawText;
            Source source = null;
            switch (extractSource) {
                case RawText:
                    source = new RawText();
                    break;
                case RawHtml:
                    source = new RawHtml();
                    break;
                case SelectedHtml:
                    source = new SelectedHtml();
                    break;
                default:
                    source = new SelectedHtml();
            }
            fieldExtractor = new FieldExtractor(field, selector, source,
                    extractBy.notNull(), List.class.isAssignableFrom(field.getType()));
            fieldExtractor.setSetterMethod(getSetterMethod(clazz, field));
        }
        return fieldExtractor;
    }
The main internal logic of page model extractor.

@author code4crafter@gmail.com <br>
@since 0.2.0
webmagic-extension/src/main/java/us/codecraft/webmagic/model/PageModelExtractor.java