Class DocViewProperty

java.lang.Object
org.apache.jackrabbit.vault.util.DocViewProperty

@Deprecated public class DocViewProperty extends Object
Deprecated.
Use DocViewProperty2 instead.
Helper class that represents a JCR property in the FileVault (enhanced) document view format. It contains formatting and parsing methods for writing/reading enhanced docview properties.
The string representation adheres to the following grammar:
 prop:= [ "{" type "}" ] ( value | "[" [ value { "," value } ] "]" )
 type := PropertyType.nameFromValue(int) | BINARY_REF
 value := is a string representation of the value where the following characters are escaped: ',\[{' with a leading '\'
 
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
     
    final boolean
    Deprecated.
    indicates a multi-value property
    final boolean
    Deprecated.
    indicates a binary ref property
    final String
    Deprecated.
    name of the property
    final int
    Deprecated.
    type of this property (can be undefined)
    final String[]
    Deprecated.
    value(s) of the property. always contains at least one value if this is not a mv property.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DocViewProperty(String name, String[] values, boolean multi, int type)
    Deprecated.
    Creates a new property.
    DocViewProperty(String name, String[] values, boolean multi, int type, boolean isRef)
    Deprecated.
    Creates a new property.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    apply(Node node)
    Deprecated.
    Sets this property on the given node
    boolean
    Deprecated.
     
    protected static void
    escape(StringBuffer buf, String value, boolean isMulti)
    Deprecated.
    protected static String
    escape(String value, boolean isMulti)
    Deprecated.
    Escapes the value
    static String
    Deprecated.
    Formats (serializes) the given JCR property value according to the enhanced docview syntax.
    static String
    format(Property prop, boolean sort, boolean useBinaryReferences)
    Deprecated.
    Formats (serializes) the given JCR property value to the enhanced docview syntax.
    Deprecated.
    Generates string representation of this DocView property value.
    Deprecated.
     
    fromProperty(@NotNull Property prop, boolean sort, boolean useBinaryReferences)
    Deprecated.
    Creates a new property based on a JCR Property object
    fromValues(@NotNull String name, @NotNull Value[] values, int type, boolean isMulti, boolean sort, boolean useBinaryReferences)
    Deprecated.
    Creates a new property based on an array of Values
    int
    Deprecated.
     
    static boolean
    Deprecated.
    was not supposed to be public but rather is an implementation detail, should not be called at all
    parse(String name, String value)
    Deprecated.
    Parses a enhanced docview property string and returns the property.
    Deprecated.
    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.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • BINARY_REF

      public static final String BINARY_REF
      Deprecated.
      See Also:
    • name

      public final String name
      Deprecated.
      name of the property
    • values

      public final String[] values
      Deprecated.
      value(s) of the property. always contains at least one value if this is not a mv property.
    • isMulti

      public final boolean isMulti
      Deprecated.
      indicates a multi-value property
    • type

      public final int type
      Deprecated.
      type of this property (can be undefined)
    • isReferenceProperty

      public final boolean isReferenceProperty
      Deprecated.
      indicates a binary ref property
  • Constructor Details

    • DocViewProperty

      public DocViewProperty(String name, String[] values, boolean multi, int type)
      Deprecated.
      Creates a new property.
      Parameters:
      name - name of the property
      values - values.
      multi - multiple flag
      type - type of the property
      Throws:
      IllegalArgumentException - if single value property and not exactly 1 value is given.
    • DocViewProperty

      public DocViewProperty(String name, String[] values, boolean multi, int type, boolean isRef)
      Deprecated.
      Creates a new property.
      Parameters:
      name - name of the property
      values - string representation of values.
      multi - indicates if this is a multi-value property
      type - type of the property
      isRef - true to indicate that this is a binary reference property
      Throws:
      IllegalArgumentException - if single value property and not exactly 1 value is given.
  • Method Details

    • fromValues

      public static DocViewProperty fromValues(@NotNull @NotNull String name, @NotNull @NotNull Value[] values, int type, boolean isMulti, boolean sort, boolean useBinaryReferences) throws RepositoryException
      Deprecated.
      Creates a new property based on an array of Values
      Parameters:
      name - the name of the property
      values - the values (always an array, may be empty), must not contain null items
      type - the type of the property
      isMulti - true in case this is a multivalue property
      sort - true in case the value array should be sorted first
      useBinaryReferences - to use the binary reference as value (if available)
      Returns:
      the new property
      Throws:
      RepositoryException
    • fromProperty

      public static DocViewProperty fromProperty(@NotNull @NotNull Property prop, boolean sort, boolean useBinaryReferences) throws RepositoryException
      Deprecated.
      Creates a new property based on a JCR Property object
      Parameters:
      prop - the JCR property
      sort - if true multi-value properties should be sorted
      useBinaryReferences - true to use binary references
      Returns:
      the new property
      Throws:
      IllegalArgumentException - if single value property and not exactly 1 value is given.
      RepositoryException - if another error occurs
    • fromDocViewProperty2

      public static DocViewProperty fromDocViewProperty2(DocViewProperty2 property)
      Deprecated.
    • parse

      public static DocViewProperty parse(String name, String value)
      Deprecated.
      Parses a enhanced docview property string and returns the property.
      Parameters:
      name - name of the property
      value - (attribute) value
      Returns:
      a property
    • format

      public static String format(Property prop) throws RepositoryException
      Deprecated.
      Formats (serializes) the given JCR property value according to the enhanced docview syntax.
      Parameters:
      prop - the JCR property
      Returns:
      the formatted string of the property value
      Throws:
      RepositoryException - if a repository error occurs
    • format

      public static String format(Property prop, boolean sort, boolean useBinaryReferences) throws RepositoryException
      Deprecated.
      Formats (serializes) the given JCR property value to the enhanced docview syntax.
      Parameters:
      prop - the JCR property
      sort - if true multi-value properties are sorted
      useBinaryReferences - true to use binary references
      Returns:
      the formatted string of the property value
      Throws:
      RepositoryException - if a repository error occurs
    • formatValue

      public String formatValue()
      Deprecated.
      Generates string representation of this DocView property value.
      Returns:
      the string representation of the value
    • escape

      @Deprecated protected static void escape(StringBuffer buf, String value, boolean isMulti)
      Deprecated.
      Escapes the value
      Parameters:
      buf - buffer to append to
      value - value to escape
      isMulti - indicates multi value property
    • escape

      protected static String escape(String value, boolean isMulti)
      Deprecated.
      Escapes the value
      Parameters:
      value - value to escape
      isMulti - indicates multi value property
      Returns:
      the escaped value
    • isAmbiguous

      @Deprecated public static boolean isAmbiguous(Property prop) throws RepositoryException
      Deprecated.
      was not supposed to be public but rather is an implementation detail, should not be called at all
      Checks if the type of the given property is ambiguous in respect to it's property definition. the current implementation just checks some well known properties.
      Parameters:
      prop - the property
      Returns:
      type
      Throws:
      RepositoryException - if a repository error occurs
    • apply

      public boolean apply(Node node) throws RepositoryException
      Deprecated.
      Sets this property on the given node
      Parameters:
      node - the node
      Returns:
      true if the value was modified.
      Throws:
      RepositoryException - if a repository error occurs
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Deprecated.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Deprecated.
      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 formatValue(), format(Property) or format(Property, boolean, boolean) to get the enhanced docview string representation of the value.
      Overrides:
      toString in class Object