Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.IconImpl


    }

    protected Icons getIcons(String smallIcon, String largeIcon) {
        IconsImpl icons = null;
        if (smallIcon.length() > 0 || largeIcon.length() > 0) {
            IconImpl i = new IconImpl();
            i.setSmallIcon(smallIcon);
            i.setLargeIcon(largeIcon);
            icons = new IconsImpl();
            icons.add(i);
        }
        return icons;
    }
View Full Code Here


* @author Remy Maucherat
*/
public class IconMetaDataParser extends MetaDataElementParser {

    public static IconImpl parse(XMLStreamReader reader) throws XMLStreamException {
        IconImpl icon = new IconImpl();
        // Handle attributes
        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i ++) {
            final String value = reader.getAttributeValue(i);
            if (reader.getAttributeNamespace(i) != null) {
                continue;
            }
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case ID: {
                    icon.setId(value);
                    break;
                }
                case LANG: {
                    icon.setLanguage(value);
                    break;
                }
                default: throw unexpectedAttribute(reader, i);
            }
        }
        // Handle elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case SMALL_ICON:
                    icon.setSmallIcon(reader.getElementText());
                    break;
                case LARGE_ICON:
                    icon.setLargeIcon(reader.getElementText());
                    break;
                default: throw unexpectedElement(reader);
            }
        }
        return icon;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.IconImpl

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.