class ServiceDefinitionParser extends AbstractContractDefinitionParser {
    public static final String REF     = "ref";
    public static final String BEAN_ID = "beanId";

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

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

    @Override
    protected String resolveId(Element element, AbstractBeanDefinition definition,
                               ParserContext parserContext) throws BeanDefinitionStoreException {
        return SofaBeanNameGenerator.generateSofaServiceBeanName(definition);
    }

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

        String ref = element.getAttribute(REF);
        builder.addPropertyReference(REF, ref);
        if (element.hasAttribute("id")) {
            String id = element.getAttribute("id");
            builder.addPropertyValue(BEAN_ID, id);
        } else {
            builder.addPropertyValue(BEAN_ID, ref);
        }
    
<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