public CompiledContext(ClassLoader cl, String readerClsName, String writerClsName) {
try {
Class<?> readerCls = cl.loadClass(readerClsName);
Class<?> writerCls = cl.loadClass(writerClsName);
final GeneratedReader gr = (GeneratedReader) readerCls.newInstance();
final GeneratedWriter gw = (GeneratedWriter) writerCls.newInstance();
final CompiledContext ctx = this;
this.reader = new Reader(this) {
@Override
public Object read(XoXMLStreamReader xsr, Map<String, Object> properties)
throws Exception {
return gr.read(xsr, ctx);
}
public Object read(XoXMLStreamReader xsr,
Map<String, Object> properties,
QName type)
throws Exception {
return gr.read(xsr, ctx, type);
}
};
this.writer = new Writer(this) {
@Override