private static String getText(Node node) {
        switch (node.getNodeType()) {
            case Node.TEXT_NODE:
                return node.getNodeValue();
            case Node.ELEMENT_NODE:
                StringBuilder builder = new StringBuilder();
                NodeList list = node.getChildNodes();
                for (int i = 0; i < list.getLength(); i++) {
                    builder.append(getText(list.item(i)));
                }
                return builder.toString();
            default:
                return "";
        }
    }
@return maximum field length when serializing String fields in Tika's metadata or metadata
list into JSON
tika-core/src/main/java/org/apache/tika/config/TikaConfig.java