Class ProjectInfo

java.lang.Object
eu.bandm.tools.annotations.ProjectInfo

public abstract class ProjectInfo extends Object
Access point for project context information. Information is stored in the form of a properties file that is accessed at runtime as a resource. This resource must be present as a file at the top of the class file tree of the involved ClassLoader.
See Also:
  • Field Details

    • PROJECT_INFO_FILENAME

      public static final String PROJECT_INFO_FILENAME
      The name of the properties file where project context information is stored.
      See Also:
  • Method Details

    • getProperty

      public static String getProperty(Class<?> tool, String propertyName, String defaultValue)
      Queries the value of a tool-specific project context property.

      This operation fails silently and returns the given default value if the property file is not available as a resource, cannot be loaded, or does not contain the expected property.

      Parameters:
      tool - the main class of the tool
      propertyName - the unqualified name of the property
      defaultValue - the default value for the property
      Returns:
      the value of the property with the given name qualified by the name of the given class, or the given default value if not available.
    • getProperty

      public static String getProperty(ClassLoader classLoader, String propertyName, String defaultValue)
      Queries the value of a project context property.

      This operation fails silently and returns the given default value if the property file is not available as a resource, cannot be loaded, or does not contain the expected property.

      Parameters:
      classLoader - the class loader from which to obtain the resource file
      propertyName - the qualified name of the property
      defaultValue - the default value for the property
      Returns:
      the value of the property with the given name, or the given default value if not available.