@Override public PropertyValue currentProperty() { PropertyValue p = operand1.currentProperty(); return p != null ? p : operand2.currentProperty(); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand1.currentProperty(); return p != null ? p : operand2.currentProperty(); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand1.currentProperty(); return p != null ? p : operand2.currentProperty(); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO what is the expected result of UPPER(x) for an array property? // currently throws an exception String value = p.getValue(STRING); return PropertyValues.newString(value.toUpperCase()); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO what is the expected result of UPPER(x) for an array property? // currently throws an exception String value = p.getValue(STRING); return PropertyValues.newString(value.toUpperCase()); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO what is the expected result of UPPER(x) for an array property? // currently throws an exception String value = p.getValue(STRING); return PropertyValues.newString(value.toUpperCase()); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO namespace remapping? if (!p.isArray()) { long length = p.size(); return PropertyValues.newLong(length); } // TODO what is the expected result for LENGTH(multiValueProperty)? throw new IllegalArgumentException("LENGTH(x) on multi-valued property is not supported"); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO namespace remapping? if (!p.isArray()) { long length = p.size(); return PropertyValues.newLong(length); } // TODO what is the expected result for LENGTH(multiValueProperty)? throw new IllegalArgumentException("LENGTH(x) on multi-valued property is not supported"); }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO namespace remapping? if (!p.isArray()) { long length = p.size(); return PropertyValues.newLong(length); } // TODO what is the expected result for LENGTH(multiValueProperty)? throw new IllegalArgumentException("LENGTH(x) on multi-valued property is not supported"); }
ResultRowImpl currentRow() { int selectorCount = selectors.size(); Tree[] trees = new Tree[selectorCount]; for (int i = 0; i < selectorCount; i++) { SelectorImpl s = selectors.get(i); trees[i] = s.currentTree(); } int columnCount = columns.length; PropertyValue[] values = new PropertyValue[columnCount]; for (int i = 0; i < columnCount; i++) { ColumnImpl c = columns[i]; values[i] = c.currentProperty(); } PropertyValue[] orderValues; if (orderings == null) { orderValues = null; } else { int size = orderings.length; orderValues = new PropertyValue[size]; for (int i = 0; i < size; i++) { orderValues[i] = orderings[i].getOperand().currentProperty(); } } return new ResultRowImpl(this, trees, values, distinctColumns, orderValues); }
ResultRowImpl currentRow() { int selectorCount = selectors.size(); Tree[] trees = new Tree[selectorCount]; for (int i = 0; i < selectorCount; i++) { SelectorImpl s = selectors.get(i); trees[i] = s.currentTree(); } int columnCount = columns.length; PropertyValue[] values = new PropertyValue[columnCount]; for (int i = 0; i < columnCount; i++) { ColumnImpl c = columns[i]; values[i] = c.currentProperty(); } PropertyValue[] orderValues; if (orderings == null) { orderValues = null; } else { int size = orderings.length; orderValues = new PropertyValue[size]; for (int i = 0; i < size; i++) { orderValues[i] = orderings[i].getOperand().currentProperty(); } } return new ResultRowImpl(this, trees, values, distinctColumns, orderValues); }
ResultRowImpl currentRow() { int selectorCount = selectors.size(); Tree[] trees = new Tree[selectorCount]; for (int i = 0; i < selectorCount; i++) { SelectorImpl s = selectors.get(i); trees[i] = s.currentTree(); } int columnCount = columns.length; PropertyValue[] values = new PropertyValue[columnCount]; for (int i = 0; i < columnCount; i++) { ColumnImpl c = columns[i]; values[i] = c.currentProperty(); } PropertyValue[] orderValues; if (orderings == null) { orderValues = null; } else { int size = orderings.length; orderValues = new PropertyValue[size]; for (int i = 0; i < size; i++) { orderValues[i] = orderings[i].getOperand().currentProperty(); } } return new ResultRowImpl(this, trees, values, distinctColumns, orderValues); }
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
@Override public boolean evaluate() { // JCR 2.0 spec, 6.7.16 Comparison: // "operand1 may evaluate to an array of values" PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false; } for (StaticOperandImpl s : operand2) { PropertyValue p2 = s.currentValue(); if (p2 == null) { // if the property doesn't exist, the result is false continue; } // "the value of operand2 is converted to the // property type of the value of operand1" p2 = convertValueToType(p2, p1); if (PropertyValues.match(p1, p2)) { return true; } } return false; }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO toLowerCase(): document the Turkish locale problem if (p.getType().isArray()) { Iterable<String> lowerCase = transform(p.getValue(STRINGS), new Function<String, String>() { @Override public String apply(String input) { return input.toLowerCase(); } }); return PropertyValues.newString(lowerCase); } else { String value = p.getValue(STRING); return PropertyValues.newString(value.toLowerCase()); } }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO toLowerCase(): document the Turkish locale problem if (p.getType().isArray()) { Iterable<String> lowerCase = transform(p.getValue(STRINGS), new Function<String, String>() { @Override public String apply(String input) { return input.toLowerCase(); } }); return PropertyValues.newString(lowerCase); } else { String value = p.getValue(STRING); return PropertyValues.newString(value.toLowerCase()); } }
@Override public PropertyValue currentProperty() { PropertyValue p = operand.currentProperty(); if (p == null) { return null; } // TODO toLowerCase(): document the Turkish locale problem if (p.getType().isArray()) { Iterable<String> lowerCase = transform(p.getValue(STRINGS), new Function<String, String>() { @Override public String apply(String input) { return input.toLowerCase(); } }); return PropertyValues.newString(lowerCase); } else { String value = p.getValue(STRING); return PropertyValues.newString(value.toLowerCase()); } }
PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false;
PropertyValue p1 = operand1.currentProperty(); if (p1 == null) { return false;