Package com.sun.faces.config

Examples of com.sun.faces.config.Verifier


    private void addBehaviors(NodeList behaviors, String namespace)
    throws XPathExpressionException {

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

            NodeList children = ((Element) behavior)
                 .getElementsByTagNameNS(namespace, "*");
            String behaviorId = null;
            String behaviorClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (n.getNodeType() == Node.ELEMENT_NODE) {
                    if (BEHAVIOR_ID.equals(n.getLocalName())) {
                        behaviorId = getNodeText(n);
                    } else if (BEHAVIOR_CLASS.equals(n.getLocalName())) {
                        behaviorClass = getNodeText(n);
                    }
                }
            }

            if (behaviorId != null && behaviorClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "Calling Application.addBehavior({0},{1})",
                                    behaviorId,
                                    behaviorClass));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.BEHAVIOR,
                                            behaviorClass,
                                            Behavior.class);
                }
                app.addBehavior(behaviorId, behaviorClass);
            }
View Full Code Here


    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


    private void addConverters(NodeList converters, String namespace) {

        Application application = getApplication();
        Verifier verifier = Verifier.getCurrentInstance();
        for (int i = 0, size = converters.getLength(); i < size; i++) {
            Node converter = converters.item(i);
            NodeList children = ((Element) converter)
                 .getElementsByTagNameNS(namespace, "*");
            String converterId = null;
            String converterClass = null;
            String converterForClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (CONVERTER_ID.equals(n.getLocalName())) {
                    converterId = getNodeText(n);
                } else if (CONVERTER_CLASS.equals(n.getLocalName())) {
                    converterClass = getNodeText(n);
                } else if (CONVERTER_FOR_CLASS.equals(n.getLocalName())) {
                    converterForClass = getNodeText(n);
                }
            }

            if (converterId != null && converterClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "[Converter by ID] Calling Application.addConverter({0}, {1}",
                                    converterId,
                                    converterClass));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.CONVERTER,
                                            converterClass,
                                            Converter.class);
                }
                application.addConverter(converterId, converterClass);
            } else if (converterClass != null && converterForClass != null) {
                try {
                    Class cfcClass = Util.loadClass(converterForClass,
                                                    this.getClass());
                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   MessageFormat.format(
                                        "[Converter for Class] Calling Application.addConverter({0}, {1}",
                                        converterForClass,
                                        converterClass));
                    }
                    if (verifier != null) {
                        verifier.validateObject(Verifier.ObjectType.CONVERTER,
                                converterClass,
                                Converter.class);
                    }
                    application.addConverter(cfcClass, converterClass);
                } catch (ClassNotFoundException cnfe) {
View Full Code Here

    private void addBehaviors(NodeList behaviors, String namespace)
    throws XPathExpressionException {

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

            NodeList children = ((Element) behavior)
                 .getElementsByTagNameNS(namespace, "*");
            String behaviorId = null;
            String behaviorClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (n.getNodeType() == Node.ELEMENT_NODE) {
                    if (BEHAVIOR_ID.equals(n.getLocalName())) {
                        behaviorId = getNodeText(n);
                    } else if (BEHAVIOR_CLASS.equals(n.getLocalName())) {
                        behaviorClass = getNodeText(n);
                    }
                }
            }

            if (behaviorId != null && behaviorClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "Calling Application.addBehavior({0},{1})",
                                    behaviorId,
                                    behaviorClass));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.BEHAVIOR,
                                            behaviorClass,
                                            Behavior.class);
                }
                app.addBehavior(behaviorId, behaviorClass);
            }
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

    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 addConverters(NodeList converters, String namespace) {

        Application application = getApplication();
        Verifier verifier = Verifier.getCurrentInstance();
        for (int i = 0, size = converters.getLength(); i < size; i++) {
            Node converter = converters.item(i);
            NodeList children = ((Element) converter)
                 .getElementsByTagNameNS(namespace, "*");
            String converterId = null;
            String converterClass = null;
            String converterForClass = null;
            for (int c = 0, csize = children.getLength(); c < csize; c++) {
                Node n = children.item(c);
                if (CONVERTER_ID.equals(n.getLocalName())) {
                    converterId = getNodeText(n);
                } else if (CONVERTER_CLASS.equals(n.getLocalName())) {
                    converterClass = getNodeText(n);
                } else if (CONVERTER_FOR_CLASS.equals(n.getLocalName())) {
                    converterForClass = getNodeText(n);
                }
            }

            if (converterId != null && converterClass != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                               MessageFormat.format(
                                    "[Converter by ID] Calling Application.addConverter({0}, {1}",
                                    converterId,
                                    converterClass));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.CONVERTER,
                                            converterClass,
                                            Converter.class);
                }
                application.addConverter(converterId, converterClass);
            } else if (converterClass != null && converterForClass != null) {
                try {
                    Class cfcClass = Util.loadClass(converterForClass,
                                                    this.getClass());
                    if (LOGGER.isLoggable(Level.FINE)) {
                        LOGGER.log(Level.FINE,
                                   MessageFormat.format(
                                        "[Converter for Class] Calling Application.addConverter({0}, {1}",
                                        converterForClass,
                                        converterClass));
                    }
                    if (verifier != null) {
                        verifier.validateObject(Verifier.ObjectType.CONVERTER,
                                converterClass,
                                Converter.class);
                    }
                    application.addConverter(cfcClass, converterClass);
                } catch (ClassNotFoundException cnfe) {
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));
                }
                if (verifier != null) {
                    verifier.validateObject(Verifier.ObjectType.VALIDATOR,
                                            validatorClass,
                                            Validator.class);
                }
                app.addValidator(validatorId, validatorClass);
            }
View Full Code Here

    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

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.