Logo Search packages:      
Sourcecode: icedtea-web version File versions  Download package

AppletDesc net::sourceforge::jnlp::Parser::getApplet ( Node  node  )  throws ParseException [inline]

Returns the applet descriptor.

Exceptions:
ParseException if the JNLP file is invalid

Definition at line 641 of file Parser.java.

References base, getChildNodes(), getRequiredAttribute(), and getURL().

Referenced by getLauncher().

                                                                 {
        String name = getRequiredAttribute(node, "name", R("PUnknownApplet"));
        String main = getRequiredAttribute(node, "main-class", null);
        URL docbase = getURL(node, "documentbase", base);
        Map paramMap = new HashMap();
        int width = 0;
        int height = 0;

        try {
            width = Integer.parseInt(getRequiredAttribute(node, "width", "100"));
            height = Integer.parseInt(getRequiredAttribute(node, "height", "100"));
        }
        catch (NumberFormatException nfe) {
            if (width <= 0)
                throw new ParseException(R("PBadWidth"));
            throw new ParseException(R("PBadWidth"));
        }

        // read params
        Node params[] = getChildNodes(node, "param");
        for (int i=0; i < params.length; i++) {
            paramMap.put(getRequiredAttribute(params[i], "name", null),
                         getRequiredAttribute(params[i], "value", ""));
        }

        return new AppletDesc(name, main, docbase, width, height, paramMap);
    }


Generated by  Doxygen 1.6.0   Back to index