protected boolean isValidType(Class<?> type, Annotation[] classAnnotations) {
        if (type == null) {
            return false;
        }

        if (clazzes != null) {
            for (Class<?> cls : clazzes) { // must strictly equal. Don't check
                // inheritance
                if (cls == type) {
                    return true;
                }
            }

            return false;
        }

        return true;
    }
Check whether a class can be serialized or deserialized. It can check
based on packages, annotations on entities or explicit classes.

@param type class need to check
@return true if valid
fastjson1-compatible/src/main/java/com/alibaba/fastjson/support/jaxrs/FastJsonProvider.java