Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.WelcomeFileListMetaData


                context.addLocaleEncodingMappingParameter(value.getLocale(), value.getEncoding());
            }
        }

        // Welcome files
        WelcomeFileListMetaData welcomeFiles = metaData.getWelcomeFileList();
        if (welcomeFiles != null) {
            for (String value : welcomeFiles.getWelcomeFiles())
                context.addWelcomeFile(value);
        }

        // Session timeout
        SessionConfigMetaData scmd = metaData.getSessionConfig();
View Full Code Here


        // Mime mappings
        metadata.setMimeMappings(Collections.unmodifiableList(mimeMappings));

        // Welcome files
        metadata.setWelcomeFileList(new WelcomeFileListMetaData());
        metadata.getWelcomeFileList().setWelcomeFiles(Collections.unmodifiableList(welcomeFiles));
        return metadata;
    }
View Full Code Here

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

    public static WelcomeFileListMetaData parse(XMLStreamReader reader) throws XMLStreamException {
        WelcomeFileListMetaData welcomeFileList = new WelcomeFileListMetaData();

        // 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: {
                    welcomeFileList.setId(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 WELCOME_FILE:
                    List<String> welcomeFiles = welcomeFileList.getWelcomeFiles();
                    if (welcomeFiles == null) {
                        welcomeFiles = new ArrayList<String>();
                        welcomeFileList.setWelcomeFiles(welcomeFiles);
                    }
                    welcomeFiles.add(reader.getElementText());
                    break;
                default: throw unexpectedElement(reader);
            }
View Full Code Here

                context.addLocaleEncodingMappingParameter(value.getLocale(), value.getEncoding());
            }
        }

        // Welcome files
        WelcomeFileListMetaData welcomeFiles = metaData.getWelcomeFileList();
        if (welcomeFiles != null) {
            for (String value : welcomeFiles.getWelcomeFiles())
                context.addWelcomeFile(value);
        }

        // Session timeout
        SessionConfigMetaData scmd = metaData.getSessionConfig();
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.WelcomeFileListMetaData

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.