}
@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);