本文整理汇总了Java中net.sf.saxon.serialize.Emitter类的典型用法代码示例。如果您正苦于以下问题:Java Emitter类的具体用法?Java Emitter怎么用?Java Emitter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Emitter类属于net.sf.saxon.serialize包,在下文中一共展示了Emitter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.sf.saxon.serialize.Emitter; //导入依赖的package包/类
public static boolean init(Transformer transformer, final LocalDebugger dbg) {
if (transformer instanceof Controller) {
System.out.println("SAXON 9");
final Controller controller = (Controller)transformer;
((Saxon9TraceListener)controller.getConfiguration().getTraceListener()).setDebugger(dbg);
controller.getConfiguration().setLineNumbering(true);
controller.getConfiguration().setCompileWithTracing(true);
controller.getConfiguration().setMultiThreading(false);
controller.getConfiguration().setSerializerFactory(new SerializerFactory(controller.getConfiguration()) {
@Override
protected Receiver createXMLSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer) throws XPathException {
return super.createXMLSerializer(emitter, props, pipe, characterMapExpander, normalizer);
}
@Override
protected Emitter newXMLEmitter() {
return new TracingOutputter(dbg.getEventQueue(), super.newXMLEmitter());
}
});
controller.getConfiguration().setDebugger(new Debugger() {
public SlotManager makeSlotManager() {
return new SlotManager() {
@Override
public int allocateSlotNumber(StructuredQName qName) {
System.out.println("qName = " + qName);
return super.allocateSlotNumber(qName);
}
};
}
});
return true;
}
return false;
}
示例2: TracingOutputter
import net.sf.saxon.serialize.Emitter; //导入依赖的package包/类
public TracingOutputter(OutputEventQueueImpl queue, Emitter emitter) {
myEmitter = emitter;
myEventQueue = queue;
}