Class NSProperties

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<Object,​Object>

    public class NSProperties
    extends XProperties
    In addition to the abilities of XProperties this allows for
    • Basic but extremely useful namespace support. You may get/set properties using a namespace in addition to a property key. Be warned this is simple since it just gloms the namespace in front of the key, but it works quite well for most cases.

    There is prefix resolution, if prefixes are found. For instance, this might be a properties file:

         xmlns\:fileStore=http://my.ns/fileStore#
         xmlns\:email=myproxy:ncsa,2011/1.1/email#
         fileStore\:dataPath=/tmp/data
         fileStore\:indexPath=/tmp/index
         email\:enabled=false
     
    (The "\" on the left-hand side is colon escaping from the Java Properties class.) In which case you could retrieve values as getBoolean("email", "enabled") or getBoolean("myproxy:ncsa,2011/1.1/email#enabled")

    You may add or remove prefixes by calling the appropriate addNSPrefix(String, String) method. These will be saved as part of the properties file.

    See Also:
    Serialized Form