Package org.jdom2

Examples of org.jdom2.Attribute


        super.populateItem(item,eItem, index);

        Description description = item.getDescription();
        if (description!=null && description.getType()!=null) {
            Element eDescription = eItem.getChild("description",getFeedNamespace());
            eDescription.setAttribute(new Attribute("type",description.getType()));
        }
        eItem.removeChild("expirationDate",getFeedNamespace());
    }
View Full Code Here


            return textValueOf(input);
        }};
    }

    public static String attrOf(Element input, String attname) {
        Attribute attribute = input.getAttribute(attname);
        if(attribute == null) {
            return null;
        }
        return attribute.getValue();
    }
View Full Code Here

        if( el != null && attributes != null )
        {
            while( attributes.hasNext() )
            {
                Attribute attr = (Attribute)attributes.next();
                if( attr != null )
                {
                    el.setAttribute(attr);
                }
            }
View Full Code Here

            params.put("cmlimit", limit);
            params.put("cmprop", "title|type");
        }

        if (queryContinue != null && queryContinue.getName().equals(prop) && queryContinue.getAttributes().size() == 1) {
            final Attribute a = queryContinue.getAttributes().get(0);
            params.put(a.getName(), a.getValue());
        }

        return params;
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    private void parseAnimations(final Multimap<Element, TargetChannel> channelMap, final Element animationRoot,
            final AnimationItem animationItemRoot) {
        if (animationRoot.getChild("animation") != null) {
            Attribute nameAttribute = animationRoot.getAttribute("name");
            if (nameAttribute == null) {
                nameAttribute = animationRoot.getAttribute("id");
            }
            final String name = nameAttribute != null ? nameAttribute.getValue() : "Default";

            final AnimationItem animationItem = new AnimationItem(name);
            animationItemRoot.getChildren().add(animationItem);

            for (final Element animationElement : animationRoot.getChildren("animation")) {
View Full Code Here

        str.append('<');
        str.append(e.getName());
        str.append(' ');
        final List<Attribute> attrs = e.getAttributes();
        for (int i = 0; i < attrs.size(); i++) {
            final Attribute attr = attrs.get(i);
            str.append(attr.getName());
            str.append("=\"");
            str.append(attr.getValue());
            str.append('"');
            if (i < attrs.size() - 1) {
                str.append(' ');
            }
        }
View Full Code Here

     * @param attributeName
     *            Attribute name to parse a value for
     * @return parsed integer
     */
    public int getAttributeIntValue(final Element input, final String attributeName, final int defaultVal) {
        final Attribute attribute = input.getAttribute(attributeName);
        if (attribute != null) {
            try {
                return attribute.getIntValue();
            } catch (final DataConversionException e) {
                logger.log(Level.WARNING, "Could not parse int value", e);
            }
        }
        return defaultVal;
View Full Code Here

        if (params.length > 0 && params[0] instanceof Mesh) {
            final Mesh mesh = (Mesh) params[0];
            // should have a child: <technique profile="GOOGLEEARTH">
            final Element technique = extra.getChild("technique");
            if (technique != null) {
                final Attribute profile = technique.getAttribute("profile");
                if (profile != null && "GOOGLEEARTH".equalsIgnoreCase(profile.getValue())) {
                    for (final Element child : technique.getChildren()) {
                        // disable back face culling if it's been enabled.
                        if ("double_sided".equalsIgnoreCase(child.getName()) && "1".equals(child.getTextTrim())) {
                            final CullState cs = new CullState();
                            cs.setEnabled(false);
View Full Code Here

            return textValueOf(input);
        }};
    }

    public static String attrOf(Element input, String attname) {
        Attribute attribute = input.getAttribute(attname);
        if(attribute == null) {
            return null;
        }
        return attribute.getValue();
    }
View Full Code Here

     */
    protected final String getTaxonomy(final Element desc) {
        String taxonomy = null;
        final Element topic = desc.getChild("topic", getTaxonomyNamespace());
        if (topic != null) {
            final Attribute resource = topic.getAttribute("resource", getRDFNamespace());
            if (resource != null) {
                taxonomy = resource.getValue();
            }
        }
        return taxonomy;
    }
View Full Code Here

TOP

Related Classes of org.jdom2.Attribute

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.