Package org.jnode.nanoxml

Examples of org.jnode.nanoxml.XMLElement.parseFromReader()


        }
        BufferedReader br = null;
        try {
            XMLElement elem = new XMLElement();
            br = new BufferedReader(new FileReader(file));
            elem.parseFromReader(br);
            if (!elem.getName().equals("plugin")) {
                throw new EmuException("File does not contain a 'plugin' descriptor: " + file);
            }
            return elem;
        } catch (IOException ex) {
View Full Code Here


                File file = argFile.getValue();
                XMLElement xml = new XMLElement();
                FileReader reader = null;
                try {
                    reader = new FileReader(file);
                    xml.parseFromReader(new BufferedReader(reader));
                    xml.setAttribute("alias", alias);
                    SyntaxBundle bundle =
                        new SyntaxSpecLoader().loadSyntax(new XMLSyntaxSpecAdapter(xml));
                    synMgr.add(bundle);
                } catch (IOException ex) {
View Full Code Here

public class NanoXmlTest {

    public static void main(String[] args)
        throws IOException {
        XMLElement xml = new XMLElement(new Hashtable(), true, false);
        xml.parseFromReader(new FileReader(args[0]));
        System.out.println(xml);
    }
}
View Full Code Here

            // Now parse plugin.xml
            root = new XMLElement(new Hashtable<Object, Object>(), true, false);
            final Reader r = new InputStreamReader(new ByteBufferInputStream(buf));
            try {
                root.parseFromReader(r);
            } finally {
                r.close();
            }
        } catch (IOException ex) {
            throw new PluginException("Plugin " + pluginUrl, ex);
View Full Code Here

        pluginList = new ArrayList<URL>();
        final XMLElement root = new XMLElement(new Hashtable<Object, Object>(), true, false);
        try {
            final FileReader r = new FileReader(file);
            try {
                root.parseFromReader(r);
            } finally {
                r.close();
            }
        } catch (IOException ex) {
            throw new PluginException(ex);
View Full Code Here


    public static Plugin readPlugin(Reader in) throws Exception {

        final XMLElement root = new XMLElement(new Hashtable<Object, Object>(), true, false);
        root.parseFromReader(in);
        String rname = root.getName();
        if (rname.equals("plugin") || rname.equals("fragment")) {
            String id = (String) root.getAttribute("id");
            if (id == null) {
                throw new RuntimeException("Invalid plugin");
View Full Code Here

        try {
            final XMLElement root = new XMLElement(new Hashtable<Object, Object>(), true, false);
            try {
                final FileReader r = new FileReader(descriptor);
                try {
                    root.parseFromReader(r);
                } finally {
                    r.close();
                }
            } catch (IOException ex) {
                throw new BuildException("Building " + descriptor + " failed", ex);
View Full Code Here

    }

    void read(Reader in) throws Exception {

        final XMLElement root = new XMLElement(new Hashtable<Object, Object>(), true, false);
        root.parseFromReader(in);
        String rname = root.getName();
        if (rname.equals("plugin-list")) {
            name = (String) root.getAttribute("name");
            if (name == null) {
                throw new RuntimeException("Invalid plugin list");
View Full Code Here

    private void loadTable(String filename) throws IOException {
        FileReader reader = new FileReader(filename);
        try {
            XMLElement xml = new XMLElement();
            xml.parseFromReader(reader);
            List<XMLElement> children = xml.getChildren();
            for (XMLElement aChildren : children) {
                XMLElement child = (XMLElement) aChildren;
                try {
                    table.put(child.getStringAttribute("ethernetAddress").toUpperCase(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.