Package com.sun.faces.config

Examples of com.sun.faces.config.Verifier


    private void addComponents(NodeList components, String namespace)
    throws XPathExpressionException {

        Application app = getApplication();
        Verifier verifier = Verifier.getCurrentInstance();
        for (int i = 0, size = components.getLength(); i < size; i++) {
            Node componentNode = components.item(i);
            NodeList children = ((Element) componentNode)
                 .getElementsByTagNameNS(namespace, "*");
            String componentType = null;
            String componentClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (COMPONENT_TYPE.equals(n.getLocalName())) {
                    componentType = getNodeText(n);
                } else if (COMPONENT_CLASS.equals(n.getLocalName())) {
                    componentClass = getNodeText(n);
                }
            }

            if (componentType != null && componentClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "Calling Application.addComponent({0},{1})",
                                    componentType,
                                    componentClass));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.COMPONENT,
                                            componentClass,
                                            UIComponent.class);
                }
                app.addComponent(componentType, componentClass);
            }
View Full Code Here


    private void addValidators(NodeList validators, String namespace)
    throws XPathExpressionException {

        Application app = getApplication();
        Verifier verifier = Verifier.getCurrentInstance();
        for (int i = 0, size = validators.getLength(); i < size; i++) {
            Node validator = validators.item(i);

            NodeList children = ((Element) validator)
                 .getElementsByTagNameNS(namespace, "*");
            String validatorId = null;
            String validatorClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (n.getNodeType() == Node.ELEMENT_NODE) {
                    if (VALIDATOR_ID.equals(n.getLocalName())) {
                        validatorId = getNodeText(n);
                    } else if (VALIDATOR_CLASS.equals(n.getLocalName())) {
                        validatorClass = getNodeText(n);
                    }
                }
            }

            if (validatorId != null && validatorClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "Calling Application.addValidator({0},{1})",
                                    validatorId,
                                    validatorClass));
                }
               
                boolean doAdd = true;
                if (validatorId.equals(BeanValidator.VALIDATOR_ID)) {
                    doAdd = ApplicationConfigProcessor.isBeanValidatorAvailable();
                }
               
                if (doAdd) {
                    if (verifier != null) {
                        verifier.validateObject(Verifier.ObjectType.VALIDATOR,
                                validatorClass,
                                Validator.class);
                    }
                    app.addValidator(validatorId, validatorClass);
                }
View Full Code Here

TOP

Related Classes of com.sun.faces.config.Verifier

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.