public boolean validarCedula() {

        String numCedula = cliente.getCedula();

        boolean cedulaCorrecta = false;

        try {

            if (numCedula.trim().length() == 10) {
                int tercerDigito = Integer.parseInt(numCedula.substring(2, 3));
                if (tercerDigito < 6) {

                    int[] coefValCedula = {2, 1, 2, 1, 2, 1, 2, 1, 2};
                    int verificador = Integer.parseInt(numCedula.substring(9, 10));
                    int suma = 0;
                    int digito = 0;
                    for (int i = 0; i < (numCedula.length() - 1); i++) {
                        digito = Integer.parseInt(numCedula.substring(i, i + 1)) * coefValCedula[i];
                        suma += ((digito % 10) + (digito / 10));
                    }

                    if ((suma % 10 == 0) && (suma % 10 == verificador)) {
                        cedulaCorrecta = true;
                    } else if ((10 - (suma % 10)) == verificador) {
                        cedulaCorrecta = true;
                    } else {
                        cedulaCorrecta = false;
                    }
                } else {
                    cedulaCorrecta = false;
                }
            } else {
                if (numCedula.trim().length() == 13) {
                    cedulaCorrecta = true;
                } else {
                    cedulaCorrecta = false;
                }
            }
        } catch (NumberFormatException nfe) {
            cedulaCorrecta = false;
        } catch (Exception err) {
            cedulaCorrecta = false;
        }

        return cedulaCorrecta;
    }