class Dom4JParser {
    public void parse(String text) throws DocumentException {
        if (StringUtils.isEmpty(text)) {
            throw new IllegalArgumentException("The text is empty");
        }

        Document document = Dom4JReader.getDocument(text);

        parse(document);
    }

    public void parseFormat(String text) throws DocumentException, UnsupportedEncodingException {
        if (StringUtils.isEmpty(text)) {
            throw new IllegalArgumentException("The text is empty");
        }

        Document document = Dom4JReader.getFormatDocument(text);

        parse(document);
    }

    public void parse(File file) throws DocumentException, IOException, UnsupportedEncodingException {
        if (file == null) {
            throw new IllegalArgumentException("The file is null");
        }

        Document document = Dom4JReader.getDocument(file);

        parse(document);
    }

    public void parseFormat(File file) throws DocumentException, IOException, UnsupportedEncodingException {
        if (file == null) {
            throw new IllegalArgumentException("The file is null");
        }

        Document document = Dom4JReader.getFormatDocument(file);

        parse(document);
    }

    public void parse(InputStream inputStream) throws DocumentException, IOException {
        if (inputStream == null) {
            throw new IllegalArgumentException("The input stream is null");
        }

        Document document = Dom4JReader.getDocument(inputStream);

        parse(document);
    }

    public void parseFormat(InputStream inputStream) throws DocumentException, IOException, UnsupportedEncodingException {<FILL_FUNCTION_BODY>}

    public void parse(Document document) {
        Element rootElement = document.getRootElement();

        parseRoot(rootElement);
    }

    protected abstract void parseRoot(Element element);
}

        if (inputStream == null) {
            throw new IllegalArgumentException("The input stream is null");
        }

        Document document = Dom4JReader.getFormatDocument(inputStream);

        parse(document);
    
<no_super_class>