Package eu.bandm.tools.annotations
Class ProjectInfo
java.lang.Object
eu.bandm.tools.annotations.ProjectInfo
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 Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the properties file where project context information is stored. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getProperty
(Class<?> tool, String propertyName, String defaultValue) Queries the value of a tool-specific project context property.static String
getProperty
(ClassLoader classLoader, String propertyName, String defaultValue) Queries the value of a project context property.
-
Field Details
-
PROJECT_INFO_FILENAME
The name of the properties file where project context information is stored.- See Also:
-
-
Method Details
-
getProperty
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 toolpropertyName
- the unqualified name of the propertydefaultValue
- 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
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 filepropertyName
- the qualified name of the propertydefaultValue
- the default value for the property- Returns:
- the value of the property with the given name, or the given default value if not available.
-