private static String generate(final String rule, final MockRequest mockRequest) {
        final Matcher matcher = RULE_CONTENT_PATTERN.matcher(rule);
        if (!matcher.find()) {
            return rule;
        }

        String ruleContent = matcher.group(1);
        String ruleName = ruleContent.split("\\|")[0];
        Generator<?> generator = newInstance(ruleName, rule);
        if (Objects.isNull(generator) || !generator.match(ruleContent)) {
            return rule;
        }

        String[] prefixAndSuffix = generator.getPrefixAndSuffix();
        try {
            Object generateData = generator.generate(ruleContent, mockRequest);
            return String.join("", prefixAndSuffix[0], generateData.toString(), prefixAndSuffix[1]);
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            return rule;
        }
    }
New instance mock data generator.

@param ruleName rule name
@param rule     full rule content
@return generator
shenyu-plugin/shenyu-plugin-mock/src/main/java/org/apache/shenyu/plugin/mock/generator/GeneratorFactory.java