Returns true only if a valid combination of attributes
is specified:
value |
stringValue [ pattern ] |
param [ pattern ] |
name property [ pattern ]
boolean isValid = false;
Object value = data.getAttribute("value");
Object stringValue = data.getAttribute("stringValue");
Object pattern = data.getAttribute("pattern");
Object param = data.getAttribute("param");
Object name = data.getAttribute("name");
Object property = data.getAttribute("property");
if (value != null &&
(stringValue == null && param == null && pattern == null &&
name == null && property == null)) {
isValid = true;
}
else if (stringValue != null &&
(value == null && param == null && name == null &&
property == null)) {
isValid = true;
}
else if (param != null &&
(value == null && stringValue == null && name == null &&
property == null)) {
isValid = true;
}
else if (name != null &&
(value == null && stringValue == null && param == null &&
property != null)) {
isValid = true;
}
return isValid;