Package net.sf.basedb.core
Class ExtendedProperties
java.lang.Object
net.sf.basedb.core.ExtendedProperties
This class is used for reading XML files with information
about extended properties. All files returned by
Application.getExtendedPropertyFiles()
are parsed.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate static Map<String,
List<ExtendedProperty>> A map from class name --> a list of extended properties of for that class.A list with thename
attribute of all classes found in the xml file.private static final URL
The DTD which is used to validate the XML file.private static boolean
private static final Logger
Log core events.private static Map<String,
List<ExtendedProperty>> A map from class name --> a list of extended properties of for that class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a list with the name of all classes.static List<ExtendedProperty>
getProperties
(String className) Get a list of extended properties for the specified class.static List<ExtendedProperty>
getProperties
(String className, boolean includeHidden) Get a list of extended properties for the specified class.static ExtendedProperty
getProperty
(String className, String property) Find an extended property in a given class.(package private) static void
init()
Initialize the class.static boolean
isExtendable
(String className) Check if extended properties has been defined for the specified class.private static void
loadClasses
(Set<String> usedNames, Document dom, String xmlFile) Load the classes and put their names in theclasses
variable.private static void
Load and parse the file with predefined queries.private static void
loadProperties
(Set<String> usedNames, Element classElement, String xmlFile) Load the properties for the specified class node and put the list in theallProperties
variable.(package private) static void
unload()
Unload all settings.
-
Field Details
-
log
Log core events. -
classes
A list with thename
attribute of all classes found in the xml file. -
allProperties
A map from class name --> a list of extended properties of for that class. The list holdsExtendedProperty
objects. -
visibleProperties
A map from class name --> a list of extended properties of for that class. The list holdsExtendedProperty
objects that are not hidden.- Since:
- 3.13
-
dtdFile
The DTD which is used to validate the XML file. -
isInitialised
private static boolean isInitialised
-
-
Constructor Details
-
ExtendedProperties
public ExtendedProperties()
-
-
Method Details
-
init
Initialize the class.- Throws:
BaseException
- This exception is thrown if there is an error
-
unload
static void unload()Unload all settings. -
loadExtendedPropertiesFile
Load and parse the file with predefined queries. This method will populate theclasses
,allProperties
andvisibleProperties
variables.- Throws:
BaseException
-
getClasses
Get a list with the name of all classes. The names do not include a package name.- Returns:
- A
List
containing the names of the classes.
-
isExtendable
Check if extended properties has been defined for the specified class.- Parameters:
className
- The name of the class with or without the package name- Returns:
- TRUE if the class is extendable, FALSE otherwise
-
getProperties
Get a list of extended properties for the specified class. Hidden properties (introduced in BASE 3.13) are not included.- Parameters:
className
- The name of the class with or without the package name- Returns:
- A
List
object containingExtendedProperty
objects, or null if the specified class is not extendable or no extended properties has been defined
-
getProperties
Get a list of extended properties for the specified class.- Parameters:
className
- The name of the class with or without the package nameincludeHidden
- A flag to indicate if hidden properties should be included or not- Returns:
- A
List
object containingExtendedProperty
objects, or null if the specified class is not extendable or no extended properties has been defined - Since:
- 3.13
-
getProperty
Find an extended property in a given class.- Parameters:
className
- The name of an extendable class with or without the package nameproperty
- The name of the property- Returns:
- The extended property or null if not found
- Since:
- 2.15
-
loadClasses
Load the classes and put their names in theclasses
variable. -
loadProperties
Load the properties for the specified class node and put the list in theallProperties
variable.
-