private static Object getFeatureValue(Feature feature, Class<? extends Object> class1, Annotation annotation) throws ResourceProcessException { if(class1 == Integer.class){ return annotation.getIntValue(feature); }else if(class1 == String.class){ return annotation.getStringValue(feature); }else if(class1 == Boolean.class){ return annotation.getBooleanValue(feature); }else{ throw new ResourceProcessException("Received a class type that I'm not familiar with: ", new Object[]{class1}); } }
private static Object getFeatureValue(Feature feature, Class<? extends Object> class1, Annotation annotation) throws ResourceProcessException { if(class1 == Integer.class){ return annotation.getIntValue(feature); }else if(class1 == String.class){ return annotation.getStringValue(feature); }else if(class1 == Boolean.class){ return annotation.getBooleanValue(feature); }else{ throw new ResourceProcessException("Received a class type that I'm not familiar with: ", new Object[]{class1}); } }
static void writeFieldToDb(String range, BasicDBObject o, Annotation a, String dbKey, Feature f) { if (range.equals("String")) { o.put(dbKey, a.getStringValue(f)); } else if (range.equals("StringArray")) { StringArray sa = (StringArray) a.getFeatureValue(f); if (sa != null) { String[] vals = sa.toArray(); o.put(dbKey, Lists.newArrayList(vals)); } } else if (range.equals("Integer")) { o.put(dbKey, a.getIntValue(f)); } else if (range.equals("Float")) { o.put(dbKey, a.getFloatValue(f)); } else if (range.equals("Boolean")) { o.put(dbKey, a.getBooleanValue(f)); } else { LOG.warn("range not supported " + range); } }
p.print(anno.getDoubleValue(feature)); } else if (feature.getRange().getName().equals("uima.cas.Boolean")) { p.print(anno.getBooleanValue(feature));
break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE:
break; case CAS.TYPE_NAME_BOOLEAN: ret = a.getBooleanValue(f); break; case CAS.TYPE_NAME_BYTE: