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 to
String
, date maps to Date
.
One can also set and retrieve the underlying Value
.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJcrPropertyValueModel
(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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.wicket.model.IModel
as, combineWith, filter, flatMap, isPresent, map, orElse, orElseGet
-
Field Details
-
NO_INDEX
public static final int NO_INDEX- See Also:
-
NO_TYPE
public static final int NO_TYPE- See Also:
-
-
Constructor Details
-
JcrPropertyValueModel
single-valued constructor.- Parameters:
propertyModel
-
-
JcrPropertyValueModel
Indexed value of a multi-valued property.- Parameters:
index
-propertyModel
-
-
JcrPropertyValueModel
Multi-valued property constructor. Can be used for single-valued properties by setting index to NO_INDEX- Parameters:
index
-value
-propertyModel
-
-
-
Method Details
-
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:
-
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
-
getValue
-
setValue
-
getObject
- Specified by:
getObject
in interfaceorg.apache.wicket.model.IModel<T extends Serializable>
-
setObject
- 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) -
toString
-
equals
-
hashCode
public int hashCode() -
getObjectClass
- Specified by:
getObjectClass
in interfaceorg.apache.wicket.model.IObjectClassAwareModel<T extends Serializable>
-