[jdom-interest] Still to do - org.jdom2.util

Rolf Lear jdom at tuis.net
Tue Apr 3 06:41:13 PDT 2012

Hi all

I have the following on the to-do list: 'fix' the org.jdom2.util package

this package contains public classes many of which are not really JDOM

My plan is:

StringBin will become 'package private' and will be moved to org.jdom2.
This makes it 'invisible' but still accessible to SlimJDOMFactory

XMLBase will have its internal logic moved to Element as a new method
public URI getXMLBase(), then XMLBase will be removed entirely

NamespaceStack can stay in util and be declared part of the public API
IteratorIterable can stay in util and be declared part of the public API

This leaves ArrayCopy and ReflectionConstructor. These classes are used
from a number of different places in JDOM. ArrayCopy duplicates the
Arrays.arrayCopy(*) logic because it is not available in Java5.
ReflectionConstructor centralizes the logic and error handling for a number
of places too. They cannot be made 'private'.

I think I am going to create a new package org.jdom2.support which I will
document as 'this is private JDOM code. Do not use any classes in this
directly package in your code!'

I think this will leave org.jdom2.util with just the NamespaceStack and
the IteratorIterable. Which are fair to make part of the public JDOM API.

Does anyone have any comments on this? Concerns?

I would particularly like feedback on what a good name would be for the
new package containing ArrayCopy and other 'public-but-not-public' classes.
"org.jdom2.support"? "org.jdom2.internal"? Any ideas?


More information about the jdom-interest mailing list