Package org.apache.shale.clay.config.beans

Examples of org.apache.shale.clay.config.beans.ValidatorBean


     *
     * @param node markup
     * @param target child config bean
     */
    protected void addValidator(Node node, ElementBean target) {
       ValidatorBean targetValidator = new ValidatorBean();

       String jsfid = getJsfid(node);
       targetValidator.setJsfid(jsfid);

       // resolve inheritance and attribute overrides
       realizeComponent(node, targetValidator);
       //attach to the target element
       target.addValidator(targetValidator);
View Full Code Here


     * @inheritDoc
     * @param node markup
     * @param target child config bean
     */
    protected void addValidator(Node node, ElementBean target) {
        ValidatorBean targetValidator = new ValidatorBean();

        //make sure we have the correct jsfid based on the namespace prefix
        Builder tmpBuilder = getBuilder(node);
        ElementBean tmp = tmpBuilder.createElement(node);

        String jsfid = tmp.getJsfid();
        targetValidator.setJsfid(jsfid);

        String validatorId = (String) node.getAttributes().get("validatorId");
        if (validatorId != null) {
            targetValidator.setComponentType(tagsUtil.evalString(validatorId));
        }

        // resolve inheritance and attribute overrides
        if (node.getAttributes().containsKey("extends") || !jsfid.equals("validator")) {
            realizeComponent(node, targetValidator);
        }

        //attach to the target element
        target.addValidator(targetValidator);

        if (node.getName().equals("commonsValidator")) {
            //You can use multiple commonsValidators per component.  The
            //jsfid is the key in the ComponentBean's validator set.
            //Override with the unique type attribute
            String type = (String) node.getAttributes().get("type");
            targetValidator.setJsfid((String) validatorsByType.get(type));

            //add support for the validatorVar JSP tag.
            addValidatorVar(node, targetValidator);
        }

View Full Code Here

        if (displayElement.getValidators().size() > 0) {
            if (child instanceof EditableValueHolder) {

                Iterator vi = displayElement.getValidatorIterator();
                while (vi.hasNext()) {
                    ValidatorBean validator = (ValidatorBean) vi.next();

                    ClayContext subContext = (ClayContext) clayContext.clone();
                    subContext.setDisplayElement(validator);
                    subContext.setParent(child);
View Full Code Here

TOP

Related Classes of org.apache.shale.clay.config.beans.ValidatorBean

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.