ph-commons

Java 1.8+ Library with tons of utility classes required in most of ph-* projects.

Version 6.x contains major changes and more or less all other projects were released to reflect the changes of 6.x. Version 7 does not exist. Version 8.x was re-designed to best work with JDK 8. So please ensure to not mix 5.x, 6.x and 8x. versions of ph-commons!

This project was the following modules:

News and noteworthy

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-commons</artifactId>
  <version>x.y.z</version>
</dependency>

Contents

Note: to be updated for 9.x - this is for 8.x

In general I tried to make the source comments as useful as possible. Therefore here only an alphabetic package list with the respective contents is shown:

ph-xml

A special XML reading and writing project.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-xml</artifactId>
  <version>x.y.z</version>
</dependency>

ph-jaxb

A special JAXB helper project. It supports both the JDK included JAXB as well as an external JAXB that is used via a separate Maven artefact.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-jaxb</artifactId>
  <version>x.y.z</version>
</dependency>

ph-tree

A special tree management project.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-tree</artifactId>
  <version>x.y.z</version>
</dependency>

ph-less-commons

A library with less common elements. First available with ph-commons 8. A few elements from ph-commons 6 which I'm not really using. But to avoid loss of information this project was added.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-less-commons</artifactId>
  <version>x.y.z</version>
</dependency>

ph-json

Another simple library to read and write JSON documents and streams using a custom parser.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-json</artifactId>
  <version>x.y.z</version>
</dependency>

ph-settings

Another simple library to deal with configuration files and settings in general.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-settings</artifactId>
  <version>x.y.z</version>
</dependency>

ph-datetime

Another library that improves the JDK 8 date time handling with some useful extensions.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-datetime</artifactId>
  <version>x.y.z</version>
</dependency>

ph-graph

Another library to handle all kind of graphs in a generic way.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-graph</artifactId>
  <version>x.y.z</version>
</dependency>

ph-matrix

Another library to handle matrixes in an easy way including some operations on them.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-matrix</artifactId>
  <version>x.y.z</version>
</dependency>

ph-charset

This library adds support for the UTF-7 charset via Java extension SPI.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-charset</artifactId>
  <version>x.y.z</version>
</dependency>

ph-scopes

Contains all the global scope handling as well as the scoped singleton base classes.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-scopes</artifactId>
  <version>x.y.z</version>
</dependency>

ph-collection

Some special collections not used everywhere (like multi maps etc.)

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-collection</artifactId>
  <version>x.y.z</version>
</dependency>

ph-cli

Fork of Apache commons-cli 1.4 with cleansing.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-cli</artifactId>
  <version>x.y.z</version>
</dependency>

ph-bc

Unified BouncyCastle Provider manager. More stuff to come.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-bc</artifactId>
  <version>x.y.z</version>
</dependency>

ph-config

A multi-source configuration manager, that can use system properties, environment variables, resources and application specific values to work with. See ConfigFactory.getDefaultConfig () for the starting point. By default the following configurations sources are scanned in this order:

  1. System properties - priority 400
  2. Environment variables - priority 300
  3. if the system property config.resource or the environment variable CONFIG_RESOURCE is present, and it points to an existing classpath resource, the first one matching is used - priority 200 or determined by the system property config.resource.priority or the environment variable CONFIG_RESOURCE_PRIORITY. Note: the file type is determined by the extension and defaults to "properties".
  4. if the system property config.resources (not the trailing "s") or the environment variable CONFIG_RESOURCES is present, and it points to an existing classpath resource, all matching ones are used - priority 200 or determined by the system property config.resources.priority (also note the trailing "s") or the environment variable CONFIG_RESOURCES_PRIORITY. Note: the file type is determined by the extension and defaults to "properties".
  5. if the system property config.file or the environment variable CONFIG_FILE is present, and it points to an existing file, it is used - priority 200 or determined by the system property config.file.priority or the environment variable CONFIG_FILE_PRIORITY. Note: the file type is determined by the extension and defaults to "properties".
  6. if the system property config.url or the environment variable CONFIG_URL is present, and it points to an existing URL, it is used - priority 200 or determined by the system property config.url.priority or the environment variable CONFIG_URL_PRIORITY. Note: the file type is determined by the extension and defaults to "properties".
  7. a JSON file called private-application.json - this is mainly to have an easy way to override settings - priority 195.
  8. a properties file called private-application.properties - this is mainly to have an easy way to override settings - priority 190.
  9. all JSON files called application.json that are in the classpath - priority 185.
  10. all properties files called application.properties that are in the classpath - priority 180.
  11. all properties files called reference.properties that are in the classpath - priority 1.

JSON format

The JSON configuration file must be a single large object so it must start with "{" and end with "}". The JSON syntax is a bit relaxed and allows for unquoted names but other than that it is regular JSON.

Maven usage

Add the following to your pom.xml to use this artifact:

<dependency>
  <groupId>com.helger</groupId>
  <artifactId>ph-config</artifactId>
  <version>x.y.z</version>
</dependency>

My personal Coding Styleguide | On Twitter: @philiphelger | Kindly supported by YourKit Java Profiler