• Spring的meta标签


    Spring的解析源码

        public void parseMetaElements(Element ele, BeanMetadataAttributeAccessor attributeAccessor) {
            //获取当前节点的所有子元素
         NodeList nl
    = ele.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); //提取meta
           if (isCandidateElement(node) && nodeNameEquals(node, META_ELEMENT)) { Element metaElement = (Element) node; String key = metaElement.getAttribute(KEY_ATTRIBUTE); String value = metaElement.getAttribute(VALUE_ATTRIBUTE); //使用key、value构造BeanMetadataAttribute
              BeanMetadataAttribute attribute
    = new BeanMetadataAttribute(key, value); attribute.setSource(extractSource(metaElement)); //记录信息
              attributeAccessor.addMetadataAttribute(attribute); } } }

    meta属性的使用

    <meta key="special-data" value="sprecial stragey" />  

    BeanDefinition bd;

    String beanCategoriesExpression = (String)bd.getAttribute(CATEGORY_META_KEY);

  • 相关阅读:
    react组件销毁中清理异步操作和取消请求
    只要一行代码,实现五种 CSS 经典布局
    vue中如何安装sass,sass安装命令
    每日总结
    每日总结
    每日总结
    每周总结
    每日总结
    每日总结
    每日总结
  • 原文地址:https://www.cnblogs.com/wade-luffy/p/6068291.html
Copyright © 2020-2023  润新知