Package org.gatein.management.api.model

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


        set(name, s, model);
    }

    public static <T extends ModelValue> T get(ModelObject modelObject, Class<T> type, String...names) {
        Model model = modelObject.get(names);
        try {
            return model.asValue(type);
        } catch (IllegalArgumentException e) {
            ModelValue.ModelValueType expected;
            if (type == ModelString.class) {
                expected = ModelValue.ModelValueType.STRING;
            } else if (type == ModelNumber.class) {
View Full Code Here


        model.set("siteType", navigation.getSiteId().getType().getName());
        model.set("siteName", navigation.getSiteId().getName());
        ModelList nodesModel = model.get("nodes").setEmptyList();
        if (rootNode.isChildrenLoaded()) {
            for (Node child : rootNode) {
                Model childModel = nodesModel.add();
                PathAddress childAddress = address.append(child.getName());
                if (scope > 0 || scope < 0) // Continue populating nodes in response
                {
                    populateNode(child, scope - 1, childModel.setEmptyObject(), childAddress);
                } else { // Populate node reference which can be followed
                    ModelReference nodeRef = childModel.set(childAddress);
                    nodeRef.set("name", child.getName());
                }
            }
        }
View Full Code Here

        // Children nodes
        ModelList children = model.get("children", ModelList.class);
        if (node.isChildrenLoaded()) {
            for (Node child : node) {
                Model childModel = children.add();
                PathAddress childAddress = address.append(child.getName());
                if (scope > 0 || scope < 0) // Continue populating nodes in response
                {
                    populateNode(child, scope - 1, childModel.setEmptyObject(), childAddress);
                } else { // Populate node reference which can be followed
                    ModelReference nodeRef = childModel.set(childAddress);
                    nodeRef.set("name", child.getName());
                }
            }
        }
        // Page reference
View Full Code Here

TOP

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

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.