net.sf.okapi.common

## Class BaseParameters

- java.lang.Object
- - net.sf.okapi.common.BaseParameters

- All Implemented Interfaces:
    IParameters
  Direct Known Subclasses:
    StringParameters

      public abstract class BaseParameters
      extends java.lang.Object
      implements IParameters

  Base class for properties-like parameters that implement IParameters.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `path` Current path of the parameter file.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseParameters()` Creates a new BaseParameters object with a null path.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ParametersDescription` | `getParametersDescription()` Gets the description of the parameters.
    `java.lang.String` | `getPath()` Gets the full path of the last file where the parameters where loaded from or saved to.
    `void` | `load(java.io.InputStream inStream, boolean ignoreErrors)` Loads the parameters from a file.
    `void` | `load(java.net.URL inputURL, boolean ignoreErrors)` Loads the parameters from a file.
    `void` | `save(java.lang.String newPath)` Saves the parameters to a file.
    `void` | `setPath(java.lang.String filePath)` Sets the full path of the file where the parameters are to be saved to.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.sf.okapi.common.IParameters

      `fromString, getBoolean, getInteger, getString, reset, setBoolean, setInteger, setString, toString`

- - ### Field Detail

    - #### path

          protected java.lang.String path

      Current path of the parameter file.

  - ### Constructor Detail

    - #### BaseParameters

          public BaseParameters()

      Creates a new BaseParameters object with a null path.

  - ### Method Detail

    - #### getPath

          public java.lang.String getPath()

      Description copied from interface: `IParameters`
      Gets the full path of the last file where the parameters where loaded from or saved to.
      Specified by:
        `getPath` in interface `IParameters`
      Returns:
        the full path of the last load() or save(), or null if object was not loaded nor saved.

    - #### setPath

          public void setPath(java.lang.String filePath)

      Description copied from interface: `IParameters`
      Sets the full path of the file where the parameters are to be saved to.
      Specified by:
        `setPath` in interface `IParameters`
      Parameters:
        `filePath` - the full path to set.

    - #### load

          public void load(java.net.URL inputURL,
                  boolean ignoreErrors)

      Description copied from interface: `IParameters`
      Loads the parameters from a file.
      Specified by:
        `load` in interface `IParameters`
      Parameters:
        `inputURL` - URL of the parameters file to load.
        `ignoreErrors` - true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.

    - #### load

          public void load(java.io.InputStream inStream,
                  boolean ignoreErrors)

      Description copied from interface: `IParameters`
      Loads the parameters from a file.
      Specified by:
        `load` in interface `IParameters`
      Parameters:
        `inStream` - input stream with the parameters to load.
        `ignoreErrors` - true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.

    - #### save

          public void save(java.lang.String newPath)

      Description copied from interface: `IParameters`
      Saves the parameters to a file.
      Specified by:
        `save` in interface `IParameters`
      Parameters:
        `newPath` - the full path of the parameters file to save.

    - #### getParametersDescription

          public ParametersDescription getParametersDescription()

      Description copied from interface: `IParameters`
      Gets the description of the parameters.
      Specified by:
        `getParametersDescription` in interface `IParameters`
      Returns:
        the ParametersDescription object for this set of parameters, or null if none is provided.