String value = values[i]; try { Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + coreKeyClass.getSimpleName() + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
public static void annotateChunk(CoreMap chunk, Map<String,String> attributes) { for (Map.Entry<String, String> entry : attributes.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); Class coreKeyClass = AnnotationLookup.toCoreKey(key); if (key != null) { if (value != null) { try { Class valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass == String.class) { chunk.set(coreKeyClass, value); } else { Method valueOfMethod = valueClass.getMethod("valueOf", String.class); if (valueOfMethod != null) { chunk.set(coreKeyClass, valueOfMethod.invoke(valueClass, value)); } } } catch (Exception ex) { throw new RuntimeException("Unable to annotate attribute " + key, ex); } } else { chunk.set(coreKeyClass, null); } } else { throw new UnsupportedOperationException("Unknown null attribute."); } } }
Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if(valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + key + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
String value = values[i]; try { Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + coreKeyClass.getSimpleName() + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
String value = values[i]; try { Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + coreKeyClass.getSimpleName() + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
public static void annotateChunk(CoreMap chunk, Map<String,String> attributes) { for (Map.Entry<String, String> entry : attributes.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); Class coreKeyClass = AnnotationLookup.toCoreKey(key); if (key != null) { if (value != null) { try { Class valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass == String.class) { chunk.set(coreKeyClass, value); } else { Method valueOfMethod = valueClass.getMethod("valueOf", String.class); if (valueOfMethod != null) { chunk.set(coreKeyClass, valueOfMethod.invoke(valueClass, value)); } } } catch (Exception ex) { throw new RuntimeException("Unable to annotate attribute " + key, ex); } } else { chunk.set(coreKeyClass, null); } } else { throw new UnsupportedOperationException("Unknown null attribute."); } } }
public static void annotateChunk(CoreMap chunk, Map<String,String> attributes) { for (Map.Entry<String, String> entry : attributes.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); Class coreKeyClass = AnnotationLookup.toCoreKey(key); if (key != null) { if (value != null) { try { Class valueClass = AnnotationLookup.getValueType(coreKeyClass); if (valueClass == String.class) { chunk.set(coreKeyClass, value); } else { Method valueOfMethod = valueClass.getMethod("valueOf", String.class); if (valueOfMethod != null) { chunk.set(coreKeyClass, valueOfMethod.invoke(valueClass, value)); } } } catch (Exception ex) { throw new RuntimeException("Unable to annotate attribute " + key, ex); } } else { chunk.set(coreKeyClass, null); } } else { throw new UnsupportedOperationException("Unknown null attribute."); } } }
public static void annotateChunk(CoreMap chunk, Map<String,String> attributes) { for (String attr:attributes.keySet()) { String value = attributes.get(attr); AnnotationLookup.KeyLookup lookup = AnnotationLookup.getCoreKey(attr); if (attr != null) { if (value != null) { try { Class valueClass = AnnotationLookup.getValueType(lookup.coreKey); if (valueClass == String.class) { chunk.set((Class<? extends CoreAnnotation>) lookup.coreKey, value); } else { Method valueOfMethod = valueClass.getMethod("valueOf", String.class); if (valueOfMethod != null) { chunk.set((Class<? extends CoreAnnotation>) lookup.coreKey, valueOfMethod.invoke(valueClass, value)); } } } catch (Exception ex) { throw new RuntimeException("Unable to annotate attribute " + attr, ex); } } else { chunk.set((Class<? extends CoreAnnotation>) lookup.coreKey, null); } } else { throw new UnsupportedOperationException("Unknown attributes: " + attr); } } }
public static void annotateChunk(CoreMap chunk, Map<String,String> attributes) { for (String attr:attributes.keySet()) { String value = attributes.get(attr); AnnotationLookup.KeyLookup lookup = AnnotationLookup.getCoreKey(attr); if (attr != null) { if (value != null) { try { Class valueClass = AnnotationLookup.getValueType(lookup.coreKey); if (valueClass == String.class) { chunk.set(lookup.coreKey, value); } else { Method valueOfMethod = valueClass.getMethod("valueOf", String.class); if (valueOfMethod != null) { chunk.set(lookup.coreKey, valueOfMethod.invoke(valueClass, value)); } } } catch (Exception ex) { throw new RuntimeException("Unable to annotate attribute " + attr, ex); } } else { chunk.set(lookup.coreKey, null); } } else { throw new UnsupportedOperationException("Unknown attributes: " + attr); } } }
Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if(valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + key + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
Class<?> valueClass = AnnotationLookup.getValueType(coreKeyClass); if(valueClass.equals(String.class)) { this.set(coreKeyClass, values[i]); + "Bad type for " + key + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(coreKeyClass), e);
Class<?> valueClass = AnnotationLookup.getValueType(lookup.coreKey); if(valueClass.equals(String.class)) { this.set((Class<? extends CoreAnnotation>)lookup.coreKey, values[i]); + "Bad type for " + key + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(lookup.coreKey));
Class<?> valueClass = AnnotationLookup.getValueType(lookup.coreKey); if(valueClass.equals(String.class)) { this.set(lookup.coreKey, values[i]); + "Bad type for " + key + ". Value was: " + value + "; expected "+AnnotationLookup.getValueType(lookup.coreKey));