I noticed all Strings in DefaultHandler's event methods are interned. Would it be better to see if Strings are equals with == instead of equals()?
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if(localName == "element")
// do something
// or
if(localName.equals("element"))
// do something
}
Since all String literals are interned, it should improve performance. But all the tutorials and examples I've seen use equals()
A problem I can see is if you need to use equalsIgnoreCase()