public class JcrValueFactory extends Object implements ValueFactory
ValueFactory
implementation for ModeShape.Modifier | Constructor and Description |
---|---|
protected |
JcrValueFactory(ExecutionContext context) |
Modifier and Type | Method and Description |
---|---|
protected Object |
convertValueToType(Object value,
int toType) |
BinaryValue |
createBinary(byte[] value)
Creates a JCR
Binary value from the given byte array. |
BinaryValue |
createBinary(InputStream value) |
BinaryValue |
createBinary(InputStream value,
String hint)
Creates a JCR
Binary value from the given input stream with a hint to the factory (which is
passed to the storage layer) |
String |
createName(String localName)
Creates a JCR compliant name string, from the given local name.
|
String |
createName(String namespaceUri,
String localName)
Creates a JCR compliant name string, from the given namespace uri and local name.
|
org.modeshape.jcr.JcrValue |
createSimpleReference(Node node)
Returns a
Value object of PropertyType.SIMPLE_REFERENCE that holds the identifier of the specified
Node . |
org.modeshape.jcr.JcrValue |
createValue(BigDecimal value) |
org.modeshape.jcr.JcrValue |
createValue(Binary value) |
org.modeshape.jcr.JcrValue |
createValue(boolean value) |
org.modeshape.jcr.JcrValue |
createValue(Calendar value) |
org.modeshape.jcr.JcrValue |
createValue(Date value)
|
org.modeshape.jcr.JcrValue |
createValue(double value) |
org.modeshape.jcr.JcrValue |
createValue(InputStream value) |
org.modeshape.jcr.JcrValue |
createValue(long value) |
org.modeshape.jcr.JcrValue |
createValue(Node value) |
org.modeshape.jcr.JcrValue |
createValue(Node value,
boolean weak) |
org.modeshape.jcr.JcrValue |
createValue(Object value,
int propertyType) |
org.modeshape.jcr.JcrValue |
createValue(Reference value) |
org.modeshape.jcr.JcrValue |
createValue(String value) |
org.modeshape.jcr.JcrValue |
createValue(String value,
int propertyType) |
Value |
createValue(URI value)
|
org.modeshape.jcr.JcrValue[] |
createValues(List<?> values,
int propertyType) |
protected ValueFactory<?> |
valueFactoryFor(int jcrPropertyType) |
protected JcrValueFactory(ExecutionContext context)
public org.modeshape.jcr.JcrValue[] createValues(List<?> values, int propertyType) throws ValueFormatException
ValueFormatException
public org.modeshape.jcr.JcrValue createValue(String value, int propertyType) throws ValueFormatException
createValue
in interface ValueFactory
ValueFormatException
public org.modeshape.jcr.JcrValue createValue(Object value, int propertyType) throws ValueFormatException
ValueFormatException
public org.modeshape.jcr.JcrValue createValue(Node value) throws RepositoryException
createValue
in interface ValueFactory
RepositoryException
public org.modeshape.jcr.JcrValue createValue(Node value, boolean weak) throws RepositoryException
createValue
in interface ValueFactory
RepositoryException
public org.modeshape.jcr.JcrValue createValue(Binary value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(InputStream value)
createValue
in interface ValueFactory
public BinaryValue createBinary(InputStream value)
createBinary
in interface ValueFactory
public BinaryValue createBinary(InputStream value, String hint)
ValueFactory
Binary
value from the given input stream with a hint to the factory (which is
passed to the storage layer)value
- a non-null input streamhint
- a hint that the storage layer may use to make persistence decisionspublic org.modeshape.jcr.JcrValue createValue(Calendar value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(boolean value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(double value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(long value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(String value)
createValue
in interface ValueFactory
public org.modeshape.jcr.JcrValue createValue(BigDecimal value)
createValue
in interface ValueFactory
public BinaryValue createBinary(byte[] value)
ValueFactory
Binary
value from the given byte array.value
- a non-null byte arraypublic org.modeshape.jcr.JcrValue createValue(Date value)
ValueFactory
value
- a non-null date instancepublic Value createValue(URI value)
ValueFactory
value
- a non-null URI instancepublic org.modeshape.jcr.JcrValue createValue(Reference value)
public String createName(String localName)
ValueFactory
localName
- a non-null string.public String createName(String namespaceUri, String localName)
ValueFactory
namespaceUri
- a non-null string.localName
- a non-null string.public org.modeshape.jcr.JcrValue createSimpleReference(Node node) throws RepositoryException
ValueFactory
Value
object of PropertyType.SIMPLE_REFERENCE
that holds the identifier of the specified
Node
. This Value
object can then be used to set a property that will be a reference to that
Node
.node
- a Node
Value
of PropertyType.SIMPLE_REFERENCE
RepositoryException
- if an error occurs.protected ValueFactory<?> valueFactoryFor(int jcrPropertyType)
protected Object convertValueToType(Object value, int toType) throws ValueFormatException
ValueFormatException
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.