All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax0.jamal.asciidoc.converters.XmlConverter Maven / Gradle / Ivy

There is a newer version: 2.8.2
Show newest version
package javax0.jamal.asciidoc.converters;

import javax0.jamal.asciidoc.TextConverter;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Xml conversion could be just left for the text converter, but this converter also recognizes pom.jam as xml.
 */
public class XmlConverter extends AbstractConverter {
    @Override
    public List convert(final List original) {
        final var sourcedLines = new ArrayList();
            sourcedLines.add("[source,xml]");
        return TextConverter.convertText(original, sourcedLines);
    }

    @Override
    public boolean canConvert(final String fileName) {
        return super.canConvert(fileName) || new File(fileName).getName().equals("pom.jam");
    }

    private static final List ex = List.of("xml");

    @Override
    List extensions() {
        return ex;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy