Package jodd.props

Class PropsData

java.lang.Object
jodd.props.PropsData
All Implemented Interfaces:
Cloneable

public class PropsData extends Object implements Cloneable
Props data storage for base and profile properties. Properties can be lookuped and modified only through this class.
  • Field Details

    • MAX_INNER_MACROS

      private static final int MAX_INNER_MACROS
      See Also:
    • APPEND_SEPARATOR

      private static final String APPEND_SEPARATOR
      See Also:
    • baseProperties

      protected final HashMap<String,PropsEntry> baseProperties
    • profileProperties

      protected final HashMap<String,Map<String,PropsEntry>> profileProperties
    • first

      protected PropsEntry first
    • last

      protected PropsEntry last
    • appendDuplicateProps

      protected boolean appendDuplicateProps
      If set, duplicate props will be appended to the end, separated by comma.
    • ignoreMissingMacros

      protected boolean ignoreMissingMacros
      When set, missing macros will be replaces with an empty string.
    • skipEmptyProps

      protected boolean skipEmptyProps
      When set, empty properties will be skipped.
  • Constructor Details

  • Method Details

    • clone

      public PropsData clone()
      Overrides:
      clone in class Object
    • put

      protected void put(String profile, Map<String,PropsEntry> map, String key, String value, boolean append)
      Puts key-value pair into the map, with respect of appending duplicate properties
    • countBaseProperties

      public int countBaseProperties()
      Counts base properties.
    • putBaseProperty

      public void putBaseProperty(String key, String value, boolean append)
      Adds base property.
    • getBaseProperty

      public PropsEntry getBaseProperty(String key)
      Returns base property or null if it doesn't exist.
    • countProfileProperties

      public int countProfileProperties()
      Counts profile properties. Note: this method is not that easy on execution.
    • putProfileProperty

      public void putProfileProperty(String key, String value, String profile, boolean append)
      Adds profile property.
    • getProfileProperty

      public PropsEntry getProfileProperty(String profile, String key)
      Returns profile property.
    • lookupValue

      protected String lookupValue(String key, String... profiles)
      Lookup props value through profiles and base properties. Returns null if value not found.
    • resolveMacros

      public String resolveMacros(String value, String... profiles)
      Resolves all macros in this props set. Called on property lookup.
    • extract

      public Map extract(Map target, String[] profiles, String[] wildcardPatterns, String prefix)
      Extracts props to target map. This is all-in-one method, that does many things at once.
    • extractMap

      protected void extractMap(Map target, Map<String,PropsEntry> map, String[] profiles, String[] wildcardPatterns, String prefix)