class ReferenceDefinitionParser extends AbstractContractDefinitionParser {
    public static final String JVM_FIRST             = "jvm-first";
    public static final String PROPERTY_JVM_FIRST    = "jvmFirst";
    public static final String PROPERTY_LOAD_BALANCE = "loadBalance";
    public static final String REQUIRED              = "required";

    @Override
    protected void doParseInternal(Element element, ParserContext parserContext,
                                   BeanDefinitionBuilder builder) {<FILL_FUNCTION_BODY>}

    @Override
    protected Class getBeanClass(Element element) {
        return ReferenceFactoryBean.class;
    }

    @Override
    public String supportTagName() {
        return "reference";
    }

    protected Class getInterfaceClass(String interfaceType) {
        try {
            return Thread.currentThread().getContextClassLoader().loadClass(interfaceType);
        } catch (Throwable t) {
            throw new IllegalArgumentException("Failed to load class for interface: "
                                               + interfaceType, t);
        }
    }
}

        String jvmFirstString = element.getAttribute(JVM_FIRST);

        if (StringUtils.hasText(jvmFirstString)) {
            if ("true".equalsIgnoreCase(jvmFirstString)) {
                builder.addPropertyValue(PROPERTY_JVM_FIRST, true);
            } else if ("false".equalsIgnoreCase(jvmFirstString)) {
                builder.addPropertyValue(PROPERTY_JVM_FIRST, false);
            } else {
                throw new RuntimeException(
                    "Invalid value of property jvm-first, can only be true or false.");
            }
        }

        String loadBalance = element.getAttribute(PROPERTY_LOAD_BALANCE);
        if (StringUtils.hasText(loadBalance)) {
            builder.addPropertyValue(PROPERTY_LOAD_BALANCE, loadBalance);
        }

        String required = element.getAttribute(REQUIRED);
        if (StringUtils.hasText(required)) {
            if ("true".equalsIgnoreCase(required)) {
                builder.addPropertyValue(REQUIRED, true);
            } else if ("false".equalsIgnoreCase(required)) {
                builder.addPropertyValue(REQUIRED, false);
            } else {
                throw new RuntimeException(
                    "Invalid value of property required, can only be true or false.");
            }
        }

        String interfaceType = element.getAttribute(INTERFACE_ELEMENT);
        builder.getBeanDefinition().setAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE,
            getInterfaceClass(interfaceType));
    
<methods>public non-sealed void <init>() <variables>public static final java.lang.String BEAN_ID_ELEMENT,public static final java.lang.String BEAN_ID_PROPERTY,public static final java.lang.String BINDINGS,public static final java.lang.String BINDING_ADAPTER_FACTORY,public static final java.lang.String BINDING_CONVERTER_FACTORY,public static final java.lang.String DEFINITION_BUILDING_API_TYPE,public static final java.lang.String ELEMENTS,public static final java.lang.String INTERFACE_CLASS_PROPERTY,public static final java.lang.String INTERFACE_ELEMENT,public static final java.lang.String INTERFACE_PROPERTY,public static final java.lang.String REPEAT_REFER_LIMIT_ELEMENT,public static final java.lang.String REPEAT_REFER_LIMIT_PROPERTY,public static final java.lang.String SOFA_RUNTIME_CONTEXT,public static final java.lang.String UNIQUE_ID_ELEMENT,public static final java.lang.String UNIQUE_ID_PROPERTY