You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2021/07/05 15:35:17 UTC

[jackrabbit-filevault] branch master updated: JCRVLT-545 expose method to format DocViewProperty value

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


The following commit(s) were added to refs/heads/master by this push:
     new b8627b9  JCRVLT-545 expose method to format DocViewProperty value
b8627b9 is described below

commit b8627b9548ff1335cc0e497797b701a02a966654
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Jul 5 17:35:06 2021 +0200

    JCRVLT-545 expose method to format DocViewProperty value
---
 .../jackrabbit/vault/util/DocViewProperty.java       | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty.java
index d17cb71..23e520d 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty.java
@@ -322,9 +322,9 @@ public class DocViewProperty {
         return new DocViewProperty(name, values, isMulti, type, isBinaryRef);
     }
     /**
-     * Formats the given jcr property to the enhanced docview syntax.
+     * Formats the given jcr property value to the enhanced docview syntax.
      * @param prop the jcr property
-     * @return the formatted string
+     * @return the formatted string of the property value
      * @throws RepositoryException if a repository error occurs
      */
     public static String format(Property prop) throws RepositoryException {
@@ -332,23 +332,23 @@ public class DocViewProperty {
     }
     
     /**
-     * Formats the given jcr property to the enhanced docview syntax.
+     * Formats the given jcr property value to the enhanced docview syntax.
      * @param prop the jcr property
      * @param sort if {@code true} multivalue properties are sorted
      * @param useBinaryReferences {@code true} to use binary references
-     * @return the formatted string
+     * @return the formatted string of the property value
      * @throws RepositoryException if a repository error occurs
      */
     public static String format(Property prop, boolean sort, boolean useBinaryReferences)
             throws RepositoryException {
-        return fromProperty(prop, sort, useBinaryReferences).format();
+        return fromProperty(prop, sort, useBinaryReferences).formatValue();
     }
 
     /** 
-     * Generates string representation of this DocView property.
-     * @return the string representation
+     * Generates string representation of this DocView property value.
+     * @return the string representation of the value
      */
-    String format() {
+    public String formatValue() {
         StringBuilder attrValue = new StringBuilder();
         
         if (isAmbiguous(type, name)) {
@@ -572,6 +572,10 @@ public class DocViewProperty {
         return true;
     }
 
+    /**
+     * This does not return the string representation of the enhanced docview property value but rather a descriptive string including the property name for debugging purposes.
+     * Use {@link #formatValue()}, {@link #format(Property)} or {@link #format(Property, boolean, boolean)} to get the enhanced docview string representation of the value.
+     */
     @Override
     public String toString() {
         return "DocViewProperty [name=" + name + ", values=" + Arrays.toString(values) + ", isMulti=" + isMulti + ", type=" + type