return "(nodePath " + nodePath.getSelectorName() + ")";
}
};
}
if (operand instanceof NodeName) {
final NodeName nodeName = (NodeName)operand;
final int indexInRow = columns.getSelectorIndex(nodeName.getSelectorName());
final NodeCache cache = context.getNodeCache(sources.getWorkspaceName());
return new ExtractFromRow() {
@Override
public TypeFactory<?> getType() {
return stringFactory;
}
@Override
public Object getValueInRow( RowAccessor row ) {
CachedNode node = row.getNode(indexInRow);
if (node == null) return null;
Name name = node.getName(cache);
return stringFactory.create(name);
}
@Override
public String toString() {
return "(nodeName " + nodeName.getSelectorName() + ")";
}
};
}
if (operand instanceof NodeLocalName) {
final NodeLocalName nodeName = (NodeLocalName)operand;
final int indexInRow = columns.getSelectorIndex(nodeName.getSelectorName());
final NodeCache cache = context.getNodeCache(sources.getWorkspaceName());
return new ExtractFromRow() {
@Override
public TypeFactory<?> getType() {
return stringFactory;
}
@Override
public Object getValueInRow( RowAccessor row ) {
CachedNode node = row.getNode(indexInRow);
if (node == null) return null;
Name name = node.getName(cache);
return name.getLocalName(); // works even for root
}
@Override
public String toString() {
return "(localName " + nodeName.getSelectorName() + ")";
}
};
}
if (operand instanceof FullTextSearchScore) {
final FullTextSearchScore fts = (FullTextSearchScore)operand;