| | |
| | | this.parserData = parserData; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // String data = "{id=[1,2,3], page=1, limit=5, field=art}"; |
| | | // Articles articles = new AttrNode().parserTag(data, Articles.class); |
| | | |
| | | // String value = "{id=${col.id}, page=1, limit=5, field=art}"; |
| | | // String pattern = "(?<=\\$\\{)[\\s\\S]*?(?=\\})"; |
| | | // Matcher matcher = Pattern.compile(pattern).matcher(value); |
| | | // while (matcher.find()) { |
| | | // String group = matcher.group(); |
| | | // System.out.println(1); |
| | | // } |
| | | |
| | | |
| | | System.out.println(1); |
| | | } |
| | | |
| | | private boolean isNeedEmpty() { |
| | | Elements children = this.element.children(); |
| | | if (CollUtil.isNotEmpty(children)) { |
| | |
| | | i++; |
| | | |
| | | try { |
| | | Template.TAGS.add(tagsEnum.getName()); |
| | | // {id=${col.id}, page=1, limit=5, field=art} ${col.id} 形式需先设置值 |
| | | String tagValue = attributes.get(tagsEnum.getName()); |
| | | tagValue = attrValueFormat(tagValue); |
| | |
| | | public void runDataInject() { |
| | | Attributes attributes = this.element.attributes(); |
| | | for (Attribute attribute : attributes) { |
| | | if (attribute.getKey().startsWith("\\$")) { |
| | | Template.TAGS.add(attribute.getKey()); |
| | | } |
| | | |
| | | String key = attribute.getKey().replaceAll("\\$", ""); |
| | | String value = attribute.getValue(); |
| | | |
| | |
| | | this.element.removeAttr("class"); |
| | | this.element.attr("class", evaluate); |
| | | } else if (value.contains( "${")) { |
| | | |
| | | String result = attrValueFormat(value); |
| | | System.out.println(result); |
| | | if ("text".equals(key)) { |
| | | this.element.text(result); |
| | | } else { |