Class PropertyImpl

  • All Implemented Interfaces:
    javax.jcr.Item, javax.jcr.Property

    public class PropertyImpl
    extends java.lang.Object
    implements javax.jcr.Property
    TODO document
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T dlg  
      static java.lang.String ITEM_SAVE_DOES_SESSION_SAVE  
      static int MV_PROPERTY_WARN_THRESHOLD  
      static boolean SAVE_SESSION
      The value of this flag determines the behaviour of Item.save().
      protected SessionContext sessionContext  
      protected SessionDelegate sessionDelegate  
      • Fields inherited from interface javax.jcr.Property

        JCR_ACTIVITY, JCR_AUTOCREATED, JCR_BASE_VERSION, JCR_CHILD_VERSION_HISTORY, JCR_CONFIGURATION, JCR_CONTENT, JCR_COPIED_FROM, JCR_CREATED, JCR_CREATED_BY, JCR_CURRENT_LIFECYCLE_STATE, JCR_DATA, JCR_DEFAULT_PRIMARY_TYPE, JCR_DEFAULT_VALUES, JCR_DESCRIPTION, JCR_ENCODING, JCR_FROZEN_MIXIN_TYPES, JCR_FROZEN_PRIMARY_TYPE, JCR_FROZEN_UUID, JCR_HAS_ORDERABLE_CHILD_NODES, JCR_HOST, JCR_ID, JCR_IS_ABSTRACT, JCR_IS_CHECKED_OUT, JCR_IS_MIXIN, JCR_LANGUAGE, JCR_LAST_MODIFIED, JCR_LAST_MODIFIED_BY, JCR_LIFECYCLE_POLICY, JCR_LOCK_IS_DEEP, JCR_LOCK_OWNER, JCR_MANDATORY, JCR_MERGE_FAILED, JCR_MIMETYPE, JCR_MIXIN_TYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODE_TYPE_NAME, JCR_ON_PARENT_VERSION, JCR_PATH, JCR_PORT, JCR_PREDECESSORS, JCR_PRIMARY_ITEM_NAME, JCR_PRIMARY_TYPE, JCR_PROTECTED, JCR_PROTOCOL, JCR_REPOSITORY, JCR_REQUIRED_PRIMARY_TYPES, JCR_REQUIRED_TYPE, JCR_ROOT, JCR_SAME_NAME_SIBLINGS, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_TITLE, JCR_UUID, JCR_VALUE_CONSTRAINTS, JCR_VERSION_HISTORY, JCR_VERSIONABLE_UUID, JCR_WORKSPACE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(javax.jcr.ItemVisitor visitor)  
      protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createMultiState​(java.lang.String oakName, java.util.List<javax.jcr.Value> values, org.apache.jackrabbit.oak.api.Type<?> type)  
      protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createSingleState​(java.lang.String oakName, javax.jcr.Value value, org.apache.jackrabbit.oak.api.Type<?> type)  
      javax.jcr.Item getAncestor​(int depth)  
      @NotNull javax.jcr.Binary getBinary()  
      boolean getBoolean()  
      @NotNull java.util.Calendar getDate()  
      @NotNull java.math.BigDecimal getDecimal()  
      @NotNull javax.jcr.nodetype.PropertyDefinition getDefinition()  
      int getDepth()  
      double getDouble()  
      long getLength()  
      @org.jetbrains.annotations.NotNull long[] getLengths()  
      long getLong()  
      @NotNull java.lang.String getName()  
      @NotNull javax.jcr.Node getNode()  
      @NotNull javax.jcr.Node getParent()  
      @NotNull java.lang.String getPath()  
      @NotNull javax.jcr.Property getProperty()  
      @NotNull javax.jcr.Session getSession()  
      @NotNull java.io.InputStream getStream()  
      @NotNull java.lang.String getString()  
      int getType()  
      @NotNull javax.jcr.Value getValue()  
      @NotNull javax.jcr.Value[] getValues()  
      boolean isModified()  
      boolean isMultiple()  
      boolean isNew()  
      boolean isNode()  
      boolean isSame​(javax.jcr.Item otherItem)  
      protected <U> U perform​(@NotNull SessionOperation<U> op)
      Perform the passed SessionOperation.
      void refresh​(boolean keepChanges)  
      void remove()  
      void save()
      This implementation delegates to Session.save() if SAVE_SESSION is true.
      void setValue​(boolean value)  
      void setValue​(double value)  
      void setValue​(long value)  
      void setValue​(java.io.InputStream value)  
      void setValue​(java.lang.String value)  
      void setValue​(java.lang.String[] strings)  
      void setValue​(java.math.BigDecimal value)  
      void setValue​(java.util.Calendar value)  
      void setValue​(javax.jcr.Binary value)  
      void setValue​(javax.jcr.Node value)  
      void setValue​(javax.jcr.Value value)  
      void setValue​(javax.jcr.Value[] values)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.jcr.Item

        getAncestor, getDepth, getName, getPath, getSession, isSame, refresh, save
    • Field Detail

      • ITEM_SAVE_DOES_SESSION_SAVE

        public static final java.lang.String ITEM_SAVE_DOES_SESSION_SAVE
        See Also:
        Constant Field Values
      • MV_PROPERTY_WARN_THRESHOLD

        public static final int MV_PROPERTY_WARN_THRESHOLD
        See Also:
        Constant Field Values
      • SAVE_SESSION

        public static final boolean SAVE_SESSION
        The value of this flag determines the behaviour of Item.save(). If false, save will throw a UnsupportedRepositoryOperationException if the sub tree rooted at this item does not contain all transient changes. If true, save will delegate to Session.save().
    • Method Detail

      • isNode

        public boolean isNode()
        Specified by:
        isNode in interface javax.jcr.Item
      • getParent

        @NotNull
        public @NotNull javax.jcr.Node getParent()
                                          throws javax.jcr.RepositoryException
        Specified by:
        getParent in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
      • isNew

        public boolean isNew()
        Specified by:
        isNew in interface javax.jcr.Item
      • isModified

        public boolean isModified()
        Specified by:
        isModified in interface javax.jcr.Item
      • remove

        public void remove()
                    throws javax.jcr.RepositoryException
        Specified by:
        remove in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
      • accept

        public void accept​(javax.jcr.ItemVisitor visitor)
                    throws javax.jcr.RepositoryException
        Specified by:
        accept in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(javax.jcr.Value value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(javax.jcr.Value[] values)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(java.lang.String value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(java.lang.String[] strings)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(java.io.InputStream value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(javax.jcr.Binary value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(long value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(double value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(java.math.BigDecimal value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(java.util.Calendar value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(boolean value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • setValue

        public void setValue​(javax.jcr.Node value)
                      throws javax.jcr.RepositoryException
        Specified by:
        setValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getValue

        @NotNull
        public @NotNull javax.jcr.Value getValue()
                                          throws javax.jcr.RepositoryException
        Specified by:
        getValue in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getValues

        @NotNull
        public @NotNull javax.jcr.Value[] getValues()
                                             throws javax.jcr.RepositoryException
        Specified by:
        getValues in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getString

        @NotNull
        public @NotNull java.lang.String getString()
                                            throws javax.jcr.RepositoryException
        Specified by:
        getString in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getStream

        @NotNull
        public @NotNull java.io.InputStream getStream()
                                               throws javax.jcr.RepositoryException
        Specified by:
        getStream in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getBinary

        @NotNull
        public @NotNull javax.jcr.Binary getBinary()
                                            throws javax.jcr.RepositoryException
        Specified by:
        getBinary in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getLong

        public long getLong()
                     throws javax.jcr.RepositoryException
        Specified by:
        getLong in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getDouble

        public double getDouble()
                         throws javax.jcr.RepositoryException
        Specified by:
        getDouble in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getDecimal

        @NotNull
        public @NotNull java.math.BigDecimal getDecimal()
                                                 throws javax.jcr.RepositoryException
        Specified by:
        getDecimal in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getDate

        @NotNull
        public @NotNull java.util.Calendar getDate()
                                            throws javax.jcr.RepositoryException
        Specified by:
        getDate in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getBoolean

        public boolean getBoolean()
                           throws javax.jcr.RepositoryException
        Specified by:
        getBoolean in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getNode

        @NotNull
        public @NotNull javax.jcr.Node getNode()
                                        throws javax.jcr.RepositoryException
        Specified by:
        getNode in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getProperty

        @NotNull
        public @NotNull javax.jcr.Property getProperty()
                                                throws javax.jcr.RepositoryException
        Specified by:
        getProperty in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getLength

        public long getLength()
                       throws javax.jcr.RepositoryException
        Specified by:
        getLength in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getLengths

        @NotNull
        public @org.jetbrains.annotations.NotNull long[] getLengths()
                                                             throws javax.jcr.RepositoryException
        Specified by:
        getLengths in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getDefinition

        @NotNull
        public @NotNull javax.jcr.nodetype.PropertyDefinition getDefinition()
                                                                     throws javax.jcr.RepositoryException
        Specified by:
        getDefinition in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • getType

        public int getType()
                    throws javax.jcr.RepositoryException
        Specified by:
        getType in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • isMultiple

        public boolean isMultiple()
                           throws javax.jcr.RepositoryException
        Specified by:
        isMultiple in interface javax.jcr.Property
        Throws:
        javax.jcr.RepositoryException
      • perform

        @NotNull
        protected final <U> U perform​(@NotNull
                                      @NotNull SessionOperation<U> op)
                               throws javax.jcr.RepositoryException
        Perform the passed SessionOperation.
        Type Parameters:
        U - return type of the operation
        Parameters:
        op - operation to perform
        Returns:
        the result of op.perform()
        Throws:
        javax.jcr.RepositoryException - as thrown by op.perform().
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
                                          throws javax.jcr.RepositoryException
        Specified by:
        getName in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.getName()
      • getPath

        @NotNull
        public @NotNull java.lang.String getPath()
                                          throws javax.jcr.RepositoryException
        Specified by:
        getPath in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.getPath()
      • getSession

        @NotNull
        public @NotNull javax.jcr.Session getSession()
        Specified by:
        getSession in interface javax.jcr.Item
      • getAncestor

        public javax.jcr.Item getAncestor​(int depth)
                                   throws javax.jcr.RepositoryException
        Specified by:
        getAncestor in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
      • getDepth

        public int getDepth()
                     throws javax.jcr.RepositoryException
        Specified by:
        getDepth in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
      • isSame

        public boolean isSame​(javax.jcr.Item otherItem)
                       throws javax.jcr.RepositoryException
        Specified by:
        isSame in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.isSame(javax.jcr.Item)
      • save

        public void save()
                  throws javax.jcr.RepositoryException
        This implementation delegates to Session.save() if SAVE_SESSION is true. Otherwise it only performs the save if the subtree rooted at this item contains all transient changes. That is, if calling Session.save() would have the same effect as calling this method. In all other cases this method will throw an UnsupportedRepositoryOperationException
        Specified by:
        save in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.save()
      • refresh

        public void refresh​(boolean keepChanges)
                     throws javax.jcr.RepositoryException
        Specified by:
        refresh in interface javax.jcr.Item
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.refresh(boolean)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • createSingleState

        @NotNull
        protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createSingleState​(java.lang.String oakName,
                                                                                         javax.jcr.Value value,
                                                                                         org.apache.jackrabbit.oak.api.Type<?> type)
                                                                                  throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • createMultiState

        @NotNull
        protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createMultiState​(java.lang.String oakName,
                                                                                        java.util.List<javax.jcr.Value> values,
                                                                                        org.apache.jackrabbit.oak.api.Type<?> type)
                                                                                 throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException