Examples of ConstraintField


Examples of com.sun.appserv.web.cache.mapping.ConstraintField

            name = fieldConfig.getAttributeValue(
                    org.glassfish.web.deployment.runtime.ConstraintField.NAME);
            scope = fieldConfig.getAttributeValue(
                    org.glassfish.web.deployment.runtime.ConstraintField.SCOPE);
            ConstraintField constraintField =
                                        new ConstraintField(name, scope);

            value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH);
            if (value != null)
                constraintField.setCacheOnMatch(ConfigBeansUtilities.toBoolean(value));

            value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH_FAILURE);
            if (value != null)
                constraintField.setCacheOnMatchFailure(
                                    ConfigBeansUtilities.toBoolean(value));


            // now set the value's and the match expressions
            for (int j = 0; j < fieldConfig.sizeValue(); j++) {
                value = fieldConfig.getValue(j).trim();
                expr = fieldConfig.getAttributeValue(
                        org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.MATCH_EXPR);
               
                ValueConstraint constraint = new ValueConstraint(value, expr);
                value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH);
                if (value != null) {
                    constraint.setCacheOnMatch(ConfigBeansUtilities.toBoolean(value));
                }
                value = fieldConfig.getAttributeValue(org.glassfish.web.deployment.runtime.ConstraintField.VALUE, j, org.glassfish.web.deployment.runtime.ConstraintField.CACHE_ON_MATCH_FAILURE);
                if (value != null) {
                    constraint.setCacheOnMatchFailure(
                                    ConfigBeansUtilities.toBoolean(value));
                }
                constraintField.addConstraint(constraint);

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, CONSTRAINT_ADDED, constraint.toString());
                }
            }

            mapping.addConstraintField(constraintField);

            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE,
                        CONSTRAINT_FIELD_ADDED,
                        new Object[]{
                                name,
                                scope,
                                constraintField.getCacheOnMatch(),
                                constraintField.getCacheOnMatchFailure()});
            }
        }
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.runtime.web.ConstraintField

  return dispatchTable;
    }

    public void startElement(XMLElement element, Attributes attributes) {
        if (element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD)) {
            ConstraintField descriptor =
                (ConstraintField) getRuntimeDescriptor();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.NAME,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.SCOPE,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        // From sun-web-app_2_3-0.dtd to sun-web-app_2_4-0.dtd,
        // the element name "value" is changed to "constraint-field-value",
        // need to make sure both will work
        } else if (element.getQName().equals(RuntimeTagNames.VALUE) ||
            element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD_VALUE)) {
            ConstraintField descriptor =
                (ConstraintField) getRuntimeDescriptor();
            int index = descriptor.sizeValue();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.MATCH_EXPR.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.MATCH_EXPR,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        } else super.startElement(element, attributes);
View Full Code Here

Examples of com.sun.enterprise.deployment.runtime.web.ConstraintField

  return dispatchTable;
    }

    public void startElement(XMLElement element, Attributes attributes) {
        if (element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD)) {
            ConstraintField descriptor =
                (ConstraintField) getRuntimeDescriptor();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.NAME,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.SCOPE,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        // From sun-web-app_2_3-0.dtd to sun-web-app_2_4-0.dtd,
        // the element name "value" is changed to "constraint-field-value",
        // need to make sure both will work
        } else if (element.getQName().equals(RuntimeTagNames.VALUE) ||
            element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD_VALUE)) {
            ConstraintField descriptor =
                (ConstraintField) getRuntimeDescriptor();
            int index = descriptor.sizeValue();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.MATCH_EXPR.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.MATCH_EXPR,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        } else super.startElement(element, attributes);
View Full Code Here

Examples of org.glassfish.web.deployment.runtime.ConstraintField

     * @return the descriptor instance to associate with this XMLNode
     */
    @Override
    public ConstraintField getDescriptor() {
        if (descriptor==null) {
            descriptor = new ConstraintField();
        }
        return descriptor;
    }
View Full Code Here

Examples of org.glassfish.web.deployment.runtime.ConstraintField

    }

    @Override
    public void startElement(XMLElement element, Attributes attributes) {
        if (element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD)) {
            ConstraintField descriptor = getDescriptor();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.NAME,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.SCOPE,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(
                        ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        // From sun-web-app_2_3-0.dtd to sun-web-app_2_4-0.dtd,
        // the element name "value" is changed to "constraint-field-value",
        // need to make sure both will work
        } else if (element.getQName().equals(RuntimeTagNames.VALUE) ||
            element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD_VALUE)) {
            ConstraintField descriptor = getDescriptor();
            int index = descriptor.sizeValue();
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.MATCH_EXPR.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.MATCH_EXPR,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH,
                        attributes.getValue(i));
                } else
                if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
                    attributes.getQName(i))) {
                    descriptor.setAttributeValue(ConstraintField.VALUE,
                        index, ConstraintField.CACHE_ON_MATCH_FAILURE,
                        attributes.getValue(i));
                }
            }
        } else super.startElement(element, attributes);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.