}
return currentOakProperty(t, oakPropertyName, propertyType);
}
private PropertyValue currentOakProperty(Tree t, String oakPropertyName, Integer propertyType) {
PropertyValue result;
if (t == null || !t.exists()) {
return null;
}
if (oakPropertyName.equals(QueryImpl.JCR_PATH)) {
String path = currentPath();
String local = getLocalPath(path);
if (local == null) {
// not a local path
return null;
}
result = PropertyValues.newString(local);
} else if (oakPropertyName.equals(QueryImpl.JCR_SCORE)) {
result = currentRow.getValue(QueryImpl.JCR_SCORE);
} else if (oakPropertyName.equals(QueryImpl.REP_EXCERPT)) {
result = currentRow.getValue(QueryImpl.REP_EXCERPT);
} else {
result = PropertyValues.create(t.getProperty(oakPropertyName));
}
if (result == null) {
return null;
}
if (propertyType != null && result.getType().tag() != propertyType) {
return null;
}
return result;
}