return stringFactory.create(location.getPath());
}
};
}
if (operand instanceof NodeName) {
NodeName nodeName = (NodeName)operand;
final int locationIndex = columns.getLocationIndex(nodeName.getSelectorName().getName());
return new DynamicOperation() {
public String getExpectedType() {
return stringFactory.getTypeName();
}
public Object evaluate( Object[] tuple ) {
Location location = (Location)tuple[locationIndex];
if (location == null) return null;
Path path = location.getPath();
assert path != null;
return path.isRoot() ? "" : stringFactory.create(location.getPath().getLastSegment().getName());
}
};
}
if (operand instanceof NodeLocalName) {
NodeLocalName nodeName = (NodeLocalName)operand;
final int locationIndex = columns.getLocationIndex(nodeName.getSelectorName().getName());
return new DynamicOperation() {
public String getExpectedType() {
return stringFactory.getTypeName();
}