* @inheritDoc
* @param node markup
* @param target child config bean
*/
protected void addValidator(Node node, ElementBean target) {
ValidatorBean targetValidator = new ValidatorBean();
//make sure we have the correct jsfid based on the namespace prefix
Builder tmpBuilder = getBuilder(node);
ElementBean tmp = tmpBuilder.createElement(node);
String jsfid = tmp.getJsfid();
targetValidator.setJsfid(jsfid);
String validatorId = (String) node.getAttributes().get("validatorId");
if (validatorId != null) {
targetValidator.setComponentType(tagsUtil.evalString(validatorId));
}
// resolve inheritance and attribute overrides
if (node.getAttributes().containsKey("extends") || !jsfid.equals("validator")) {
realizeComponent(node, targetValidator);
}
//attach to the target element
target.addValidator(targetValidator);
if (node.getName().equals("commonsValidator")) {
//You can use multiple commonsValidators per component. The
//jsfid is the key in the ComponentBean's validator set.
//Override with the unique type attribute
String type = (String) node.getAttributes().get("type");
targetValidator.setJsfid((String) validatorsByType.get(type));
//add support for the validatorVar JSP tag.
addValidatorVar(node, targetValidator);
}