@Override
    public void characters(char[] ch, int start, int length)
            throws SAXException {

        // Get current state
        DocumentHandlerState current = getCurrentState();
        if (current == null)
            throw new SAXException("Character data not allowed outside XML document.");
        
        // Append received chunk to text content
        current.getTextContent().append(ch, start, length);

    }
Returns the current element state. The current element state is the
state of the element the parser is currently within.

@return The current element state.
guacamole-ext/src/main/java/org/apache/guacamole/xml/DocumentHandler.java