private class FieldNameTemplateResolver implements NameTemplateResolver {
@Override
public Object resolve(TemplatePart part) {
RecordContext ctx = contexts.peek();
//TODO: add dependencies caused by resolving name template variables
if (part instanceof FieldTemplatePart) {
QName fieldName = ((FieldTemplatePart) part).getFieldType().getName();
if (ctx.record.hasField(fieldName)) {
return ctx.record.getField(fieldName);