|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.property.basic.AbstractValueFactory<Binary> org.jboss.dna.graph.property.basic.AbstractBinaryValueFactory
@Immutable public abstract class AbstractBinaryValueFactory
An abstract BinaryFactory
implementation that contains many general methods that are likely to be appropriate for many
concrete implementations.
Field Summary |
---|
Fields inherited from interface org.jboss.dna.graph.property.ValueFactory |
---|
DEFAULT_DECODER, DEFAULT_ENCODER |
Method Summary | |
---|---|
Binary |
create(BigDecimal value)
Create a value from a decimal. |
Binary |
create(Binary value)
Create a value from the binary content given by the supplied stream. |
Binary |
create(boolean value)
Create a boolean from a string. |
Binary |
create(Calendar value)
Create a value from a Calendar instance. |
Binary |
create(Date value)
Create a value from a date. |
Binary |
create(DateTime value)
Create a value from a date-time instant. |
Binary |
create(double value)
Create a value from a double. |
Binary |
create(File file)
Create a binary value from the given file. |
Binary |
create(float value)
Create a value from a float. |
Binary |
create(InputStream stream,
long approximateLength)
Create a value from the binary content given by the supplied stream. |
Binary |
create(InputStream stream,
long approximateLength,
byte[] secureHash)
Create a value from the binary content given by the supplied stream, the approximate length, and the SHA-1 secure hash of the content. This implementation does not manage or share the in-memory binary values, so this implementation is identical to calling create(InputStream, long) . |
Binary |
create(int value)
Create a value from an integer. |
Binary |
create(long value)
Create a long from a string. |
Binary |
create(Name value)
Create a value from a name. |
Binary |
create(Path value)
Create a value from a path. |
Binary |
create(Reader reader,
long approximateLength)
Create a value from a the binary content given by the supplied reader. |
Binary |
create(Reader reader,
long approximateLength,
byte[] secureHash)
Create a value from the binary content given by the supplied reader, the approximate length, and the SHA-1 secure hash of the content. This implementation does not manage or share the in-memory binary values, so this implementation is identical to calling create(Reader, long) . |
Binary |
create(Reference value)
Create a value from a reference. |
Binary |
create(String value)
Create a value from a string, using no decoding. |
Binary |
create(String value,
TextDecoder decoder)
Create a value from a string, using the supplied decoder. |
Binary |
create(URI value)
Create a value from a URI. |
Binary |
create(UUID value)
Create a value from a UUID. |
Binary |
find(byte[] secureHash)
Find an existing binary value given the supplied secure hash. This method always returns null, since the in-memory binary values are not managed or shared. |
Methods inherited from class org.jboss.dna.graph.property.basic.AbstractValueFactory |
---|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getDecoder, getPropertyType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.dna.graph.property.ValueFactory |
---|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getPropertyType |
Method Detail |
---|
public Binary create(String value)
create
in interface ValueFactory<Binary>
value
- the string from which the value is to be created
ValueFactory.create(String, TextDecoder)
public Binary create(String value, TextDecoder decoder)
create
in interface ValueFactory<Binary>
value
- the string from which the value is to be createddecoder
- the decoder that should be used; if null, the default decoder
is used
ValueFactory.create(String)
public Binary create(int value)
create
in interface ValueFactory<Binary>
value
- the integer from which the value is to be created
public Binary create(long value)
create
in interface ValueFactory<Binary>
value
- the string from which the long is to be created
public Binary create(boolean value)
create
in interface ValueFactory<Binary>
value
- the boolean from which the value is to be created
public Binary create(float value)
create
in interface ValueFactory<Binary>
value
- the float from which the value is to be created
public Binary create(double value)
create
in interface ValueFactory<Binary>
value
- the double from which the value is to be created
public Binary create(BigDecimal value)
create
in interface ValueFactory<Binary>
value
- the decimal from which the value is to be created
public Binary create(Calendar value)
create
in interface ValueFactory<Binary>
value
- the Calendar instance from which the value is to be created
public Binary create(Date value)
create
in interface ValueFactory<Binary>
value
- the date from which the value is to be created
public Binary create(DateTime value) throws ValueFormatException
create
in interface ValueFactory<Binary>
value
- the date-time instant from which the value is to be created
ValueFormatException
- if the conversion from a Date could not be performedValueFactory.create(org.jboss.dna.graph.property.DateTime)
public Binary create(Name value)
create
in interface ValueFactory<Binary>
value
- the name from which the value is to be created
public Binary create(Path value)
create
in interface ValueFactory<Binary>
value
- the path from which the value is to be created
public Binary create(Reference value)
create
in interface ValueFactory<Binary>
value
- the reference from which the value is to be created
public Binary create(URI value)
create
in interface ValueFactory<Binary>
value
- the URI from which the value is to be created
public Binary create(UUID value)
create
in interface ValueFactory<Binary>
value
- the UUID from which the value is to be created
ValueFactory.create(java.util.UUID)
public Binary create(Binary value) throws ValueFormatException, IoException
create
in interface ValueFactory<Binary>
value
- the binary object to be used to create the value
ValueFormatException
- if the conversion from the binary object could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied binary value (such as an
IOException
).ValueFactory.create(org.jboss.dna.graph.property.Binary)
public Binary create(InputStream stream, long approximateLength) throws IoException
create
in interface ValueFactory<Binary>
stream
- the stream containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)
IoException
- If an unexpected problem occurs while accessing the supplied stream (such as an IOException
).public Binary create(Reader reader, long approximateLength) throws IoException
create
in interface ValueFactory<Binary>
reader
- the reader containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)
IoException
- If an unexpected problem occurs while accessing the supplied reader (such as an IOException
).public Binary create(File file) throws ValueFormatException, IoException
create
in interface BinaryFactory
file
- the file containing the content to be used
ValueFormatException
- if the conversion from the file could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied file (such as an IOException
).BinaryFactory.create(java.io.File)
public Binary create(Reader reader, long approximateLength, byte[] secureHash) throws ValueFormatException, IoException
This implementation does not manage or share the in-memory binary values, so this implementation is identical to calling
create(Reader, long)
.
create
in interface BinaryFactory
reader
- the reader containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)secureHash
- the secure hash of the content in the stream
; if null, the secure hash is computed from the
content, and if not null it is assumed to be the correct secure hash (and is not checked)
ValueFormatException
- if the conversion from a reader could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied reader (such as an IOException
).BinaryFactory.create(java.io.Reader, long, byte[])
public Binary create(InputStream stream, long approximateLength, byte[] secureHash) throws ValueFormatException, IoException
This implementation does not manage or share the in-memory binary values, so this implementation is identical to calling
create(InputStream, long)
.
create
in interface BinaryFactory
stream
- the stream containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)secureHash
- the secure hash of the content in the stream
; if null, the secure hash is computed from the
content, and if not null it is assumed to be the correct secure hash (and is not checked)
ValueFormatException
- if the conversion from an input stream could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied stream (such as an IOException
).BinaryFactory.create(java.io.InputStream, long, byte[])
public Binary find(byte[] secureHash)
This method always returns null, since the in-memory binary values are not managed or shared.
find
in interface BinaryFactory
secureHash
- the secure hash of the binary content, which was probably obtained
from a
previously-held Binary
object; a null or empty value is allowed, but will always result in returning null
BinaryFactory.find(byte[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |