use of com.revolsys.record.Record in project com.revolsys.open by revolsys.
the class AddDefaultValuesProcess method run.
@Override
protected void run(final Channel<Record> in, final Channel<Record> out) {
for (Record record = in.read(); record != null; record = in.read()) {
process(record);
out.write(record);
}
}
use of com.revolsys.record.Record in project com.revolsys.open by revolsys.
the class ScriptExecutorBoundingBoxTaskSplitter method execute.
@Override
public void execute(final BoundingBox boundingBox) {
this.outsideBoundaryObjects.expandBoundary(boundingBox.toGeometry());
final ScriptExecutorRunnable executor = new ScriptExecutorRunnable(this.scriptName, this.attributes);
executor.setLogScriptInfo(isLogScriptInfo());
executor.addBean("boundingBox", boundingBox);
final Set<Record> objects = this.outsideBoundaryObjects.getAndClearObjects();
executor.addBean("outsideBoundaryObjects", objects);
executor.addBeans(this.beans);
executor.addBeans(this.inChannels);
executor.addBeans(this.outChannels);
executor.run();
}
use of com.revolsys.record.Record in project com.revolsys.open by revolsys.
the class RecordAccessor method read.
@Override
public TypedValue read(final EvaluationContext context, final Object target, final String name) throws AccessException {
final Record object = (Record) target;
final Object value = object.getValue(name);
if (value == null && !object.hasField(name)) {
throw new RecordAccessException(name);
}
return new TypedValue(value);
}
use of com.revolsys.record.Record in project com.revolsys.open by revolsys.
the class Json method toRecordList.
public static List<Record> toRecordList(final RecordDefinition recordDefinition, final String string) {
final StringReader in = new StringReader(string);
final JsonRecordIterator iterator = new JsonRecordIterator(recordDefinition, in);
try {
final List<Record> objects = new ArrayList<>();
while (iterator.hasNext()) {
final Record object = iterator.next();
objects.add(object);
}
return objects;
} finally {
iterator.close();
}
}
use of com.revolsys.record.Record in project com.revolsys.open by revolsys.
the class Json method toString.
public static String toString(final RecordDefinition recordDefinition, final List<? extends Map<String, Object>> list) {
final StringWriter writer = new StringWriter();
final JsonRecordWriter recordWriter = new JsonRecordWriter(recordDefinition, writer);
for (final Map<String, Object> map : list) {
final Record object = new ArrayRecord(recordDefinition);
object.setValues(map);
recordWriter.write(object);
}
recordWriter.close();
return writer.toString();
}
Aggregations