From c49dd989ed6afddefb546672a17ec6745698edc9 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 07 Jul 2022 11:07:52 +0800
Subject: [PATCH] 20220606
---
src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java | 23 +++++------------------
1 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java b/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
index ebf2177..b11eae9 100644
--- a/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
+++ b/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
@@ -52,22 +52,6 @@
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)) {
@@ -112,6 +96,7 @@
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);
@@ -139,6 +124,10 @@
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();
@@ -158,9 +147,7 @@
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 {
--
Gitblit v1.9.1