Class StartingOperations

java.lang.Object
it.ramecera.salad.everyday.StartingOperations

public class StartingOperations
extends java.lang.Object

General utility class for managing properties files.

Company: Rameceraâ„¢
Creation date: 2020-04-09
Last updated: 2020-04-09

Changes:
2020-04-09: abandonment of SWT graphics in favor of Swing

Author:
M. Maglioni
  • Constructor Summary

    Constructors 
    Constructor Description
    StartingOperations()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.Properties myProperties​(java.lang.String propertiesF, boolean graphicOption)
    Read the properties file.
    static java.util.Properties myPropertiesXML​(java.lang.String propertiesF, boolean graphicOption)
    Reading the properties file, this is an XML file.
    static boolean propertyPresenteBoolean​(java.util.Properties p, java.lang.String label)
    Reading and checking the existence of a Boolean property.
    static java.lang.String whetherPresent​(java.util.Properties p, java.lang.String label)
    Reading and checking the existence of a property.
    static void yourPropertiesXML​(java.lang.String propertiesF, java.util.Properties p)
    Writing the properties file, this is an XML file.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • myPropertiesXML

      public static java.util.Properties myPropertiesXML​(java.lang.String propertiesF, boolean graphicOption) throws ExactException

      Reading the properties file, this is an XML file. Since the routine already includes several error messages, in case of catch you will have to simply return, without displaying anything else; if anything, you can log the event.

      Creation date: 2020-04-09
      Last updated: 2020-19-02

      Modifications:
      2020-04-09: replaced SWT type message-box with Swing type Placard, ver. 2.0.0
      2020-04-09: improvement of error messages, ver. 2.0.1
      2020-04-09: added graphic parameter, it must not issue message boxes when the graphic is not foreseen, for example because it is in non-graphic Unix, ver. 2.1.0

      Parameters:
      propertiesF - the name of the file, positioned at the root of the project, of the XML type, containing the true graphic
      graphicOption - true if it is possible to emit graphic elements; false if the message simply goes to System.out
      Returns:
      the properties extracted from the file, in object of the class Properties
      Throws:
      ExactException - standard exception
    • myProperties

      public static java.util.Properties myProperties​(java.lang.String propertiesF, boolean graphicOption) throws ExactException

      Read the properties file. Since the routine already includes several error messages, in case of catch you will have to simply return, without displaying anything else; if anything, you can log the event.

      Creation date: 2020-10-02
      Last updated: 2020-10-02

      Historys:

      Parameters:
      propertiesF - the name of the file, positioned at the root of the project
      graphicOption - true if it is possible to emit graphic elements; false if the message simply goes to System.out
      Returns:
      the properties extracted from the file, in object of the class Properties
      Throws:
      ExactException - standard exception
    • yourPropertiesXML

      public static void yourPropertiesXML​(java.lang.String propertiesF, java.util.Properties p) throws java.lang.Exception

      Writing the properties file, this is an XML file.

      Creation date: 2020-04-09
      last modification: 2020-04-09

      Modifications:
      2020-04-09 : replaced SWT message-box with Swing type Placard, created version 2.0.0

      Parameters:
      propertiesF - the name of the file, positioned at the root of the project, of XML type, containing the properties
      p - the properties object to write to disk
      Throws:
      java.lang.Exception - The file cannot be written.
    • whetherPresent

      public static java.lang.String whetherPresent​(java.util.Properties p, java.lang.String label) throws ExactException

      Reading and checking the existence of a property.

      Creation date: 2020-04-09
      last modification: 2020-04-09

      Changes:

      Parameters:
      p - the object that contains all the properties
      label - the label of the property
      Returns:
      the data relating to that label
      Throws:
      ExactException - the label is not present, therefore the data is null
    • propertyPresenteBoolean

      public static boolean propertyPresenteBoolean​(java.util.Properties p, java.lang.String label) throws ExactException

      Reading and checking the existence of a Boolean property.

      Creation date: 2020-04-09
      last modification: 2020-04-09

      Changes:

      Parameters:
      p - the object that contains all the properties
      label - the label of the property
      Returns:
      the data relating to that label
      Throws:
      ExactException - the label is not present, therefore the data is null
      Since:
      J6_1