private void append(Length operand) { append("LENGTH("); append(operand.getPropertyValue()); append(")"); }
private void append(Length operand) { append("LENGTH("); append(operand.getPropertyValue()); append(")"); }
/** * Test case for {@link QueryObjectModelFactory#length(PropertyValue)} */ public void testLength() throws RepositoryException { PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1); Length len = qf.length(propValue); assertNotNull("Property value must not be null", len.getPropertyValue()); }
private void append(Length operand) { append("LENGTH("); append(operand.getPropertyValue()); append(")"); }
@Test public void length() throws RepositoryException { PropertyValue p = f.propertyValue("selectorName", "propertyName"); Length l = f.length(p); assertEquals(p, l.getPropertyValue()); assertEquals("LENGTH([selectorName].[propertyName])", l.toString()); }
/** * Returns the values of the given value length operand at the given row. * * @see #getProperty(PropertyValue, Row) * @param operand value length operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Row row) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), row); if (property == null) { return new Value[0]; } else if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } else { long length = property.getLength(); return new Value[] { factory.createValue(length) }; } }
/** * Returns the values of the given value length operand at the given row. * * @see #getProperty(PropertyValue, Row) * @param operand value length operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Row row) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), row); if (property == null) { return new Value[0]; } else if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } else { long length = property.getLength(); return new Value[] { factory.createValue(length) }; } }
/** * Returns the values of the given value length operand for the given node. * * @see #getProperty(PropertyValue, Node) * @param operand value length operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Node n) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), n); if (property == null) { return new Value[0]; } if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } long length = property.getLength(); return new Value[] { factory.createValue(length) }; }
/** * Returns the values of the given value length operand for the given node. * * @see #getProperty(PropertyValue, Node) * @param operand value length operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Node n) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), n); if (property == null) { return new Value[0]; } if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } long length = property.getLength(); return new Value[] { factory.createValue(length) }; }
/** * Returns the values of the given value length operand at the given row. * * @see #getProperty(PropertyValue, Row) * @param operand value length operand * @param row row * @return values of the operand at the given row * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Row row) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), row); if (property == null) { return new Value[0]; } else if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } else { long length = property.getLength(); return new Value[] { factory.createValue(length) }; } }
/** * Returns the values of the given value length operand for the given node. * * @see #getProperty(PropertyValue, Node) * @param operand value length operand * @param node node * @return values of the operand for the given node * @throws RepositoryException if the operand can't be evaluated */ private Value[] getLengthValues(Length operand, Node n) throws RepositoryException { Property property = getProperty(operand.getPropertyValue(), n); if (property == null) { return new Value[0]; } if (property.isMultiple()) { long[] lengths = property.getLengths(); Value[] values = new Value[lengths.length]; for (int i = 0; i < lengths.length; i++) { values[i] = factory.createValue(lengths[i]); } return values; } long length = property.getLength(); return new Value[] { factory.createValue(length) }; }
} else if (operand instanceof Length) { Length length = (Length) operand; return getSelectorName(length.getPropertyValue()); } else if (operand instanceof LowerCase) { LowerCase lower = (LowerCase) operand;
} else if (operand instanceof Length) { Length length = (Length) operand; return getSelectorName(length.getPropertyValue()); } else if (operand instanceof LowerCase) { LowerCase lower = (LowerCase) operand;