Package gd.xml.tiny

Examples of gd.xml.tiny.ParsedXML.elements()


    public EntityVerifier(File config) {
        ParsedXML root = null;
        try {
            root = TinyParser.parseXML(new FileInputStream(config));
            for (Enumeration<?> e = root.elements(); e.hasMoreElements();) {
                ParsedXML child = (ParsedXML) e.nextElement();
                if (child.getTypeName().equals("tag")
                        && child.getName().equals(BASE_NODE)) {
                    readOptions(child);
                }
View Full Code Here


     *
     * @see megamek.common.net.marshall.PacketMarshaller#unmarshall(java.io.InputStream)
     */
    public Packet unmarshall(InputStream stream) throws Exception {
        ParsedXML root = TinyParser.parseXML(stream);
        Enumeration<?> rootChildren = root.elements();
        if (!rootChildren.hasMoreElements()) {
            throw new ParseException("No children of the root.");
        }
        ParsedXML rootNode = (ParsedXML) rootChildren.nextElement();
        Packet packet = PacketEncoder.decode(rootNode, null);
View Full Code Here

                    .println("Error parsing settings file'" + fileName + ",.");
            e.printStackTrace(System.out);
            return;
        }

        Enumeration<?> rootChildren = root.elements();
        ParsedXML optionsNode = (ParsedXML) rootChildren.nextElement();

        if (optionsNode.getName().equals(ROOT_NODE_NAME)) {
            Enumeration<?> children = optionsNode.elements();
            while (children.hasMoreElements()) {
View Full Code Here

        Enumeration<?> rootChildren = root.elements();
        ParsedXML optionsNode = (ParsedXML) rootChildren.nextElement();

        if (optionsNode.getName().equals(ROOT_NODE_NAME)) {
            Enumeration<?> children = optionsNode.elements();
            while (children.hasMoreElements()) {
                ParsedXML child = (ParsedXML) children.nextElement();
                if (child != null && child.getName().equals(STORE_NODE_NAME)) {
                    String name = child.getAttribute(NAME_ATTRIBUTE);
                    if (name.equals(CLIENT_SETTINGS_STORE_NAME)) {
View Full Code Here

            System.out.println("Error parsing game options xml file."); //$NON-NLS-1$
            e.printStackTrace(System.out);
            return changedOptions;
        }

        Enumeration<?> rootChildren = root.elements();
        ParsedXML optionsNode = (ParsedXML) rootChildren.nextElement();

        if (optionsNode.getName().equals("options")) { //$NON-NLS-1$
            Enumeration<?> children = optionsNode.elements();
View Full Code Here

        Enumeration<?> rootChildren = root.elements();
        ParsedXML optionsNode = (ParsedXML) rootChildren.nextElement();

        if (optionsNode.getName().equals("options")) { //$NON-NLS-1$
            Enumeration<?> children = optionsNode.elements();

            while (children.hasMoreElements()) {
                IOption option = parseOptionNode((ParsedXML) children
                        .nextElement());
View Full Code Here

            while (children.hasMoreElements()) {
                ParsedXML child = (ParsedXML) children.nextElement();

                if (child.getName().equals("optionname")) { //$NON-NLS-1$
                    name = ((ParsedXML) child.elements().nextElement())
                            .getContent();
                } else if (child.getName().equals("optionvalue")) { //$NON-NLS-1$
                    value = ((ParsedXML) child.elements().nextElement())
                            .getContent();
                }
View Full Code Here

                if (child.getName().equals("optionname")) { //$NON-NLS-1$
                    name = ((ParsedXML) child.elements().nextElement())
                            .getContent();
                } else if (child.getName().equals("optionvalue")) { //$NON-NLS-1$
                    value = ((ParsedXML) child.elements().nextElement())
                            .getContent();
                }
            }

            if ((null != name) && (null != value)) {
View Full Code Here

                throw new EntityLoadingException("   Bad Mech location: "
                        + node.getAttribute(NAME));
            }
            while (children.hasMoreElements()) {
                ParsedXML critSlotNode = (ParsedXML) children.nextElement();
                critData[loc][i][0] = ((ParsedXML) critSlotNode.elements()
                        .nextElement()).getContent();
                if (clanTC && critData[loc][i][0].equals("Targeting Computer")) {
                    critData[loc][i][0] = "(C) " + critData[loc][i][0];
                }
                critData[loc][i++][1] = critSlotNode.getAttribute(ITEM_INDEX);
View Full Code Here

        } catch (ParseException e) {
            System.err.println("Error parsing map settings xml file."); //$NON-NLS-1$
            e.printStackTrace();
            return;
        }
        Enumeration rootChildren = root.elements();
        ParsedXML enivoronmentNode = (ParsedXML) rootChildren.nextElement();

        if (enivoronmentNode.getName().equals("ENVIRONMENT")) { //$NON-NLS-1$
            Enumeration children = enivoronmentNode.elements();
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.