|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.value.basic.AbstractValueFactory<T>
T
- the property type@Immutable public abstract class AbstractValueFactory<T>
Abstract ValueFactory
.
Nested Class Summary | |
---|---|
protected static class |
AbstractValueFactory.ConvertingIterator<ValueType>
|
Field Summary |
---|
Fields inherited from interface org.modeshape.jcr.value.ValueFactory |
---|
DEFAULT_DECODER, DEFAULT_ENCODER |
Constructor Summary | |
---|---|
protected |
AbstractValueFactory(PropertyType type,
TextDecoder decoder,
ValueFactory<String> stringValueFactory)
|
Method Summary | |
---|---|
T[] |
create(BigDecimal[] values)
Create an array of values from an array of decimal values. |
T[] |
create(BinaryValue[] values)
Create an array of values from the array of binary objects. |
T[] |
create(boolean[] values)
Create an array of values from an array of booleans. |
T[] |
create(byte[][] values)
Create an array of values from the array of binary content. |
T[] |
create(Calendar[] values)
Create an array of values from an array of Calendar instances. |
T[] |
create(Date[] values)
Create an array of values from an array of dates. |
T[] |
create(DateTime[] values)
Create an array of values from an array of DateTime instants. |
T[] |
create(double[] values)
Create an array of values from an array of doubles. |
T[] |
create(float[] values)
Create an array of values from an array of floats. |
T[] |
create(int[] values)
Create an array of values from an array of integers. |
Iterable<T> |
create(Iterable<?> valueIterable)
Create an iterable with the values (of an unknown type). |
Iterator<T> |
create(Iterator<?> values)
Create an iterator over the values (of an unknown type). |
T[] |
create(long[] values)
Create an array of values from an array of longs. |
T[] |
create(Name[] values)
Create an array of values from an array of names. |
T[] |
create(NodeKey[] values)
Create an array of values from an array of NodeKey . |
T |
create(Object value)
Create a value from the specified information by determining which other create method applies and delegating
to that method. |
T[] |
create(Object[] values)
Create an array of values from the specified information by determining which other create method applies for
each object and then delegating to that method. |
T[] |
create(Path[] values)
Create an array of values from an array of paths. |
T[] |
create(Reference[] values)
Create an array of values from an array of references. |
T[] |
create(String[] values)
Create an array of values from an array of string values, using no decoding. |
T[] |
create(String[] values,
TextDecoder decoder)
Create an array of values from an array of strings, using the supplied decoder. |
T[] |
create(URI[] values)
Create an array of values from an array of URIs. |
T[] |
create(UUID[] values)
Create an array of values from an array of UUIDs. |
protected abstract T[] |
createEmptyArray(int length)
|
TextDecoder |
getDecoder()
Get the text decoder. |
protected TextDecoder |
getDecoder(TextDecoder decoder)
Utility method to obtain either the supplied decoder (if not null) or this factory's decoder . |
PropertyType |
getPropertyType()
Get the type of values created by this factory. |
protected ValueFactory<String> |
getStringValueFactory()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.modeshape.jcr.value.ValueFactory |
---|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create |
Constructor Detail |
---|
protected AbstractValueFactory(PropertyType type, TextDecoder decoder, ValueFactory<String> stringValueFactory)
Method Detail |
---|
protected ValueFactory<String> getStringValueFactory()
public TextDecoder getDecoder()
protected TextDecoder getDecoder(TextDecoder decoder)
decoder
.
decoder
- the decoder, which may be null if this factory's is to be used
public PropertyType getPropertyType()
ValueFactory
type
of values created by this factory.
getPropertyType
in interface ValueFactory<T>
public T create(Object value)
ValueFactory
create
method applies and delegating
to that method. Note that this method only will call create
methods that take a single parameter; so this
excludes ValueFactory.create(InputStream)
and ValueFactory.create(String, TextDecoder)
.
create
in interface ValueFactory<T>
value
- the value
protected abstract T[] createEmptyArray(int length)
public T[] create(BigDecimal[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the decimals from which the values are to be created
public T[] create(boolean[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the booleans from which the values are to be created
public T[] create(byte[][] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the array of content to be used to create the values
public T[] create(Calendar[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the Calendar instances from which the values are to be created
public T[] create(Date[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the dates from which the values are to be created
public T[] create(DateTime[] values) throws ValueFormatException
ValueFactory
DateTime
instants.
create
in interface ValueFactory<T>
values
- the instants from which the values are to be created
ValueFormatException
- if the conversion from an array of date values could not be performedpublic T[] create(double[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the doubles from which the values are to be created
public T[] create(float[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the floats from which the values are to be created
public T[] create(int[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the integers from which the values are to be created
public T[] create(long[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the longs from which the values are to be created
public T[] create(Name[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the names from which the values are to be created
public T[] create(Object[] values)
ValueFactory
create
method applies for
each object and then delegating to that method. Note that this method will not consider ValueFactory.create(InputStream)
and
ValueFactory.create(String, TextDecoder)
.
create
in interface ValueFactory<T>
values
- the values
public T[] create(Path[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the paths from which the values are to be created
public T[] create(Reference[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the references from which the values are to be created
public T[] create(String[] values, TextDecoder decoder)
ValueFactory
create
in interface ValueFactory<T>
values
- the string values from which the values are to be createddecoder
- the decoder that should be used; if null, the default decoder
is used
ValueFactory.create(String)
public T[] create(String[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the values
ValueFactory.create(String[], TextDecoder)
public T[] create(URI[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the URIs from which the values are to be created
public T[] create(UUID[] values)
ValueFactory
create
in interface ValueFactory<T>
values
- the UUIDs from which the values are to be created
public T[] create(NodeKey[] values) throws ValueFormatException
ValueFactory
NodeKey
.
create
in interface ValueFactory<T>
values
- the node key from which the value is to be created
ValueFormatException
- if the conversion from a NodeKey could not be performedpublic T[] create(BinaryValue[] values) throws ValueFormatException, IoException
ValueFactory
create
in interface ValueFactory<T>
values
- the values
ValueFormatException
- if the conversion from an array of objects could not be performed
IoException
- If an unexpected problem occurs during the conversion.public Iterator<T> create(Iterator<?> values) throws ValueFormatException, IoException
ValueFactory
ValueFactory.create(InputStream)
and ValueFactory.create(String, TextDecoder)
.
This is useful to use when iterating over the values
of a Property
.
create
in interface ValueFactory<T>
values
- the values
T
over the values, or null if the supplied parameter is null
ValueFormatException
- if the conversion from an iterator of objects could not be performed
IoException
- If an unexpected problem occurs during the conversion.Property.getValues()
public Iterable<T> create(Iterable<?> valueIterable) throws ValueFormatException, IoException
ValueFactory
ValueFactory.create(InputStream)
and ValueFactory.create(String, TextDecoder)
.
This is useful to use when converting all the values
of a Property
.
Property property = ... ExecutionContext executionContext = ... ValueFactory<String> stringFactory = executionContext.getValueFactories().getStringFactory(); for (String token : stringFactory.create(property)) { ... }
create
in interface ValueFactory<T>
valueIterable
- the values
T
over the values, or null if the supplied parameter is null
ValueFormatException
- if the conversion from an iterator of objects could not be performed
IoException
- If an unexpected problem occurs during the conversion.Property.getValues()
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |