@SuppressWarnings("unchecked")
    static <T> T parseObject(char[] chars, Class<T> clazz) {
        if (chars == null || chars.length == 0) {
            return null;
        }

        final JSONReader.Context context = JSONFactory.createReadContext();
        final ObjectReader<T> objectReader = context.getObjectReader(clazz);

        try (JSONReader reader = JSONReader.of(chars, context)) {
            T object = objectReader.readObject(reader, clazz, null, 0);
            if (reader.resolveTasks != null) {
                reader.handleResolveTasks(object);
            }
            if (reader.ch != EOI && (context.features & IgnoreCheckClose.mask) == 0) {
                throw new JSONException(reader.info("input not end"));
            }
            return object;
        }
    }
Parses the json char array as {@link T}. Returns
{@code null} if received char array is {@code null} or empty.

@param chars the specified char array to be parsed
@param clazz the specified class of {@link T}
@return {@link T} or {@code null}
@throws JSONException If a parsing error occurs
core/src/main/java/com/alibaba/fastjson2/JSON.java