Оценка сценария Apache BatikJAVA

Программисты JAVA общаются здесь
Anonymous
Оценка сценария Apache Batik

Сообщение Anonymous »

Я создал следующий код для проверки интеграции Batik Rhino:

Код: Выделить всё

public class BatikTest
{
public static void main(String...args) throws SAXException, IOException, ParserConfigurationException, TranscoderException, TransformerException
{
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(XMLResourceDescriptor.getXMLParserClassName());
Document document = factory.createSVGDocument(null, new StringReader("java.lang.System.out.println('Hello, World!');"));
TranscoderInput input = new TranscoderInput(document);
ImageTranscoder transcoder = new ImageTranscoder()
{
private BufferedImage image;

@Override
public BufferedImage createImage(int width, int height) {
return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}

@Override
public void writeImage(BufferedImage image, TranscoderOutput output) throws TranscoderException {
this.image = image;

}};
StringWriter writer = new StringWriter();
transcoder.transcode(input, null);
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(writer);
TransformerFactory factori = TransformerFactory.newInstance();
Transformer transformer = factori.newTransformer();
transformer.transform(source, result);
System.out.println(writer.toString());
}
}
Почему не отображается строка «Hello, World!» печать на консоли? Что мне не хватает?

Подробнее здесь: https://stackoverflow.com/questions/786 ... evaluation

Вернуться в «JAVA»