@Trivial
    public static String doValidate(String value, ValueType valueType) {
        String vMsg = null;

        switch (valueType) {
            case VT_CLASS_RESOURCE:
                if (value.contains("\\")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH";
                } else if (!value.endsWith(".class")) {
                    vMsg = "ANNO_UTIL_EXPECTED_CLASS";
                }
                break;

            case VT_CLASS_REFERENCE:
                if (value.contains("\\")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH";
                } else if (value.endsWith(".class")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_CLASS";
                }
                break;

            case VT_CLASS_NAME:
                if (value.contains("\\")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH";
                } else if (value.contains("/")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH";
                } else if (value.endsWith(".class")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_CLASS";
                }
                break;

            case VT_FIELD_NAME:
                if (value.contains("\\")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH";
                } else if (value.contains("/")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH";
                } else if (value.endsWith(".class")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_CLASS";
                }
                break;

            case VT_METHOD_NAME:
                if (value.contains("\\")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH";
                } else if (value.contains("/")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH";
                } else if (value.endsWith(".class")) {
                    vMsg = "ANNO_UTIL_UNEXPECTED_CLASS";
                }
                break;

            case VT_OTHER:
                break;

            default:
                vMsg = "ANNO_UTIL_UNRECOGNIZED_TYPE";
                break;
        }

        return vMsg;
    }
@ Trivial public static String doValidate ( String value , ValueType valueType ) { String vMsg = null ; switch ( valueType ) { case VT_CLASS_RESOURCE : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( ! value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_EXPECTED_CLASS" ; } break ; case VT_CLASS_REFERENCE : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_CLASS_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_FIELD_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_METHOD_NAME : if ( value . contains ( "\\" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_BACKSLASH" ; } else if ( value . contains ( "/" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_FORWARD_SLASH" ; } else if ( value . endsWith ( ".class" ) ) { vMsg = "ANNO_UTIL_UNEXPECTED_CLASS" ; } break ; case VT_OTHER : break ; default : vMsg = "ANNO_UTIL_UNRECOGNIZED_TYPE" ; break ; } return vMsg ; }
/*
Validate a string against a value type. Answer null if the string is
valid. Answer a message ID describing the validation failure if the
string is not valid for the value type.

@return Null for a valid value; a non-null message ID for a non-valid value.