javax0.jamal.asciidoc.converters.XmlConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jamal-asciidoc Show documentation
Show all versions of jamal-asciidoc Show documentation
Asciidoc preprocessor extension
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