Class PropertiesHandler

    • Constructor Detail

      • PropertiesHandler

        public PropertiesHandler()
    • Method Detail

      • getPropertyValue

        public static java.lang.String getPropertyValue​(java.lang.String name,
                                                        java.util.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.
      • getPropertyValueLogDebug

        public static java.lang.String getPropertyValueLogDebug​(java.lang.String name,
                                                                java.util.Map m,
                                                                AbstractSession session)
      • getPropertyValue

        public static java.lang.String getPropertyValue​(java.lang.String name,
                                                        java.util.Map m,
                                                        boolean useSystemAsDefault)
      • getPropertyValueLogDebug

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

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

        public static java.lang.String getPropertyValueLogDebug​(java.lang.String name,
                                                                java.lang.String value,
                                                                AbstractSession session)
      • getPrefixedPropertyValue

        public static java.lang.String getPrefixedPropertyValue​(java.lang.String prefix,
                                                                java.lang.String suffix,
                                                                java.util.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 java.util.Map getPrefixValues​(java.lang.String prefix,
                                                    java.util.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.
      • getPrefixValuesLogDebug

        public static java.util.Map getPrefixValuesLogDebug​(java.lang.String prefix,
                                                            java.util.Map m,
                                                            AbstractSession session)
      • getDefaultPropertyValue

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

        public static java.lang.String getDefaultPropertyValueLogDebug​(java.lang.String name,
                                                                       AbstractSession session)
      • shouldUseDefault

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