return model.baseName + "Reader";
}
@Override
public void generate(Model model) throws Exception {
final JavaFile file = new JavaFile(packageName, name(model));
file.imports.addStatic(XMLStreamConstants.class);
file.imports.add(javax.xml.namespace.QName.class);
file.imports.add(XMLStreamException.class);
file.imports.add(XMLStreamReader.class);
final ClassBody clas = file.class_("public abstract class %s", file.name);
for (Entry<String, String> ns : model.namespaceJavaNames.entrySet()) {
clas.fields.add("public final static String %s=\"%s\";", ns.getValue(), ns.getKey());
}
for (Entry<QName, String> qName : model.qNameJavaNames.entrySet()) {
String ns = model.namespaceJavaNames.get(qName.getKey().namespace);
clas.fields.add("public final static QName %s=new QName(%s, \"%s\");", qName.getValue(), ns, qName.getKey().localPart);
}
for (final Element element : model.topLevelElements) {
createReaderForDocument(element, clas);
}
for (JavaType type : model.javaTypes) {
createTypeConverter(type, clas);
}
file.write(outputStreamFactory);
}