/** * Create a new <code>Value</code> based on an existing * <code>QValue</code> * @param qvalue existing <code>QValue</code> * @return a <code>Value</code> representing the <code>QValue</code> */ public Value createValue(QValue qvalue) { return new QValueValue(qvalue, resolver); }
private Value[] createValues(QValue[] qv) { if (qv == null){ return null; } Value[] ret = new Value[qv.length]; for (int i=0; i<ret.length; i++) { ret[i] = new QValueValue(qv[i], resolver); } return ret; }
/** * Create a new <code>Value</code> based on an existing * <code>QValue</code> * @param qvalue existing <code>QValue</code> * @return a <code>Value</code> representing the <code>QValue</code> */ public Value createValue(QValue qvalue) { return new QValueValue(qvalue, resolver); }
/** * Create a new <code>Value</code> based on an existing * <code>QValue</code> * @param qvalue existing <code>QValue</code> * @return a <code>Value</code> representing the <code>QValue</code> */ public Value createValue(QValue qvalue) { return new QValueValue(qvalue, resolver); }
private Value[] createValues(QValue[] qv) { if (qv == null){ return null; } Value[] ret = new Value[qv.length]; for (int i=0; i<ret.length; i++) { ret[i] = new QValueValue(qv[i], resolver); } return ret; }
/** * {@inheritDoc} */ public Value createValue(double value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(double value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(double value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
public Value createValue(BigDecimal value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(boolean value) { try { QValue qvalue = qfactory.create(Boolean.toString(value), PropertyType.BOOLEAN); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(long value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
public Value createValue(BigDecimal value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(boolean value) { try { QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(String value) { try { QValue qvalue = qfactory.create(value, PropertyType.STRING); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(Calendar value) { try { ISO8601.getYear(value); QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(Calendar value) { try { ISO8601.getYear(value); QValue qvalue = qfactory.create(value); return new QValueValue(qvalue, resolver); } catch (RepositoryException ex) { throw new RuntimeException(ex); } }
/** * {@inheritDoc} */ public Value createValue(Node value) throws RepositoryException { QValue qvalue = qfactory.create(value.getUUID(), PropertyType.REFERENCE); return new QValueValue(qvalue, resolver); }
public Value createValue(Node value, boolean weak) throws RepositoryException { QValue qvalue = qfactory.create(value.getUUID(), weak ? PropertyType.WEAKREFERENCE : PropertyType.REFERENCE); return new QValueValue(qvalue, resolver); }
/** * Creates a jcr Value from the given qvalue using the specified * factory. * @return the jcr value representing the qvalue. */ private Value createJcrValue(QValue qValue) throws RepositoryException { // build ValueFactory ValueFactoryQImpl valueFactory = new ValueFactoryQImpl(qvf, resolver); // build jcr value QValueValue jcrValue = new QValueValue(qValue, resolver); return ValueHelper.copy(jcrValue, valueFactory); } }
@Test public void addAlienBinaryProperty() throws RepositoryException, IOException { Session session = getAdminSession(); QValue qValue = QValueFactoryImpl.getInstance().create("binaryValue".getBytes()); Value value = new QValueValue(qValue, new DefaultNamePathResolver(session)); getNode(TEST_PATH).setProperty("binary", value); session.save(); Value valueAgain = getNode(TEST_PATH).getProperty("binary").getValue(); assertEqualStream(value.getBinary().getStream(), valueAgain.getBinary().getStream()); }