FileDocCategorySizeDatePackage
ValueTagExtraInfo.javaAPI DocExample1784Thu Jun 28 16:14:16 BST 2001com.ora.jsp.tags.sql.value

ValueTagExtraInfo

public class ValueTagExtraInfo extends TagExtraInfo
This class provides additional attribute validation code for ValueTag subclasses.
author
Hans Bergsten, Gefion software
version
1.0

Fields Summary
Constructors Summary
Methods Summary
public booleanisValid(TagData data)
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;