Package org.gatein.management.api.model

Examples of org.gatein.management.api.model.ModelString


            throw invalidType(model, expected, names);
        }
    }

    public static String nonNullString(ModelObject model, String... names) {
        ModelString string = get(model, ModelString.class, names);
        if (!string.isDefined()) {
            throw invalidValue(null, names);
        }
        String value = string.getValue();
        if (value == null) {
            throw invalidValue(null, names);
        }

        return value;
View Full Code Here


                throw invalidValue(value, "displayNames[" + i + "].value");
            }

            // Parse lang (not-required but if defined must be non-null)
            if (displayNameModel.has("lang")) {
                ModelString langModel = get(displayNameModel, ModelString.class, "lang");
                String lang = langModel.getValue();
                if (lang == null) {
                    throw invalidValue(lang, "displayNames[" + i + "].lang");
                }
                Locale locale = getLocale(displayNameModel, "lang");
                if (displayName == null) {
View Full Code Here

        }
        return status;
    }

    private static PublicationDate getPublicationDate(ModelObject nodeModel, PublicationDate previous) {
        ModelString startModel = get(nodeModel, ModelString.class, "visibility", "publication-date", "start");
        Date start = (previous == null) ? null : previous.getStart();
        if (startModel.isDefined()) {
            start = getDate(nodeModel, "visibility", "publication-date", "start");
        }

        ModelString endModel = get(nodeModel, ModelString.class, "visibility", "publication-date", "end");
        Date end = (previous == null) ? null : previous.getEnd();
        if (endModel.isDefined()) {
            end = getDate(nodeModel, "visibility", "publication-date", "end");
        }

        if (start != null && end != null) {
            return PublicationDate.between(start, end);
View Full Code Here

        }
        boolean changed = false;

        // Update displayName
        if (pageModel.has("displayName")) {
            ModelString displayNameModel = get(pageModel, ModelString.class, "displayName");
            page.setDisplayName(displayNameModel.getValue());
            changed = true;
        }

        // Update description
        if (pageModel.has("description")) {
            ModelString descModel = get(pageModel, ModelString.class, "description");
            page.setDescription(descModel.getValue());
            changed = true;
        }

        // Update access-permissions
        if (pageModel.has("access-permissions")) {
View Full Code Here

TOP

Related Classes of org.gatein.management.api.model.ModelString

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.