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

RelatedContentDesc net::sourceforge::jnlp::Parser::getRelatedContent ( Node  node  )  throws ParseException [inline]

Returns the related-content descriptor.

Definition at line 773 of file Parser.java.

References base, net::sourceforge::jnlp::Node::getFirstChild(), getIcon(), net::sourceforge::jnlp::Node::getNextSibling(), net::sourceforge::jnlp::Node::getNodeName(), getRequiredAttribute(), getSpanText(), getURL(), and strict.

Referenced by getInformationDesc().

                                                                                 {

        getRequiredAttribute(node, "href", null);
        URL location = getURL(node, "href", base);

        String title = null;
        String description = null;
        IconDesc icon = null;

        // step through the elements
        Node child = node.getFirstChild();
        while (child != null) {
            String name = child.getNodeName();

            if ("title".equals(name)) {
                if (title != null && strict) {
                    throw new ParseException(R("PTwoTitles"));
                }
                title = getSpanText(child);
            } else if ("description".equals(name)) {
                if (description != null && strict) {
                    throw new ParseException(R("PTwoDescriptions"));
                }
                description = getSpanText(child);
            } else if ("icon".equals(name)) {
                if (icon != null && strict) {
                    throw new ParseException(R("PTwoIcons"));
                }
                icon = getIcon(child);
            }

            child = child.getNextSibling();
        }

        RelatedContentDesc relatedContent = new RelatedContentDesc(location);
        relatedContent.setDescription(description);
        relatedContent.setIconDesc(icon);
        relatedContent.setTitle(title);

        return relatedContent;

    }


Generated by  Doxygen 1.6.0   Back to index