Skip to content

Commit 3909ae5

Browse files
committed
Updated for Java 21 and added Elemeng.getHead() and Element.getTail()
1 parent ce99c62 commit 3909ae5

5 files changed

Lines changed: 23 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Features in development:
1616

1717
## Building
1818

19-
You need Java 17 and [Apache Ant 1.10.12](https://ant.apache.org) or newer
19+
You need Java 21 and [Apache Ant 1.10.14](https://ant.apache.org) or newer
2020

21-
- Point your JAVA_HOME variable to JDK 17
21+
- Point your JAVA_HOME variable to JDK 21
2222
- Checkout this repository
2323
- Run `ant` to compile the source code
2424

lib/xmljava.jar

74 Bytes
Binary file not shown.

src/com/maxprograms/xml/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
public class Constants {
1616

17-
public static final String VERSION = "1.4.0";
18-
public static final String BUILD = "20231113_1047";
17+
public static final String VERSION = "1.5.0";
18+
public static final String BUILD = "20231214_1946";
1919
}

src/com/maxprograms/xml/Element.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,25 @@ public void setText(String text) {
334334
content.add(new TextNode(text));
335335
}
336336

337+
public String getHead() {
338+
StringBuilder result = new StringBuilder("<" + name);
339+
List<String> keys = new Vector<>();
340+
keys.addAll(attsTable.keySet());
341+
Collections.sort(keys);
342+
Iterator<String> it = keys.iterator();
343+
while (it.hasNext()) {
344+
Attribute a = attsTable.get(it.next());
345+
result.append(' ');
346+
result.append(a.toString());
347+
}
348+
result.append(">");
349+
return result.toString();
350+
}
351+
352+
public String getTail() {
353+
return "</" + name + ">";
354+
}
355+
337356
@Override
338357
public String toString() {
339358
StringBuilder result = new StringBuilder("<" + name);

src/module-info.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
exports com.maxprograms.xml;
1313

14-
opens com.maxprograms.xml to mapdb;
15-
1614
requires java.base;
1715
requires transitive java.xml;
1816
}

0 commit comments

Comments
 (0)