Class ValueFactoryQImpl
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl
-
- All Implemented Interfaces:
ValueFactory
public class ValueFactoryQImpl extends java.lang.Object implements ValueFactory
This class implements theValueFactoryinterface, wrapping an existing SPIQValueFactoryand aNamePathResolver.- See Also:
ValueFactory,QValueFactory
-
-
Constructor Summary
Constructors Constructor Description ValueFactoryQImpl(QValueFactory qfactory, NamePathResolver resolver)Constructs a newValueFactoryQImplbased on an existing SPIQValueFactoryand aNamePathResolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BinarycreateBinary(java.io.InputStream stream)Returns aBinaryobject with a value consisting of the content of the specifiedInputStream.ValuecreateValue(boolean value)ValuecreateValue(double value)ValuecreateValue(long value)ValuecreateValue(java.io.InputStream value)Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedInputStream.ValuecreateValue(java.lang.String value)ValuecreateValue(java.lang.String value, int type)ValuecreateValue(java.math.BigDecimal value)ValuecreateValue(java.util.Calendar value)ValuecreateValue(Binary value)Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.ValuecreateValue(Node value)ValuecreateValue(Node value, boolean weak)Returns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode.ValuecreateValue(QValue qvalue)Create a newValuebased on an existingQValueQValueFactorygetQValueFactory()TheQValueFactorythat is wrapped by thisValueFactoryinstance.
-
-
-
Constructor Detail
-
ValueFactoryQImpl
public ValueFactoryQImpl(QValueFactory qfactory, NamePathResolver resolver)
Constructs a newValueFactoryQImplbased on an existing SPIQValueFactoryand aNamePathResolver.- Parameters:
qfactory- wrappedQValueFactoryresolver- wrappedNamePathResolver
-
-
Method Detail
-
getQValueFactory
public QValueFactory getQValueFactory()
TheQValueFactorythat is wrapped by thisValueFactoryinstance.- Returns:
- qfactory The
QValueFactorywrapped by this instance.
-
createValue
public Value createValue(QValue qvalue)
Create a newValuebased on an existingQValue- Parameters:
qvalue- existingQValue- Returns:
- a
Valuerepresenting theQValue
-
createValue
public Value createValue(java.lang.String value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aString- Returns:
- a
ValueofPropertyType.STRING
-
createValue
public Value createValue(long value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
createValue
public Value createValue(double value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
createValue
public Value createValue(boolean value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aboolean- Returns:
- a
ValueofPropertyType.BOOLEAN
-
createValue
public Value createValue(java.util.Calendar value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aCalendar- Returns:
- a
ValueofPropertyType.DATE
-
createValue
public Value createValue(java.io.InputStream value)
Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedInputStream.The passed
InputStreamis closed before this method returns either normally or because of an exception.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- anInputStream- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
public Value createValue(Node value) throws RepositoryException
Returns aValueobject ofPropertyType.REFERENCEthat holds the identifier of the specifiedNode. ThisValueobject can then be used to set a property that will be a reference to thatNode.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aNode- Returns:
- a
ValueofPropertyType.REFERENCE - Throws:
RepositoryException- if the specifiedNodeis not referenceable, the currentSessionis no longer active, or another error occurs.
-
createValue
public Value createValue(java.lang.String value, int type) throws ValueFormatException
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aStringtype- one of the constants defined inPropertyType.- Returns:
- a
ValueofPropertyTypetype. - Throws:
ValueFormatException- if the specifiedvaluecannot be converted to the specifiedtype.
-
createBinary
public Binary createBinary(java.io.InputStream stream) throws RepositoryException
Description copied from interface:ValueFactoryReturns aBinaryobject with a value consisting of the content of the specifiedInputStream.The passed
InputStreamis closed before this method returns either normally or because of an exception.- Specified by:
createBinaryin interfaceValueFactory- Parameters:
stream- anInputStream- Returns:
- a
Binary - Throws:
RepositoryException- if an error occurs.
-
createValue
public Value createValue(Binary value)
Description copied from interface:ValueFactoryReturns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aBinary- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
public Value createValue(java.math.BigDecimal value)
Description copied from interface:ValueFactory- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL
-
createValue
public Value createValue(Node value, boolean weak) throws RepositoryException
Description copied from interface:ValueFactoryReturns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode. ThisValueobject can then be used to set a property that will be a reference to thatNode.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aNodeweak- aboolean. If true then aPropertyType.WEAKREFERENCEis created, otherwise aPropertyType.REFERENCEis created.- Returns:
- a
ValueofPropertyType.REFERENCEorPropertyType.REFERENCE - Throws:
RepositoryException- if the specifiedNodeis not referenceable, the currentSessionis no longer active, or another error occurs.
-
-