Class JcrPropertyValueModel<T extends Serializable>

  • 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:
    Serialized Form
    • 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,
                                     javax.jcr.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 is null the type of property is determined based on the PropertyDefinition.
        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.
      • getValue

        public javax.jcr.Value getValue()
      • setValue

        public void setValue​(javax.jcr.Value value)
      • getObject

        public T getObject()
        Specified by:
        getObject in interface org.apache.wicket.model.IModel<T extends Serializable>
      • setObject

        public void setObject​(Serializable object)
        Specified by:
        setObject in interface org.apache.wicket.model.IModel<T extends Serializable>
      • detach

        public void detach()
        Specified by:
        detach in interface org.apache.wicket.model.IDetachable
        Specified by:
        detach in interface org.apache.wicket.model.IModel<T extends Serializable>
      • setIndex

        public void setIndex​(int index)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getObjectClass

        public Class getObjectClass()
        Specified by:
        getObjectClass in interface org.apache.wicket.model.IObjectClassAwareModel<T extends Serializable>