Class PropertiesHandler

    • Constructor Detail

      • PropertiesHandler

        public PropertiesHandler()
    • Method Detail

      • getPropertyValue

        public static String getPropertyValue​(String name,
                                              Map m)
        INTERNAL: Gets property value from the map, if none found looks in System properties. Use this to get a value for a non-prefixed property. Could be used on prefixes (like "org.eclipse.persistence.cache-type.") too, but will always return null Throws IllegalArgumentException in case the property value is illegal.
      • getPropertyValue

        public static String getPropertyValue​(String name,
                                              Map m,
                                              boolean useSystemAsDefault)
      • getPropertyValueLogDebug

        public static String getPropertyValueLogDebug​(String name,
                                                      Map m,
                                                      AbstractSession session,
                                                      boolean useSystemAsDefault)
      • getPropertyValue

        public static String getPropertyValue​(String name,
                                              String value)
        INTERNAL: Given property name and value verifies and translates the value. Throws IllegalArgumentException in case the property value is illegal.
      • getPrefixedPropertyValue

        public static String getPrefixedPropertyValue​(String prefix,
                                                      String suffix,
                                                      Map m)
        INTERNAL: Gets property value from the map, if none found looks in System properties. Use this to get a value for a prefixed property: for "org.eclipse.persistence.cache-type.Employee" pass "org.eclipse.persistence.cache-type.", "Employee". Throws IllegalArgumentException in case the property value is illegal.
      • getPrefixValues

        public static Map getPrefixValues​(String prefix,
                                          Map m)
        INTERNAL: Gets properties' values from the map, if none found looks in System properties. In the returned map values keyed by suffixes. Use it with prefixes (like "org.eclipse.persistence.cache-type."). Could be used on simple properties (not prefixes, too), but will always return either an empty map or a map containing a single value keyed by an empty String. Throws IllegalArgumentException in case the property value is illegal.
      • getDefaultPropertyValue

        public static String getDefaultPropertyValue​(String name)
        INTERNAL: Returns the default property value that should be applied. Throws IllegalArgumentException in case the name doesn't correspond to any property.
      • shouldUseDefault

        protected static boolean shouldUseDefault​(String value)
        INTERNAL: Empty String value indicates that the default property value should be used.