.getInstance(facesContext.getExternalContext()) .getClientValidatorsRegistry();
.getInstance(facesContext).getClientValidatorsRegistry();
    private void appendValidators(FacesContext facesContext,            IHtmlWriter writer, Validator[] validators) throws WriterException {        IClientValidatorsRegistry clientValidatorManager = RcfacesContext                .getInstance(facesContext.getExternalContext())                .getClientValidatorsRegistry();        if (clientValidatorManager == null) {            throw new FacesException(                    "Can not get validator registry from faces context !");        }        IRenderContext renderContext = writer.getComponentRenderContext()                .getRenderContext();        List vls = null;        int expressionsLength = 0;        for (int i = 0; i < validators.length; i++) {            Validator validator = validators[i];            String expression = null;            if (validator instanceof IClientValidator) {                IClientValidator clientValidator = (IClientValidator) validator;                expression = clientValidator.getExpression();            } else {                expression = clientValidatorManager                        .convertFromValidatorToExpression(renderContext,                                validator);            }            if (expression == null || expression.length() < 1) {                continue;            }            if (vls == null) {                vls = new ArrayList(validators.length - i);            }            vls.add(expression);            expressionsLength += expression.length();        }        if (vls == null) {            return;        }        StringAppender sa = new StringAppender(expressionsLength + vls.size()                * 8);        for (Iterator it = vls.iterator(); it.hasNext();) {            String expression = (String) it.next();            if (sa.length() > 0) {                sa.append('|');            }            EventsRenderer.appendCommand(sa, expression);        }        writer.writeAttribute("v:validators", sa.toString());    }