Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lviggiano/owner
Get rid of the boilerplate code in properties based configuration.
https://github.com/lviggiano/owner
configuration hacktoberfest properties
Last synced: 3 months ago
JSON representation
Get rid of the boilerplate code in properties based configuration.
- Host: GitHub
- URL: https://github.com/lviggiano/owner
- Owner: matteobaccan
- License: bsd-3-clause
- Created: 2012-12-23T05:38:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-07-20T19:22:52.000Z (4 months ago)
- Last Synced: 2024-08-01T18:24:29.141Z (3 months ago)
- Topics: configuration, hacktoberfest, properties
- Language: Java
- Homepage: https://matteobaccan.github.io/owner/
- Size: 4.87 MB
- Stars: 912
- Watchers: 57
- Forks: 212
- Open Issues: 131
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-tech - owner - Reduces boilerplate of properties. (Solutions / Configuration)
- awesome-java-zh - owner - 减少属性的样板。 (项目 / 配置)
- awesome-java - owner - Reduces boilerplate of properties. (Projects / Configuration)
- awesome-java - owner - Reduces boilerplate of properties. (Projects / Configuration)
README
OWNER
=====OWNER, an API to ease Java property files usage.
[![Build Status](https://travis-ci.org/lviggiano/owner.png?branch=master)](https://travis-ci.org/lviggiano/owner)
[![Coverage Status](https://coveralls.io/repos/lviggiano/owner/badge.png)](https://coveralls.io/r/lviggiano/owner)
[![security status](https://www.meterian.com/badge/gh/lviggiano/owner/security)](https://www.meterian.com/report/gh/lviggiano/owner)
[![stability status](https://www.meterian.com/badge/gh/lviggiano/owner/stability)](https://www.meterian.com/report/gh/lviggiano/owner)
[![Built with Maven](http://maven.apache.org/images/logos/maven-feather.png)](http://maven.apache.org)INTRODUCTION
------------The goal of OWNER API is to minimize the code required to handle
application configuration through Java properties files.Full documentation available on [project website][website].
BASIC USAGE
-----------The approach used by OWNER APIs, is to define a Java interface
associated to a properties file.Suppose your properties file is defined
as `ServerConfig.properties`:```properties
port=80
hostname=foobar.com
maxThreads=100
```To access this property you need to define a convenient Java
interface in `ServerConfig.java`:```java
public interface ServerConfig extends Config {
int port();
String hostname();
int maxThreads();
}
```We'll call this interface the *Properties Mapping Interface* or
just *Mapping Interface* since its goal is to map Properties into
a an easy to use piece of code.Then, you can use it from inside your code:
```java
public class MyApp {
public static void main(String[] args) {
ServerConfig cfg = ConfigFactory.create(ServerConfig.class);
System.out.println("Server " + cfg.hostname() + ":" + cfg.port() +
" will run " + cfg.maxThreads());
}
}
```But this is just the tip of the iceberg.
Continue reading here: [Basic usage](https://matteobaccan.github.io/owner/docs/usage/).
DOWNLOAD
--------Public Releases can be downloaded from [GitHub Releases](https://github.com/lviggiano/owner/releases) page or
[Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.aeonbits.owner%22%20AND%20a%3A%22owner%22).DOCUMENTATION
-------------Make sure to have a look at the documentation on [project website][website]
to learn how flexible and powerful OWNER is, and why you may need it!Chinese documentation is provided by [Yunfeng Cheng](https://github.com/cyfonly) via a GitHub independent project at
[this address][chinese-docs].[website]: https://matteobaccan.github.io/owner
[chinese-docs]: https://github.com/cyfonly/owner-docLICENSE
-------OWNER is released under the BSD license.
See [LICENSE][] file included for the details.[LICENSE]: https://raw.github.com/lviggiano/owner/master/LICENSE