{"id":15056185,"url":"https://github.com/naoghuman/lib-properties","last_synced_at":"2025-10-04T16:30:40.054Z","repository":{"id":18779296,"uuid":"21992496","full_name":"Naoghuman/lib-properties","owner":"Naoghuman","description":"Lib-Properties is a library for easy loading properties files in a JavaFX \u0026 Maven application.","archived":true,"fork":false,"pushed_at":"2018-12-05T16:52:15.000Z","size":93,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-17T18:24:20.518Z","etag":null,"topics":["java","java-8","java-library","javafx","javafx-8","javafx-library","library","maven","netbeans","properties"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Naoghuman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-18T19:50:59.000Z","updated_at":"2023-06-11T15:14:51.000Z","dependencies_parsed_at":"2022-08-30T06:11:23.930Z","dependency_job_id":null,"html_url":"https://github.com/Naoghuman/lib-properties","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Naoghuman","download_url":"https://codeload.github.com/Naoghuman/lib-properties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235274054,"owners_count":18963846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-8","java-library","javafx","javafx-8","javafx-library","library","maven","netbeans","properties"],"created_at":"2024-09-24T21:48:47.415Z","updated_at":"2025-10-04T16:30:34.738Z","avatar_url":"https://github.com/Naoghuman.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lib-Properties\n===\n\n[![Build Status](https://travis-ci.org/Naoghuman/lib-properties.svg?branch=master)](https://travis-ci.org/Naoghuman/lib-properties)\n[![license: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![GitHub release](https://img.shields.io/github/release/Naoghuman/lib-properties.svg)](https://GitHub.com/Naoghuman/lib-properties/releases/)\n\n\n\nIntention\n---\nLib-Properties is a library for `easy` loading [properties] files in a [JavaFX] \n\u0026amp; [Maven] desktop application.\n\n_Image:_ [UML] Lib-Properties  \n![UML-diagram_Lib-Properties_v0.5.0_2017-07-17_21-17.png][UML-diagram_Lib-Properties_v0.5.0_2017-07-17_21-17]\n\n\u003e __Hint__  \n\u003e The `UML` diagram is created with the `Online Modeling Platform` [GenMyModel].\n\nCurrent `version` is `0.5.1` (01.02.2018 / MM.dd.yyyy).\n\n\n\nContent\n---\n\n* [Examples](#Examples)\n    - [How to register a resource bundle](#HoToReAReBu)\n    - [How to access a value from the resource bundle](#HoToAcAVaFrThReBu)\n* [Api](#Api)\n    - [com.github.naoghuman.lib.properties.core.PropertiesFacade](#PropertiesFacade)\n    - [com.github.naoghuman.lib.properties.core.SimpleProperties](#PropertiesFacade)\n* [Download](#Download)\n* [Requirements](#Requirements)\n* [Installation](#Installation)\n* [Documentation](#Documentation)\n* [Contribution](#Contribution)\n* [License](#License)\n* [Autor](#Autor)\n* [Contact](#Contact)\n\n\n\nExamples\u003ca name=\"Examples\" /\u003e\n---\n\n### How to register a resource bundle\u003ca name=\"HoToReAReBu\" /\u003e\n\n```java\npublic interface IApplicationConfiguration {\n    ...\n    public static final String DBW__RESOURCE_BUNDLE = \"/de/pro/dbw/application/DreamBetterWorlds.properties\"; // NOI18N\n}\n\npublic class DreamBetterWorlds extends Application implements IApplicationConfiguration, IPreferencesConfiguration {\n    @Override\n    public void init() throws Exception {\n        PropertiesFacade.getDefault().register(DBW__RESOURCE_BUNDLE);\n        ...\n    }\n\n    ...\n}\n```\n\n\n### How to access a value from the resource bundle\u003ca name=\"HoToAcAVaFrThReBu\" /\u003e\n\n```java\n\npublic class DreamBetterWorlds extends Application implements IApplicationConfiguration, IPreferencesConfiguration {\n    private static final String KEY__APPLICATION__TITLE = \"application.title\"; // NOI18N\n    ...\n\n    @Override\n    public void start(Stage stage) throws Exception {\n        stage.setTitle(this.getProperty(KEY__APPLICATION__TITLE));\n        ...\n    }\n\n    private String getProperty(String propertyKey) {\n        return PropertiesFacade.getDefault().getProperty(DBW__RESOURCE_BUNDLE, propertyKey);\n    }\n    ...\n}\n```\n\n\n\nApi\u003ca name=\"Api\" /\u003e\n---\n\n### com.github.naoghuman.lib.properties.core.PropertiesFacade\u003ca name=\"PropertiesFacade\" /\u003e\n\n```java\n/**\n * The facade {@link com.github.naoghuman.lib.properties.core.PropertiesFacade} \n * provides access to the methods from the {@code Interface} \n * {@link com.github.naoghuman.lib.properties.core.SimpleProperties}.\n * \u003cp\u003e\n * The usage from the facade is preferred over the directly usage through instanziation\n * from the {@code Class} {@link com.github.naoghuman.lib.properties.internal.DefaultSimpleProperties}.\n *\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.properties.core.SimpleProperties\n * @see    com.github.naoghuman.lib.properties.internal.DefaultSimpleProperties\n */\npublic final class PropertiesFacade implements SimpleProperties\n```\n\n```java\n/**\n * Returns a singleton instance from the {@code Class} {@code PropertiesFacade}.\n * \n * @return a singleton instance from the {@code Class} {@code PropertiesFacade}.\n */\npublic static final PropertiesFacade getDefault()\n```\n\n\n### com.github.naoghuman.lib.properties.core.SimpleProperties\u003ca name=\"SimpleProperties\" /\u003e\n\n```java\n/**\n * The {@code Interface} for the default {@code Implementation} \n * {@link com.github.naoghuman.lib.properties.internal.DefaultSimpleProperties}.\n * \u003cp\u003e\n * Over the facade {@link com.github.naoghuman.lib.properties.core.PropertiesFacade} \n * the developer can access to the methods from this {@code Interface}, which is the \n * preferred way (and not the usage through instanziation from the {@code Class} \n * {@code DefaultSimpleProperties}).\n *\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.properties.core.PropertiesFacade\n * @see    com.github.naoghuman.lib.properties.internal.DefaultSimpleProperties\n */\npublic interface SimpleProperties\n```\n\n```java\n/**\n * Searches for the property with the specified key in this property list.\u003cbr\u003e\n * If the key is not found in this property list, the default property list,\n * and its defaults, recursively, are then checked. The method returns\n * {@code null} if the property is not found.\n * \n * @param pathWithBundle The properties where value is stored.\n * @param key            The property key.\n * @return               The value in this property list with the specified \n *                       key value.\n */\npublic String getProperty(final String pathWithBundle, final String key);\n```\n\n```java\n/**\n * Searches for the property with the specified key in this property list.\u003cbr\u003e\n * If the key is not found in this property list, the default property list,\n * and its defaults, recursively, are then checked. The method returns the\n * default value argument if the property is not found.\n * \n * @param pathWithBundle The properties where value is stored.\n * @param key            The property key.\n * @param defaultValue   If the key-value pair not stored in the properties  \n *                       then the {@code defaultValue} will be returned.\n * @return               The value in this property list with the specified \n *                       key value.\n */\npublic String getProperty(final String pathWithBundle, final String key, final String defaultValue);\n```\n\n```java\n/**\n * Allowed access to the {@code System} properties. Gets the system property \n * indicated by the specified key.\n * \u003cp\u003e\n * First, if there is a security manager, its {@code checkPropertyAccess} method \n * is called with the key as its argument. This may result in a SecurityException.\n * \u003cp\u003e\n * If there is no current set of system properties, a set of system properties \n * is first created and initialized in the same manner as for the {@code getProperties} \n * method.\n * \n * @param key The name of the system property.\n * @return    The string value of the system property, or {@code null} if \n *            there is no property with that key.\n * @throws SecurityException If a security manager exists and its \n *                           {@code checkPropertyAccess} method doesn't allow \n *                           access to the specified system property.\n * @throws NullPointerException     If {@code key} is {@code null}.\n * @throws IllegalArgumentException If {@code key} is empty.\n * @see #setSystemProperty(java.lang.String, java.lang.String)\n */\npublic String getSystemProperty(final String key) throws SecurityException, NullPointerException, IllegalArgumentException;\n```\n\n```java\n/**\n * Allowed access to the {@code System} properties. Checks if the system property \n * value equals the parameter value.\n * \u003cp\u003e\n * First, if there is a security manager, its {@code checkPropertyAccess} method \n * is called with the key as its argument. This may result in a SecurityException.\n * \u003cp\u003e\n * If there is no current set of system properties, a set of system properties \n * is first created and initialized in the same manner as for the {@code getProperties} \n * method.\n * \n * @param key   The name of the system property.\n * @param value The value which should checked against the value from the system.\n * @return      If the value from the key equals the parameter value.\n * @throws SecurityException  If a security manager exists and its \n *         {@code checkPropertyAccess} method doesn't allow access to the \n *         specified system property.\n * @throws NullPointerException     If {@code key}is {@code null}.\n * @throws IllegalArgumentException If {@code key} is empty.\n * @see #getSystemProperty(java.lang.String)\n * @see #setSystemProperty(java.lang.String, java.lang.String)\n */\npublic Boolean isSystemProperty(final String key, final String value) throws SecurityException, NullPointerException, IllegalArgumentException;\n```\n\n```java\n/**\n * Register with this method your {@code .properties} file.\u003cbr\u003e\n * The parameter {@code pathWithBundle} have the format:\u003cbr\u003e\n * {@code /your/package/path/to/your/FileToLoad.properties}.\n * \u003cp\u003e\n * The file should be in the {@code src/main/resources} folder with the \n * previous named packaged structure in the specific maven module.\n * \n * @param pathWithBundle The properties which should be register. If the \n *                       properties always register nothing happen.\n */\npublic void register(final String pathWithBundle);\n```\n\n```java\n/**\n * Register with this method your {@code .properties} files.\u003cbr\u003e\n * The parameter in {@code pathWithBundles} should have the format:\u003cbr\u003e\n * {@code /your/package/path/to/your/FileToLoad.properties}.\n * \u003cp\u003e\n * The files should be in the {@code src/main/resources} folder with the \n * previous named packaged structure in the specific maven module.\n * \n * @param pathWithBundles The properties which should be register. If the \n *                        properties always register nothing happen.\n */\npublic void register(final ArrayList\u003cString\u003e pathWithBundles);\n```\n\n```java\n/**\n * Register the given {@link java.util.List} as {@code System}properties.\n * Every entry in the {@link java.util.List} will splitted with the regex to \n * a {@code System} property pair (key, value).\n * \n * @param regex   The delimiting regular expression.\n * @param unnamed The {@link java.util.List} which will splitted.\n * @throws SecurityException If a security manager exists and its \n *         {@code checkPropertyAccess} method doesn't allow access to the \n *         specified system property.\n * @throws NullPointerException     If {@code key}or {@code value} is {@code null}.\n * @throws IllegalArgumentException If {@code key}is empty.\n */\npublic void registerSystemProperties(final String regex, final List\u003cString\u003e unnamed) throws SecurityException, NullPointerException, IllegalArgumentException;\n```\n\n```java\n/**\n * Allowed access to the {@code System} properties. Sets the system property \n * indicated by the specified key.\n * \u003cp\u003e\n * First, if a security manager exists, its {@code SecurityManager.checkPermission}\n * method is called with a {@code PropertyPermission(key, \"write\")}\n * permission. This may result in a SecurityException being thrown. If no \n * exception is thrown, the specified property is set to the given value.\n * \n * @param key   The name of the system property.\n * @param value The value of the system property.\n * @throws SecurityException If a security manager exists and its \n *         {@code checkPropertyAccess} method doesn't allow access to the \n *         specified system property.\n * @throws NullPointerException     If {@code key} or {@code value}is {@code null}.\n * @throws IllegalArgumentException If {@code key} is empty.\n * @see #getSystemProperty(java.lang.String)\n */\npublic void setSystemProperty(final String key, final String value) throws SecurityException, NullPointerException, IllegalArgumentException;\n```\n\n\n\nDownload\u003ca name=\"Download\" /\u003e\n---\n\nCurrent `version` is `0.5.1`. Main points in this release are:\n* This is a minor update.\n* Update dependencies and the documentation.\n\n**Maven coordinates**  \n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.naoghuman\u003c/groupId\u003e\n        \u003cartifactId\u003elib-properties\u003c/artifactId\u003e\n        \u003cversion\u003e0.5.1\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nDownload:\n* [Release v0.5.1 (01.02.2018 / MM.dd.yyyy)]\n\nAn overview about all existings releases can be found here:\n* [Overview from all releases in Lib-Properties]\n\n\n\nRequirements\u003ca name=\"Requirements\" /\u003e\n---\n\n* On your system you need [JRE 8] or [JDK 8] installed.\n* The library [lib-properties-0.5.1.jar](#Installation).\n\nIn the library are following libraries registered as dependencies:\n* The library [lib-logger-0.5.1.jar](#Installation).\n  * Included in `Lib-Logger` is the library [log4j-api-2.8.2.jar].\n  * Included is `Lib-Logger` is the library [log4j-core-2.8.2.jar].\n\n\n\nInstallation\u003ca name=\"Installation\" /\u003e\n---\n\n* If not installed download the [JRE 8] or the [JDK 8].\n  * Optional: To work better with [FXML] files in a [JavaFX] application download \n    the [JavaFX Scene Builder] under 'Additional Resources'.\n* Choose your preferred IDE (e.g. [NetBeans], [Eclipse] or [IntelliJ IDEA]) for development.\n* Download or clone [Lib-Properties].\n* Download or clone [Lib-Logger].\n* Open the projects in your IDE and run them.\n\n\n\nDocumentation\u003ca name=\"Documentation\" /\u003e\n---\n\n* In section [Api](#Api) you can see the main point(s) to access the functionality \n  in this library.\n* For additional information see the [JavaDoc] in the library itself.\n\n\nContribution\u003ca name=\"Contribution\" /\u003e\n---\n\n* If you find a `Bug` I will be glad if you could report an [Issue].\n* If you want to contribute to the project plz fork the project and do a [Pull Request].\n\n\n\nLicense\u003ca name=\"License\" /\u003e\n---\n\nThe project `Lib-Properties` is licensed under [General Public License 3.0].\n\n\n\nAutor\u003ca name=\"Autor\" /\u003e\n---\n\nThe project `Lib-Properties` is maintained by me, Peter Rogge. See [Contact](#Contact).\n\n\n\nContact\u003ca name=\"Contact\" /\u003e\n---\n\nYou can reach me under \u003cpeter.rogge@yahoo.de\u003e.\n\n\n\n[//]: # (Images)\n[UML-diagram_Lib-Properties_v0.5.0_2017-07-17_21-17]:https://user-images.githubusercontent.com/8161815/28286098-5c85b802-6b37-11e7-8db0-47eed1156c43.png\n\n\n\n\n[//]: # (Links)\n[Eclipse]:https://www.eclipse.org/\n[FXML]:http://docs.oracle.com/javafx/2/fxml_get_started/jfxpub-fxml_get_started.htm\n[General Public License 3.0]:http://www.gnu.org/licenses/gpl-3.0.en.html\n[GenMyModel]:https://www.genmymodel.com/\n[IntelliJ IDEA]:http://www.jetbrains.com/idea/\n[Issue]:https://github.com/Naoghuman/lib-preferences/issues\n[JavaDoc]:http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html\n[JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm\n[JavaFX Scene Builder]:http://www.oracle.com/technetwork/java/javase/downloads/index.html\n[JDK 8]:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n[JRE 8]:http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html\n[Lib-Properties]:https://github.com/Naoghuman/lib-properties\n[Lib-Logger]:https://github.com/Naoghuman/lib-logger\n[log4j-api-2.8.2.jar]:https://logging.apache.org/log4j/2.0/log4j-web/dependencies.html\n[log4j-core-2.8.2.jar]:https://logging.apache.org/log4j/2.0/log4j-web/dependencies.html\n[Maven]:http://maven.apache.org/\n[NetBeans]:https://netbeans.org/\n[Overview from all releases in Lib-Properties]:https://github.com/Naoghuman/lib-properties/releases\n[Pull Request]:https://help.github.com/articles/using-pull-requests\n[properties]:http://en.wikipedia.org/wiki/.properties\n[Release v0.5.1 (01.02.2018 / MM.dd.yyyy)]:https://github.com/Naoghuman/lib-properties/releases/tag/v0.5.1\n[UML]:https://en.wikipedia.org/wiki/Unified_Modeling_Language\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoghuman%2Flib-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoghuman%2Flib-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoghuman%2Flib-properties/lists"}