Documentation of 'org.hsqldb.persist.HsqlProperties' Java class
HsqlProperties
org.hsqldb.persist

Class HsqlProperties

  • Direct Known Subclasses:
    HsqlDatabaseProperties, ServerProperties


    public class HsqlProperties
    extends java.lang.Object
    Wrapper for java.util.Properties to limit values to Specific types and allow saving and loading.

    Since:
    1.7.0
    • Constructor Detail

      • HsqlProperties

        public HsqlProperties()
      • HsqlProperties

        public HsqlProperties(java.lang.String fileName)
      • HsqlProperties

        public HsqlProperties(java.lang.String fileName,
                              java.lang.String fileExtension)
      • HsqlProperties

        public HsqlProperties(HashMap meta,
                              java.lang.String fileName,
                              FileAccess accessor,
                              boolean b)
      • HsqlProperties

        public HsqlProperties(java.util.Properties props)
    • Method Detail

      • setFileName

        public void setFileName(java.lang.String name)
      • setProperty

        public java.lang.String setProperty(java.lang.String key,
                                            int value)
      • setProperty

        public java.lang.String setProperty(java.lang.String key,
                                            boolean value)
      • setProperty

        public java.lang.String setProperty(java.lang.String key,
                                            java.lang.String value)
      • setPropertyIfNotExists

        public java.lang.String setPropertyIfNotExists(java.lang.String key,
                                                       java.lang.String value)
      • getProperties

        public java.util.Properties getProperties()
      • getProperty

        public java.lang.String getProperty(java.lang.String key)
      • getProperty

        public java.lang.String getProperty(java.lang.String key,
                                            java.lang.String defaultValue)
      • getIntegerProperty

        public int getIntegerProperty(java.lang.String key,
                                      int defaultValue)
      • getIntegerProperty

        public static int getIntegerProperty(java.util.Properties props,
                                             java.lang.String key,
                                             int defaultValue)
      • isPropertyTrue

        public boolean isPropertyTrue(java.lang.String key)
      • isPropertyTrue

        public boolean isPropertyTrue(java.lang.String key,
                                      boolean defaultValue)
      • removeProperty

        public void removeProperty(java.lang.String key)
      • addProperties

        public void addProperties(java.util.Properties props)
      • propertiesFileExists

        public boolean propertiesFileExists()
      • load

        public boolean load()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • save

        public void save()
                  throws java.lang.Exception
        Saves the properties.
        Throws:
        java.lang.Exception
      • save

        public void save(java.lang.String fileString)
                  throws java.lang.Exception
        Saves the properties using JDK2 method if present, otherwise JDK1.
        Throws:
        java.lang.Exception
      • argArrayToProps

        public static HsqlProperties argArrayToProps(java.lang.String[] arg,
                                                     java.lang.String type)
        Creates and populates an HsqlProperties Object from the arguments array of a Main method. Properties are in the form of "-key value" pairs. Each key is prefixed with the type argument and a dot before being inserted into the properties Object.

        "--help" is treated as a key with no value and not inserted.

      • delimitedArgPairsToProps

        public static HsqlProperties delimitedArgPairsToProps(java.lang.String s,
                                                              java.lang.String pairsep,
                                                              java.lang.String dlimiter,
                                                              java.lang.String type)
        Creates and populates a new HsqlProperties Object using a string such as "key1=value1;key2=value2".

        The string that represents the = sign above is specified as pairsep and the one that represents the semicolon is specified as delimiter, allowing any string to be used for either.

        Leading / trailing spaces around the keys and values are discarded.

        The string is parsed by (1) subdividing into segments by delimiter (2) subdividing each segment in two by finding the first instance of the pairsep (3) trimming each pair of segments from step 2 and inserting into the properties object.

        Each key is prefixed with the type argument and a dot before being inserted.

        Any key without a value is added to the list of errors.

      • propertyNames

        public java.util.Enumeration propertyNames()
      • isEmpty

        public boolean isEmpty()
      • getErrorKeys

        public java.lang.String[] getErrorKeys()
      • validate

        public void validate()
      • getMeta

        public static java.lang.Object[] getMeta(java.lang.String name,
                                                 int type,
                                                 java.lang.String defaultValue)
      • getMeta

        public static java.lang.Object[] getMeta(java.lang.String name,
                                                 int type,
                                                 boolean defaultValue)
      • getMeta

        public static java.lang.Object[] getMeta(java.lang.String name,
                                                 int type,
                                                 int defaultValue,
                                                 int[] values)
      • getMeta

        public static java.lang.Object[] getMeta(java.lang.String name,
                                                 int type,
                                                 int defaultValue,
                                                 int rangeLow,
                                                 int rangeHigh)
      • validateProperty

        public static java.lang.String validateProperty(java.lang.String key,
                                                        java.lang.String value,
                                                        java.lang.Object[] meta)
        Perfoms any range checking for property and return an error message
      • validateProperty

        public boolean validateProperty(java.lang.String name,
                                        int number)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.