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 Details

  • Constructor Details

    • 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 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 is null the type of property is determined based on the PropertyDefinition.
      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

      public JcrPropertyModel getJcrPropertymodel()
    • getValue

      public Value getValue()
    • setValue

      public void setValue(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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • 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>