The fawkeZ project contains a set of Java types and utility classes. Several of them are especially useful for avoiding null pointer exceptions, and the rest remove small pieces of repeated code from application classes.
Types
The types live in the org.jcoderz.commons.types package.
| Type | Purpose |
|---|---|
Date | A date value type used across the project. |
Period | A period between two dates. |
YearMonth | A year and month value. |
Utilities
The utilities live in the org.jcoderz.commons.util package.
| Class | Purpose |
|---|---|
ArraysUtil | Array helpers. |
Assert | Null assertion helpers. |
Base64Util | Base64 encoder and decoder. |
Constants | Shared constant definitions. |
DbUtil | Database helpers. |
EmptyIterator | An iterator with no elements. |
FileUtils | File helpers. |
HashCode | A hash code value type. |
HashCodeUtil | Hash code calculation helpers. |
HexUtil | Hexadecimal conversion helpers. |
IoUtil | Input and output helpers. |
JarUtil | Jar file helpers. |
JaxbUtil | JAXB helpers. |
JmsUtil | JMS helpers. |
LoggingProxy | A proxy that logs calls to an interface. |
LuhnAlgorithm | Checksum validation. |
ObjectUtil | Object comparison helpers. |
RandomUtil | Random value helpers. |
SerializableIterator | A serializable iterator wrapper. |
StringUtil | String helpers. |
ThrowableUtil | Throwable formatting helpers. |
XmlFilterBase | Base class for XML filters. |
XmlUtil | XML helpers. |
XsdUtil | XML schema helpers. |
Why the assertion class matters
A null pointer exception is usually a symptom, not a cause. The assertion class makes the precondition explicit at the point where a value enters a method, so the stack trace points at the real defect rather than at the line that happened to dereference the value much later.
Where to read the source
The classes were published in the Subversion trunk. The archive keeps the source tree listing, and the simple types generator explains how the strong types in the same module are produced.