public Serializable remove(Object key) { for (int i = 0; i < data.length; i++) { data[i].remove(key); } return null; }
@Override public Data process(Data data) { if (keys == null) return data; for (String key : keys) data.remove(key); return data; } }
public Serializable remove(Object key) { for (int i = 0; i < data.length; i++) { data[i].remove(key); } return null; }
@Override public Data process(Data data) { if (keys == null) return data; Set<String> ks = keys.select(data); for (String key : ks) data.remove(key); return data; } }
/** * @see stream.DataProcessor#process(stream.Data) */ @Override public Data process(Data data) { List<String> remove = new ArrayList<String>(); for (String key : data.keySet()) { if (DataUtils.isSpecial(key)) continue; try { Double val = new Double(data.get(key).toString()); if (val == 0.0d) remove.add(key); } catch (Exception e) { } } for (String key : remove) { data.remove(key); } return data; } }
/** * Returns the given data item, with the specified key being hidden. * * @param key * @param item * @return * @deprecated */ public final static Data hide(String key, Data item) { if (item.containsKey(key)) { Serializable o = item.remove(key); item.put(Data.HIDDEN_PREFIX + key, o); } return item; }
/** * Returns the given data item, with the specified key being hidden. * * @param key * @param item * @return * @deprecated */ public final static Data hide(String key, Data item) { if (item.containsKey(key)) { Serializable o = item.remove(key); item.put(Data.HIDDEN_PREFIX + key, o); } return item; }
/** * @see stream.Processor#process(stream.Data) */ @Override public Data process(Data input) { if (oldKey != null && newKey != null && input.containsKey(oldKey)) { if (input.containsKey(newKey)) log.warn("Overwriting existing key '{}'!", newKey); Serializable o = input.remove(oldKey); input.put(newKey, o); } for (String key : mapping.keySet()) { if (input.containsKey(key)) { Serializable value = input.remove(key); input.put(mapping.get(key), value); } } return input; }
/** * @see stream.Processor#process(stream.Data) */ @Override public Data processMatchingData(Data input) { if (oldKey != null && newKey != null && input.containsKey(oldKey)) { if (input.containsKey(newKey)) log.warn("Overwriting existing key '{}'!", newKey); Serializable o = input.remove(oldKey); input.put(newKey, o); } return input; } }
/** * @see stream.DataProcessor#process(stream.Data) */ @Override public Data process(Data data) { List<String> remove = new ArrayList<String>(); for (String key : data.keySet()) { if (DataUtils.isSpecial(key)) continue; try { Double val = new Double(data.get(key).toString()); if (val == 0.0d) remove.add(key); } catch (Exception e) { } } for (String key : remove) { data.remove(key); } return data; } }
/** * @see stream.DataProcessor#process(stream.Data) */ @Override public Data process(Data data) { List<String> remove = new ArrayList<String>(); for (String key : data.keySet()) { if (DataUtils.isSpecial(key)) continue; try { Double val = new Double(data.get(key).toString()); if (val == 0.0d) remove.add(key); } catch (Exception e) { } } for (String key : remove) { data.remove(key); } return data; } }
/** * @see stream.Processor#process(stream.Data) */ @Override public Data process(Data input) { if (oldKey != null && newKey != null && input.containsKey(oldKey)) { if (input.containsKey(newKey)) log.warn("Overwriting existing key '{}'!", newKey); Serializable o = input.remove(oldKey); input.put(newKey, o); } for (String key : mapping.keySet()) { if (input.containsKey(key)) { Serializable value = input.remove(key); input.put(mapping.get(key), value); } } return input; }
/** * Returns the given data item, with the specified hidden key being * un-hidden. * * @param key * @param item * @return * @deprecated */ public final static Data unhide(String key, Data item) { String hidden = Data.HIDDEN_PREFIX + key; if (item.containsKey(hidden)) { Serializable o = item.remove(hidden); item.put(key, o); } return item; }
/** * @see stream.Processor#process(stream.Data) */ @Override public Data process(Data input) { if (oldKey != null && newKey != null && input.containsKey(oldKey)) { if (input.containsKey(newKey)) log.warn("Overwriting existing key '{}'!", newKey); Serializable o = input.remove(oldKey); input.put(newKey, o); } for (String key : mapping.keySet()) { if (input.containsKey(key)) { Serializable value = input.remove(key); input.put(mapping.get(key), value); } } return input; }
/** * */ @Override public Data processMatchingData(Data data) { if (key != null && value != null) { String val = ""; if (value == "null") { if (scope.contains(Context.DATA_CONTEXT_NAME) || scope.isEmpty()) data.remove(key); else if (scope.contains(Context.PROCESS_CONTEXT_NAME)) context.set(key, null); } else val = String.valueOf(ExpressionResolver.resolve(value, context, data)); if (scope.contains(Context.DATA_CONTEXT_NAME) || scope.isEmpty()) data.put(key, val); else if (scope.contains(Context.PROCESS_CONTEXT_NAME)) context.set(key, val); } return data; }
/** * Returns the given data item, with the specified hidden key being * un-hidden. * * @param key * @param item * @return * @deprecated */ public final static Data unhide(String key, Data item) { String hidden = Data.HIDDEN_PREFIX + key; if (item.containsKey(hidden)) { Serializable o = item.remove(hidden); item.put(key, o); } return item; }
/** * @see stream.Processor#process(stream.Data) */ @Override public Data processMatchingData(Data input) { if (oldKey != null && newKey != null && input.containsKey(oldKey)) { if (input.containsKey(newKey)) log.warn("Overwriting existing key '{}'!", newKey); Serializable o = input.remove(oldKey); input.put(newKey, o); } return input; } }
/** * */ @Override public Data processMatchingData(Data data) { if (key != null && value != null) { Serializable val = null; if (value == "null") { if (scope.contains(Context.DATA_CONTEXT_NAME) || scope.isEmpty()) data.remove(key); else if (scope.contains(Context.PROCESS_CONTEXT_NAME)) context.set(key, null); } else try { Serializable s = (exp == null) ? null : exp.get(context, data); val = s == null ? value : s; } catch (Exception e) { e.printStackTrace(); } if (scope.contains(Context.DATA_CONTEXT_NAME) || scope.isEmpty()) data.put(key, val); if (scope.contains(Context.PROCESS_CONTEXT_NAME)) context.set(key, val); } return data; }
input.remove(key);
input.remove(key);