private List<OutputFile> createBytecode(Document document, String path) throws IllegalXMLVMException, IOException
{
List<OutputFile> result= new ArrayList<OutputFile>();
Element root= document.getRootElement();
if (!root.getName().equals("xmlvm"))
throw new IllegalXMLVMException("Root element needs to be <xmlvm>");
@SuppressWarnings("unchecked")
List<Element> clazzes= root.getChildren("class", nsXMLVM);
for (Element clazz : clazzes)
{
if (clazz == null)
throw new IllegalXMLVMException("XMLVM contains no class");
createClass(clazz);
for (Object o : clazz.getChildren())
{
Element decl= (Element) o;
String tag= decl.getName();
if (tag.equals("method"))
createMethod(decl);
else if (tag.equals("field"))
createField(decl);
else
throw new IllegalXMLVMException("Unknown class declaration '" + tag + "'");
}
String packageName= clazz.getAttributeValue("package");
// If there is a package name, then create necessary