Class JcrPropertyValueModel<T extends Serializable>
- java.lang.Object
-
- org.hippoecm.frontend.model.properties.JcrPropertyValueModel<T>
-
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.model.IModel<T>
,org.apache.wicket.model.IObjectClassAwareModel<T>
,org.apache.wicket.util.io.IClusterable
public class JcrPropertyValueModel<T extends Serializable> extends Object implements org.apache.wicket.model.IModel<T>, org.apache.wicket.model.IObjectClassAwareModel<T>
Model of a property value. Retrieves the value of a single valued property, or an indexed value of a multi-valued property. The type of the value returned depends on the JCR type of the property. I.e. JCR type string maps toString
, date maps toDate
.One can also set and retrieve the underlying
Value
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JcrPropertyValueModel(int index, Value value, JcrPropertyModel propertyModel)
Multi-valued property constructor.JcrPropertyValueModel(int index, JcrPropertyModel propertyModel)
Indexed value of a multi-valued property.JcrPropertyValueModel(JcrPropertyModel propertyModel)
single-valued constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detach()
boolean
equals(Object object)
int
getIndex()
The index of a value in a multi-valued property.JcrPropertyModel
getJcrPropertymodel()
T
getObject()
Class
getObjectClass()
int
getType()
Determines the type of the property.Value
getValue()
int
hashCode()
void
setIndex(int index)
void
setObject(Serializable object)
void
setType(int type)
void
setValue(Value value)
String
toString()
-
-
-
Field Detail
-
NO_INDEX
public static final int NO_INDEX
- See Also:
- Constant Field Values
-
NO_TYPE
public static final int NO_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JcrPropertyValueModel
public JcrPropertyValueModel(JcrPropertyModel propertyModel)
single-valued constructor.- Parameters:
propertyModel
-
-
JcrPropertyValueModel
public JcrPropertyValueModel(int index, JcrPropertyModel propertyModel)
Indexed value of a multi-valued property.- Parameters:
index
-propertyModel
-
-
JcrPropertyValueModel
public JcrPropertyValueModel(int index, Value value, JcrPropertyModel propertyModel)
Multi-valued property constructor. Can be used for single-valued properties by setting index to NO_INDEX- Parameters:
index
-value
-propertyModel
-
-
-
Method Detail
-
getType
public int getType()
Determines the type of the property. If the type is not yet defined, the type will be resolved based on the value. If the value isnull
the type of property is determined based on thePropertyDefinition
.- Returns:
- an integer representing the type of property.
- See Also:
for the resulting values.
-
setType
public void setType(int type)
-
getIndex
public int getIndex()
The index of a value in a multi-valued property. NO_INDEX (-1) is returned for a single-valued property.
-
getJcrPropertymodel
public JcrPropertyModel getJcrPropertymodel()
-
getValue
public Value getValue()
-
setValue
public void setValue(Value value)
-
getObject
public T getObject()
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<T extends Serializable>
-
setObject
public void setObject(Serializable object)
- Specified by:
setObject
in interfaceorg.apache.wicket.model.IModel<T extends Serializable>
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
- Specified by:
detach
in interfaceorg.apache.wicket.model.IModel<T extends Serializable>
-
setIndex
public void setIndex(int index)
-
getObjectClass
public Class getObjectClass()
- Specified by:
getObjectClass
in interfaceorg.apache.wicket.model.IObjectClassAwareModel<T extends Serializable>
-
-