/** * Prepares the style attributes for inclusion in the component's HTML tag. * @return The prepared String for inclusion in the HTML tag. * @exception JspException if invalid attributes are specified */ protected String prepareStyles() throws JspException { StringBuffer styles = new StringBuffer(); boolean errorsExist = doErrorsExist(); if (errorsExist && getErrorStyleId() != null) { prepareAttribute(styles , "id", getErrorStyleId()); } else { prepareAttribute(styles , "id", getStyleId()); } if (errorsExist && getErrorStyle() != null) { prepareAttribute(styles , "style", getErrorStyle()); } else { prepareAttribute(styles , "style", getStyle()); } if (errorsExist && getErrorStyleClass() != null) { prepareAttribute(styles , "class", getErrorStyleClass()); } else { prepareAttribute(styles , "class", getStyleClass()); } prepareAttribute(styles , "title", message(getTitle(), getTitleKey())); prepareAttribute(styles , "alt", message(getAlt(), getAltKey())); return styles.toString(); }