public class GenericPropertyState extends EmptyPropertyState
| Constructor and Description |
|---|
GenericPropertyState(@NotNull java.lang.String name,
@NotNull java.lang.String value,
@NotNull Type<?> type) |
| Modifier and Type | Method and Description |
|---|---|
int |
count()
The number of values of this property.
|
static PropertyState |
dateProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a date. |
Conversions.Converter |
getConverter()
Create a converter for converting the value of this property to other types.
|
Type<?> |
getType()
Determine the type of this property
|
java.lang.String |
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
|
static PropertyState |
nameProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a name. |
static PropertyState |
pathProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a path. |
static PropertyState |
referenceProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a reference. |
long |
size()
The size of the value of this property.
|
long |
size(int index)
The size of the value at the given
index. |
static PropertyState |
uriProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a URI. |
static PropertyState |
weakreferenceProperty(java.lang.String name,
java.lang.String value)
Create a
PropertyState from a weak reference. |
emptyProperty, getNamepublic GenericPropertyState(@NotNull
@NotNull java.lang.String name,
@NotNull
@NotNull java.lang.String value,
@NotNull
@NotNull Type<?> type)
java.lang.IllegalArgumentException - if type.isArray() is truepublic static PropertyState dateProperty(java.lang.String name, java.lang.String value)
PropertyState from a date. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.DATEpublic static PropertyState nameProperty(java.lang.String name, java.lang.String value)
PropertyState from a name. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.NAMEpublic static PropertyState pathProperty(java.lang.String name, java.lang.String value)
PropertyState from a path. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.PATHpublic static PropertyState referenceProperty(java.lang.String name, java.lang.String value)
PropertyState from a reference. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.REFERENCEpublic static PropertyState weakreferenceProperty(java.lang.String name, java.lang.String value)
PropertyState from a weak reference. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.WEAKREFERENCEpublic static PropertyState uriProperty(java.lang.String name, java.lang.String value)
PropertyState from a URI. No validation is performed
on the string passed for value.name - The name of the property statevalue - The value of the property stateType.URIpublic java.lang.String getValue()
public Conversions.Converter getConverter()
public Type<?> getType()
PropertyStatepublic boolean isArray()
PropertyStateisArray in interface PropertyStateisArray in class EmptyPropertyStatefalse@NotNull public <S> S getValue(Type<S> type)
PropertyStatetype
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 org.apache.jackrabbit.oak.plugins.value.Conversions class.getValue in interface PropertyStategetValue in class EmptyPropertyStatetype - target typetype.isArray() is true.java.lang.IllegalArgumentException - if type is not one of the
values defined in Type.@NotNull public <S> S getValue(Type<S> type, int index)
PropertyStateindex.
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 org.apache.jackrabbit.oak.plugins.value.Conversions class.getValue in interface PropertyStategetValue in class EmptyPropertyStatetype - target typeindexjava.lang.IllegalArgumentException - if type.isArray is truejava.lang.IndexOutOfBoundsException - if index != 0public long size()
PropertyStatesize in interface PropertyStatesize in class EmptyPropertyStategetString().length()public long size(int index)
PropertyStateindex.size in interface PropertyStatesize in class EmptyPropertyStatesizejava.lang.IndexOutOfBoundsException - if index != 0public int count()
PropertyState1 for atoms.count in interface PropertyStatecount in class EmptyPropertyState1Copyright © 2010 - 2023 Adobe. All Rights Reserved