@Test public void testCreatePreanalyzedFieldValueForAnnotation() throws Exception { JCas jCas = JCasFactory.createJCas("de.julielab.jcore.consumer.es.testTypes"); jCas.setDocumentText("text"); ESConsumerTestType a = new ESConsumerTestType(jCas, 0, 4); a.setStringFeature("testvalue"); StringArray sa = new StringArray(jCas, 2); sa.set(0, "saElement1"); sa.set(1, "saElement2"); a.setStringArrayFeature(sa); IFieldValue value = createPreanalyzedFieldValueForAnnotation(a, "/stringFeature", null); assertEquals(PreanalyzedFieldValue.class, value.getClass()); PreanalyzedFieldValue preAnVal = (PreanalyzedFieldValue) value; assertEquals(1, preAnVal.tokens.size()); assertEquals(0, preAnVal.tokens.get(0).start); assertEquals(4, preAnVal.tokens.get(0).end); value = createPreanalyzedFieldValueForAnnotation(a, "/stringArrayFeature", null); assertEquals(ArrayFieldValue.class, value.getClass()); ArrayFieldValue array = (ArrayFieldValue) value; assertEquals(2, array.size()); for (IFieldValue arrayVal : array) { assertEquals(PreanalyzedFieldValue.class, arrayVal.getClass()); PreanalyzedFieldValue preVal = (PreanalyzedFieldValue) arrayVal; assertEquals(1, preVal.tokens.size()); assertEquals(0, preVal.tokens.get(0).start); assertEquals(4, preVal.tokens.get(0).end); } }
protected IFieldValue createPreanalyzedFieldValueForAnnotation(Annotation a, String featurePath) throws CASException { return createPreanalyzedFieldValueForAnnotation(a, featurePath, null); }
AbstractFieldGenerator { protected IFieldValue createPreanalyzedFieldValueForAnnotation(Annotation a, String featurePath) throws CASException { return createPreanalyzedFieldValueForAnnotation(a, featurePath, null); } }
AbstractFieldGenerator { protected IFieldValue createPreanalyzedFieldValueForAnnotation(Annotation a, String featurePath) throws CASException { return createPreanalyzedFieldValueForAnnotation(a, featurePath, null); } @Deprecated  AbstractFieldGenerator(String fieldname); @Deprecated  AbstractFieldGenerator(String fieldname, FilterRegistry filterRegistry);  AbstractFieldGenerator();  AbstractFieldGenerator(FilterRegistry filterRegistry); }
AbstractFieldGenerator { protected IFieldValue createPreanalyzedFieldValueForAnnotation(Annotation a, String featurePath) throws CASException { return createPreanalyzedFieldValueForAnnotation(a, featurePath, null); } @Deprecated  AbstractFieldGenerator(String fieldname); @Deprecated  AbstractFieldGenerator(String fieldname, FilterRegistry filterRegistry);  AbstractFieldGenerator();  AbstractFieldGenerator(FilterRegistry filterRegistry); void setFilterRegistry(FilterRegistry filterRegistry); @SuppressWarnings("unchecked") List<T> getTokensForAnnotationIndexes(FeaturePathSets featurePathSets,
			Filter filterForField, boolean sort, Class<T> tokenClass, AnnotationFS coveringAnnotation,
			DistributedField<? extends IToken> distributedFields, JCas aJCas); @SuppressWarnings("unchecked") T createRawFieldValueForString(String input, Filter f); ArrayFieldValue createRawArrayFieldValue(Collection<T> fieldValues); @SuppressWarnings("unchecked") ArrayFieldValue createRawArrayFieldValue(Collection<T> fieldValues, Filter filter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath, Filter filter,
			Filter overallFilter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath, Filter filter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] a, String[] featurePaths); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] a, String[] featurePaths,
			Filter[] filters); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fss, String[] featurePaths,
			Filter[] filters, Filter overallFilter); ArrayFieldValue createRawFieldValueForAnnotation(FeatureStructure annotation, String[] featurePaths,
			Filter[] filters); IFieldValue createRawFieldValueForAnnotation(FeatureStructure fs, String featurePath, Filter f); PreanalyzedFieldValue createPreanalyzedFieldValue(String stringValue, List<PreanalyzedToken> tokens); PreanalyzedToken createPreanalyzedTokenInTokenSequence(List<?> fieldValueList, String term, int start,
			int end, int posIncr, byte[] payload, String type, int flags); String getFieldname(); void setFieldname(String fieldname); void addFieldSubgenerator(FieldGenerator subgenerator); FieldGenerator getFieldSubgenerator(Class<? extends FieldGenerator> generatorClass); void addInnerDocumentGenerator(FieldValueGenerator subgenerator); FieldValueGenerator getInnerDocumentGenerator(Class<? extends FieldValueGenerator> generatorClass); @Deprecated void addSubgeneratorFeatureStructure(Object key, TOP featureStructure); Map<Class<?>, List<TOP>> getSubgeneratorFS(); }
AbstractFieldGenerator { protected IFieldValue createPreanalyzedFieldValueForAnnotation(Annotation a, String featurePath) throws CASException { return createPreanalyzedFieldValueForAnnotation(a, featurePath, null); } @Deprecated  AbstractFieldGenerator(String fieldname); @Deprecated  AbstractFieldGenerator(String fieldname, FilterRegistry filterRegistry);  AbstractFieldGenerator();  AbstractFieldGenerator(FilterRegistry filterRegistry); void setFilterRegistry(FilterRegistry filterRegistry); @SuppressWarnings("unchecked") List<T> getTokensForAnnotationIndexes(FeaturePathSets featurePathSets,
			Filter filterForField, boolean sort, Class<T> tokenClass, AnnotationFS coveringAnnotation,
			DistributedField<? extends IToken> distributedFields, JCas aJCas); @SuppressWarnings("unchecked") T createRawFieldValueForString(String input, Filter f); ArrayFieldValue createRawArrayFieldValue(Collection<T> fieldValues); @SuppressWarnings("unchecked") ArrayFieldValue createRawArrayFieldValue(Collection<T> fieldValues, Filter filter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath, Filter filter,
			Filter overallFilter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath, Filter filter); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fs, String featurePath); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] a, String[] featurePaths); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] a, String[] featurePaths,
			Filter[] filters); ArrayFieldValue createRawFieldValueForAnnotations(FeatureStructure[] fss, String[] featurePaths,
			Filter[] filters, Filter overallFilter); ArrayFieldValue createRawFieldValueForAnnotation(FeatureStructure annotation, String[] featurePaths,
			Filter[] filters); IFieldValue createRawFieldValueForAnnotation(FeatureStructure fs, String featurePath, Filter f); PreanalyzedFieldValue createPreanalyzedFieldValue(String stringValue, List<PreanalyzedToken> tokens); PreanalyzedToken createPreanalyzedTokenInTokenSequence(List<?> fieldValueList, String term, int start,
			int end, int posIncr, byte[] payload, String type, int flags); String getFieldname(); void setFieldname(String fieldname); void addFieldSubgenerator(FieldGenerator subgenerator); FieldGenerator getFieldSubgenerator(Class<? extends FieldGenerator> generatorClass); void addInnerDocumentGenerator(FieldValueGenerator subgenerator); FieldValueGenerator getInnerDocumentGenerator(Class<? extends FieldValueGenerator> generatorClass); @Deprecated void addSubgeneratorFeatureStructure(Object key, TOP featureStructure); Map<Class<?>, List<TOP>> getSubgeneratorFS();  }