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
extension-jaxrs/extension-jaxrs-jakarta/src/main/java/com/alibaba/fastjson2/support/jaxrs/jakarta/FastJson2Provider.java