@Test public void testNull() { DocumentAnnotation da = (DocumentAnnotation) jCas.getDocumentAnnotationFs(); StringArray rel = new StringArray(jCas, 3); rel.set(0, "ENG"); rel.set(1, "WAL"); rel.set(2, "SCO"); da.setDocumentReleasability(rel); Feature f = da.getType().getFeatureByBaseName(DOCUMENT_RELEASABILITY); Object o = FeatureUtils.featureToObject(f, da); assertNull(o); }
public static Object featureToObject(Feature f, Annotation a) { Object ret = null; switch (f.getRange().getName()) { case CAS.TYPE_NAME_STRING: ret = StringToObject.convertStringToObject(a.getStringValue(f)); break; case CAS.TYPE_NAME_INTEGER: ret = a.getIntValue(f); break; case CAS.TYPE_NAME_FLOAT: ret = a.getFloatValue(f); break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: ret = a.getByteValue(f); break; case CAS.TYPE_NAME_SHORT: ret = a.getShortValue(f); break; case CAS.TYPE_NAME_LONG: ret = a.getLongValue(f); break; case CAS.TYPE_NAME_DOUBLE: ret = a.getDoubleValue(f); break; default: ret = null; } return ret; }
FeatureUtils { public static Object featureToObject(Feature f, Annotation a) { Object ret = null; switch (f.getRange().getName()) { case CAS.TYPE_NAME_STRING: ret = StringToObject.convertStringToObject(a.getStringValue(f)); break; case CAS.TYPE_NAME_INTEGER: ret = a.getIntValue(f); break; case CAS.TYPE_NAME_FLOAT: ret = a.getFloatValue(f); break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: ret = a.getByteValue(f); break; case CAS.TYPE_NAME_SHORT: ret = a.getShortValue(f); break; case CAS.TYPE_NAME_LONG: ret = a.getLongValue(f); break; case CAS.TYPE_NAME_DOUBLE: ret = a.getDoubleValue(f); break; default: ret = null; } return ret; } }
FeatureUtils { public static Object featureToObject(Feature f, Annotation a) { Object ret = null; switch (f.getRange().getName()) { case CAS.TYPE_NAME_STRING: ret = StringToObject.convertStringToObject(a.getStringValue(f)); break; case CAS.TYPE_NAME_INTEGER: ret = a.getIntValue(f); break; case CAS.TYPE_NAME_FLOAT: ret = a.getFloatValue(f); break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: ret = a.getByteValue(f); break; case CAS.TYPE_NAME_SHORT: ret = a.getShortValue(f); break; case CAS.TYPE_NAME_LONG: ret = a.getLongValue(f); break; case CAS.TYPE_NAME_DOUBLE: ret = a.getDoubleValue(f); break; default: ret = null; } return ret; } private  FeatureUtils(); }
FeatureUtils { public static Object featureToObject(Feature f, Annotation a) { Object ret = null; switch (f.getRange().getName()) { case CAS.TYPE_NAME_STRING: ret = StringToObject.convertStringToObject(a.getStringValue(f)); break; case CAS.TYPE_NAME_INTEGER: ret = a.getIntValue(f); break; case CAS.TYPE_NAME_FLOAT: ret = a.getFloatValue(f); break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: ret = a.getByteValue(f); break; case CAS.TYPE_NAME_SHORT: ret = a.getShortValue(f); break; case CAS.TYPE_NAME_LONG: ret = a.getLongValue(f); break; case CAS.TYPE_NAME_DOUBLE: ret = a.getDoubleValue(f); break; default: ret = null; } return ret; } private  FeatureUtils(); static Object featureToObject(Feature f, Annotation a); static Object[] featureToArray(Feature f, Annotation a); static List<Object> featureToList(Feature f, Annotation a); }
FeatureUtils { public static Object featureToObject(Feature f, Annotation a) { Object ret = null; switch (f.getRange().getName()) { case CAS.TYPE_NAME_STRING: ret = StringToObject.convertStringToObject(a.getStringValue(f)); break; case CAS.TYPE_NAME_INTEGER: ret = a.getIntValue(f); break; case CAS.TYPE_NAME_FLOAT: ret = a.getFloatValue(f); break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: ret = a.getByteValue(f); break; case CAS.TYPE_NAME_SHORT: ret = a.getShortValue(f); break; case CAS.TYPE_NAME_LONG: ret = a.getLongValue(f); break; case CAS.TYPE_NAME_DOUBLE: ret = a.getDoubleValue(f); break; default: ret = null; } return ret; } private  FeatureUtils(); static Object featureToObject(Feature f, Annotation a); static Object[] featureToArray(Feature f, Annotation a); static List<Object> featureToList(Feature f, Annotation a);  }