public class BinaryPropertyState extends EmptyPropertyState
GET_NAME
Constructor and Description |
---|
BinaryPropertyState(String name,
Blob value) |
Modifier and Type | Method and Description |
---|---|
static PropertyState |
binaryProperty(String name,
Blob value)
Create a
PropertyState from a Blob . |
static PropertyState |
binaryProperty(String name,
byte[] value)
Create a
PropertyState from an array of bytes. |
static PropertyState |
binaryProperty(String name,
String value)
Create a
PropertyState from an array of bytes. |
static PropertyState |
binaryProperty(String name,
Value value)
Create a
PropertyState from a javax.jcr.Value . |
int |
count()
The number of values of this property.
|
Conversions.Converter |
getConverter()
Create a converter for converting the value of this property to other types.
|
Type<?> |
getType()
Determine the type of this property
|
Blob |
getValue()
The value of this property
|
<S> S |
getValue(Type<S> type)
Value of this property.
|
<S> S |
getValue(Type<S> type,
int index)
Value at the given
index . |
boolean |
isArray()
Determine whether the value is an array of atoms
|
long |
size()
The size of the value of this property.
|
long |
size(int index)
The size of the value at the given
index . |
emptyProperty, getName
public static PropertyState binaryProperty(String name, byte[] value)
PropertyState
from an array of bytes.name
- The name of the property statevalue
- The value of the property stateType.BINARY
public static PropertyState binaryProperty(String name, String value)
PropertyState
from an array of bytes.name
- The name of the property statevalue
- The value of the property stateType.BINARY
public static PropertyState binaryProperty(String name, Blob value)
PropertyState
from a Blob
.name
- The name of the property statevalue
- The value of the property stateType.BINARY
public static PropertyState binaryProperty(String name, Value value)
PropertyState
from a javax.jcr.Value
.name
- The name of the property statevalue
- The value of the property stateType.BINARY
public Blob getValue()
public Conversions.Converter getConverter()
public long size()
PropertyState
size
in interface PropertyState
getString().length()
public Type<?> getType()
PropertyState
public boolean isArray()
PropertyState
isArray
in interface PropertyState
isArray
in class EmptyPropertyState
false
public <S> S getValue(Type<S> type)
PropertyState
type
argument. If type.isArray()
is true, this method returns an
Iterable
of the base type
of
type
containing all values of this property.
If the target type is not the same as the type of this property an attempt
is made to convert the value to the target type. If the conversion fails an
exception is thrown. The actual conversions which take place are those defined
in the Conversions
class.getValue
in interface PropertyState
getValue
in class EmptyPropertyState
type
- target typetype.isArray()
is true
.IllegalArgumentException
- if type
is not one of the
values defined in Type
.public <S> S getValue(Type<S> type, int index)
PropertyState
index
.
The type of the return value is determined by the target type
argument.
If the target type is not the same as the type of this property an attempt
is made to convert the value to the target type. If the conversion fails an
exception is thrown. The actual conversions which take place are those defined
in the Conversions
class.getValue
in interface PropertyState
getValue
in class EmptyPropertyState
type
- target typeindex
IllegalArgumentException
- if type.isArray
is true
IndexOutOfBoundsException
- if index != 0
public long size(int index)
PropertyState
index
.size
in interface PropertyState
size
in class EmptyPropertyState
size
IndexOutOfBoundsException
- if index != 0
public int count()
PropertyState
1
for atoms.count
in interface PropertyState
count
in class EmptyPropertyState
1
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"