Package gd.xml

Examples of gd.xml.ParseException


        // Do nothing.
    }

    public InputStream getDocumentStream() throws ParseException {
        if (this.inStream == null) {
            throw new ParseException("Input document stream not defined.");
        }
        return this.inStream;
    }
View Full Code Here


     */
    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);
        return packet;
    }
View Full Code Here

    public InputStream getDocumentStream() throws ParseException {
        try {
            return new FileInputStream(filename);
        } catch (FileNotFoundException e) {
            throw new ParseException("could not find the specified file");
        }
    }
View Full Code Here

        if (sysID != null) {
            File f = new File((new File(filename)).getParent(), sysID);
            try {
                return new FileInputStream(f);
            } catch (FileNotFoundException e) {
                throw new ParseException("file not found (" + f + ")");
            }
        }
        return null;
    }
View Full Code Here

            // Decode the board from XML.
            ParsedXML root = TinyParser.parseXML(new ByteArrayInputStream(to
                    .toString().getBytes()));
            Enumeration<?> rootChildren = root.elements();
            if (!rootChildren.hasMoreElements()) {
                throw new ParseException("No children of the root.");
            }
            ParsedXML rootNode = (ParsedXML) rootChildren.nextElement();
            board = BoardEncoder.decode(rootNode, game);

            // Save a copy of the board before XML encoding.
View Full Code Here

TOP

Related Classes of gd.xml.ParseException

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.