Package org.jnode.nanoxml

Examples of org.jnode.nanoxml.XMLElement


    }

    protected PluginDescriptor readDescriptor(File descriptor) {
        final PluginDescriptor descr;
        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


        this.plugins = plugins;
    }

    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");
            }

            for (XMLElement obj : root.getChildren()) {
                String name = obj.getName();
                if (name.equals("manifest")) {
                    for (XMLElement ch : obj.getChildren()) {
                        String xname = ch.getName();
                        if (xname.equals("attribute")) {
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(),
                        new TableEntry(child));
                } catch (IllegalArgumentException ex) {
                    log.debug("Invalid IP address", ex);
                }
            }
View Full Code Here

TOP

Related Classes of org.jnode.nanoxml.XMLElement

Copyright © 2018 www.massapicom. 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.