jOOX and XSLT. An XML love story, continued

The somewhat functional way of thinking involved with jOOX's XML manipulation cries for an additional API enhancement simply supporting XSLT. XSL transformation has become quite a standard way of transforming large amounts of XML into other structures, where normal DOM manipulation (or jOOX manipulation) becomes too tedious. Let's have a look at how things are … Continue reading jOOX and XSLT. An XML love story, continued

SQL incompatibilities: NOT IN and NULL values

This is something where many hours of debugging have been spent in the lives of many SQL developers. The various situations where you can have NULL values in NOT IN predicates and anti-joins. Here's a typical situation: with data as ( select 1 as id from dual union all select 2 as id from dual … Continue reading SQL incompatibilities: NOT IN and NULL values

CSS selectors in Java

CSS selectors are a nice and intuitive alternative to XPath for DOM navigation. While XPath is more complete and has more functionality, CSS selectors were tailored for HTML DOM, where the document content is usually less structured than in XML. Here are some examples of CSS selector and equivalent XPath expressions: CSS: document > library > books > … Continue reading CSS selectors in Java

Use Xalan’s extension functions natively in jOOX

jOOX aims at increased ease of use when dealing with Java's rather complex XML API's. One example of such a complex API is Xalan, which has a lot of nice functionality, such as its extension namespaces. When you use Xalan, you may have heard of those extensions as documented here: http://exslt.org These extensions can typically … Continue reading Use Xalan’s extension functions natively in jOOX

jOOX answers many Stack Overflow questions

When you search for Stack Overflow questions regarding XML, DOM, XPath, JAXB, etc, you could very often answer them simply with an example involving jOOX. Take this question extract for example: Goal My goal is to achieve following from this ex xml file : <root> <elemA>one</elemA> <elemA attribute1='first' attribute2='second'>two</elemA> <elemB>three</elemB> <elemA>four</elemA> <elemC> <elemB>five</elemB> </elemC> </root> … Continue reading jOOX answers many Stack Overflow questions

Java 8 will have some support for unsigned integers

This seemed to be good news at first. An announcement by Oracle's Joe Darcy claiming that Java will finally have *some* support for unsigned integers: http://blogs.oracle.com/darcy/entry/unsigned_api This will only be added on an API level, though. Not on a language level including all the expected features: Primitive types Wrapper types Arithmetics Casting rules Boxing / … Continue reading Java 8 will have some support for unsigned integers

jOOX and JAXB

jOOX has been awfully quiet lately due to increased development focus in jOOQ. Nevertheless, the jOOX feature roadmap is full of promising new features. Unlike its inspiration jquery, jOOX is positioning itself in the Java world, where many XML API's already exist. One of the most important XML APIs in Java is JAXB, a very … Continue reading jOOX and JAXB

jOOQ’s fluent API in BNF notation

I have recently posted an article about how to generally design a fluent API in Java. By fluent API, I don't mean simple constructs such as new Builder().withSomething(x) .withSomethingElse(y) .withSomething(z) .withAnotherThing(xx); The above is just simple method-chaining, without any sophisticated formal language definition. Most often in method-chaining contexts, the order of method calls is irrelevant … Continue reading jOOQ’s fluent API in BNF notation

if – else coding style best practices

The following post is going to be an advanced curly-braces discussion with no right or wrong answer, just more "matter of taste". It is about whether to put "else" (and other keywords, such as "catch", "finally") on a new line or not. Some may write if (something) { doIt(); } else { dontDoIt(); } I, … Continue reading if – else coding style best practices

The good API design

I've stumbled upon a nice checklist wrapping up API design guidelines. An extract: Favor placing API and implementation into separate packages Favor placing APIs into high-level packages and implementation into lower-level packages Consider breaking up large APIs into several packages Consider putting API and implementation packages into separate Java archives Avoid (minimize) internal dependencies on … Continue reading The good API design