/** * @see QValueFactory#create(long) */ public QValue create(long value) throws RepositoryException { return new DefaultQValue(value); }
/** * @see QValue#getStream() */ public InputStream getStream() throws RepositoryException { try { // convert via string return new ByteArrayInputStream(getString().getBytes( AbstractQValueFactory.DEFAULT_ENCODING)); } catch (UnsupportedEncodingException e) { throw new RepositoryException(QValueFactoryImpl.DEFAULT_ENCODING + " is not supported encoding on this platform", e); } } }
/** * @see QValue#getStream() */ public InputStream getStream() throws RepositoryException { try { // convert via string return new ByteArrayInputStream(getString().getBytes( AbstractQValueFactory.DEFAULT_ENCODING)); } catch (UnsupportedEncodingException e) { throw new RepositoryException(QValueFactoryImpl.DEFAULT_ENCODING + " is not supported encoding on this platform", e); } } }
/** * @see QValueFactory#create(double) */ public QValue create(double value) throws RepositoryException { return new DefaultQValue(value); }
/** * @see QValueFactory#create(long) */ public QValue create(long value) throws RepositoryException { return new DefaultQValue(value); }
/** * Creates a new QValue of type STRING. * * @param value the string value. * @return a new QValue. */ protected QValue createString(String value) { return new DefaultQValue(value, PropertyType.STRING); }
/** * @see QValueFactory#create(double) */ public QValue create(double value) throws RepositoryException { return new DefaultQValue(value); }
/** * Creates a new QValue of type STRING. * * @param value the string value. * @return a new QValue. */ protected QValue createString(String value) { return new DefaultQValue(value, PropertyType.STRING); }
/** * Creates a new QValue of type REFERENCE or WEAKREFERENCE. * * @param ref the reference value. * @param weak whether the reference is weak. * @return a new QValue. */ protected QValue createReference(String ref, boolean weak) { if (weak) { return new DefaultQValue(ref, PropertyType.WEAKREFERENCE); } else { return new DefaultQValue(ref, PropertyType.REFERENCE); } } }
/** * Creates a new QValue of type REFERENCE or WEAKREFERENCE. * * @param ref the reference value. * @param weak whether the reference is weak. * @return a new QValue. */ protected QValue createReference(String ref, boolean weak) { if (weak) { return new DefaultQValue(ref, PropertyType.WEAKREFERENCE); } else { return new DefaultQValue(ref, PropertyType.REFERENCE); } } }
/** * @see QValueFactory#create(URI) */ public QValue create(URI value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Name) */ public QValue create(Name value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Path) */ public QValue create(Path value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(URI) */ public QValue create(BigDecimal value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Name) */ public QValue create(Name value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Calendar) */ public QValue create(Calendar value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Path) */ public QValue create(Path value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(URI) */ public QValue create(BigDecimal value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(Calendar) */ public QValue create(Calendar value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }
/** * @see QValueFactory#create(URI) */ public QValue create(URI value) throws RepositoryException { if (value == null) { throw new IllegalArgumentException("Cannot create QValue from null value."); } return new DefaultQValue(value); }