/** * @see javax.jcr.Value#getBoolean() */ public boolean getBoolean() throws RepositoryException { if (getType() == PropertyType.STRING || getType() == PropertyType.BINARY || getType() == PropertyType.BOOLEAN) { return Boolean.valueOf(qvalue.getString()); } else { throw new ValueFormatException("incompatible type " + PropertyType.nameFromValue(qvalue.getType())); } }
/** * @see javax.jcr.Value#getBoolean() */ public boolean getBoolean() throws RepositoryException { if (getType() == PropertyType.STRING || getType() == PropertyType.BINARY || getType() == PropertyType.BOOLEAN) { return Boolean.valueOf(qvalue.getString()); } else { throw new ValueFormatException("incompatible type " + PropertyType.nameFromValue(qvalue.getType())); } }
/** * @see javax.jcr.Value#getStream() */ public InputStream getStream() throws IllegalStateException, RepositoryException { if (stream == null) { if (getType() == PropertyType.NAME || getType() == PropertyType.PATH) { // qualified name/path value needs to be resolved stream = new ByteArrayInputStream(getString().getBytes(StandardCharsets.UTF_8)); } else { stream = qvalue.getStream(); } } return stream; }
/** * @see javax.jcr.Value#getStream() */ public InputStream getStream() throws IllegalStateException, RepositoryException { if (stream == null) { if (getType() == PropertyType.NAME || getType() == PropertyType.PATH) { // qualified name/path value needs to be resolved stream = new ByteArrayInputStream(getString().getBytes(StandardCharsets.UTF_8)); } else { stream = qvalue.getStream(); } } return stream; }
/** * {@inheritDoc} */ public boolean getBoolean() throws RepositoryException { setValueConsumed(); if (getType() == PropertyType.STRING || getType() == PropertyType.BINARY || getType() == PropertyType.BOOLEAN) { return Boolean.valueOf(qvalue.getString()).booleanValue(); } else { throw new ValueFormatException("incompatible type " + PropertyType.nameFromValue(qvalue.getType())); } }
/** * @see javax.jcr.Value#getString() */ public String getString() throws RepositoryException { if (getType() == PropertyType.NAME) { // qualified name value needs to be resolved return resolver.getJCRName(qvalue.getName()); } else if (getType() == PropertyType.PATH) { // qualified path value needs to be resolved return resolver.getJCRPath(qvalue.getPath()); } else { return qvalue.getString(); } }
/** * @see javax.jcr.Value#getString() */ public String getString() throws RepositoryException { if (getType() == PropertyType.NAME) { // qualified name value needs to be resolved return resolver.getJCRName(qvalue.getName()); } else if (getType() == PropertyType.PATH) { // qualified path value needs to be resolved return resolver.getJCRPath(qvalue.getPath()); } else { return qvalue.getString(); } }
/** * {@inheritDoc} */ public InputStream getStream() throws IllegalStateException, RepositoryException { setStreamConsumed(); if (stream == null) { if (getType() == PropertyType.NAME || getType() == PropertyType.PATH) { // needs namespace mapping try { String l_s = getType() == PropertyType.NAME ? resolver.getJCRName(qvalue.getName()) : resolver.getJCRPath(qvalue.getPath()); stream = new ByteArrayInputStream(l_s.getBytes("UTF-8")); } catch (UnsupportedEncodingException ex) { throw new RepositoryException(ex); } } else { stream = qvalue.getStream(); } } return stream; }
/** * {@inheritDoc} */ public String getString() throws RepositoryException { setValueConsumed(); if (getType() == PropertyType.NAME) { // needs formatting return resolver.getJCRName(qvalue.getName()); } else if (getType() == PropertyType.PATH) { // needs formatting return resolver.getJCRPath(qvalue.getPath()); } else { return qvalue.getString(); } }
/** * @see javax.jcr.Value#getDecimal() */ public BigDecimal getDecimal() throws ValueFormatException, IllegalStateException, RepositoryException { switch (getType()) { case PropertyType.DECIMAL: case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DATE: case PropertyType.STRING: return qvalue.getDecimal(); default: throw new ValueFormatException("incompatible type " + PropertyType.nameFromValue(qvalue.getType())); } }
/** * @see javax.jcr.Value#getDecimal() */ public BigDecimal getDecimal() throws ValueFormatException, IllegalStateException, RepositoryException { switch (getType()) { case PropertyType.DECIMAL: case PropertyType.DOUBLE: case PropertyType.LONG: case PropertyType.DATE: case PropertyType.STRING: return qvalue.getDecimal(); default: throw new ValueFormatException("incompatible type " + PropertyType.nameFromValue(qvalue.getType())); } }