Class ValueConverter


  • public class ValueConverter
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canConvert​(int sourceType, int targetType)  
      static PropertyValue convert​(@NotNull PropertyValue value, int targetType, @Nullable NamePathMapper mapper)
      Converts the given value to a value of the specified target type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • canConvert

        public static boolean canConvert​(int sourceType,
                                         int targetType)
      • convert

        public static PropertyValue convert​(@NotNull
                                            @NotNull PropertyValue value,
                                            int targetType,
                                            @Nullable
                                            @Nullable NamePathMapper mapper)
        Converts the given value to a value of the specified target type. The conversion is performed according to the rules described in "3.6.4 Property Type Conversion" in the JCR 2.0 specification.
        Parameters:
        value - the value to convert
        targetType - the target property type
        mapper - the name mapper or null if no name/path mapping is required.
        Returns:
        the converted value
        Throws:
        java.lang.IllegalArgumentException - if mapping is illegal