Class StringParameters

    • Field Detail

      • buffer

        protected ParametersString buffer
        Buffer where the parameters are stored during conversion.
    • Constructor Detail

      • StringParameters

        public StringParameters()
        Creates a new StringParameters object with a null path and an empty buffer.
      • StringParameters

        public StringParameters​(String data)
        Creates a new StringParameters object with a null path the specified initial parameter data
        Parameters:
        data - the string holding the parameters. See IParameters.fromString(java.lang.String).
    • Method Detail

      • reset

        public void reset()
        Reset this parameters object to its default values.

        Subclasses should override this method to set any initial values and instantiate any objects that require allocation. It is recommended that subclasses also call super.reset() in the override to ensure that the buffer is empty.

      • fromString

        public void fromString​(String data)
        Reset this parameters object to its default values and then load additional parameters from the provided data.

        Subclasses should not normally need to override this method unless they are maintaining complex values (eg, InlineCodeFinder) that require extra initialization as part of their parameter state.

        Parameters:
        data - the string holding the parameters. It must be formatted as the string generated by toString(). Line-breaks must be normalized to '\n'. It can also be null or empty, in such case the parameters are left with their current values. Use reset() to reset the parameters to their defaults.
      • fromString

        public void fromString​(String data,
                               boolean clearParameters)
        Load additional parameters from the provided data. If clearParameters is set, then it first resets this parameters object to its default values.

        Subclasses should not normally need to override this method unless they are maintaining complex values (eg, InlineCodeFinder) that require extra initialization as part of their parameter state.

        Parameters:
        data - the string holding the parameters. See IParameters.fromString(java.lang.String).
        clearParameters - if true, the internal parameters will be cleared before loading the data. If false, any existing parameters will be left intact unless they are overridden by the data.
      • toString

        public String toString()
        Serialize this parameters object to a string.

        Subclasses should not normally need to override this method unless they are maintaining complex values (eg, InlineCodeFinder) that require extra serialization as part of their parameter state.

        Specified by:
        toString in interface IParameters
        Overrides:
        toString in class Object
        Returns:
        the string holding all the parameters.
      • getBoolean

        public boolean getBoolean​(String name)
        Description copied from interface: IParameters
        Gets the boolean value for the given parameter name.
        Parameters:
        name - the name of the boolean parameter to retrieve.
        Returns:
        the value of the given parameter, or false if it is not defined.
      • setBoolean

        public void setBoolean​(String name,
                               boolean value)
        Description copied from interface: IParameters
        Sets the boolean value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • getString

        public String getString​(String name)
        Description copied from interface: IParameters
        Gets the string value for a given parameter name.
        Parameters:
        name - the name of the string parameter to retrieve.
        Returns:
        the value of the given parameter, or null if it is not defined.
      • setString

        public void setString​(String name,
                              String value)
        Description copied from interface: IParameters
        Sets the string value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • getInteger

        public int getInteger​(String name)
        Description copied from interface: IParameters
        Gets the integer value for a given parameter name.
        Parameters:
        name - the name of the integer parameter to retrieve.
        Returns:
        the value of the given parameter, or 0 if it is not defined.
      • setInteger

        public void setInteger​(String name,
                               int value)
        Description copied from interface: IParameters
        Sets the integer value for a given parameter name.
        Parameters:
        name - the name of the parameter to set.
        value - the new value to set.
      • setGroup

        protected void setGroup​(String name,
                                String value)