add: значение аттбибута как список

This commit is contained in:
2024-02-28 17:42:33 +03:00
parent 791861b21a
commit 1b441c0a8d
2 changed files with 9 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ compileJava {
}
group = "ru.di9"
version = "1.2"
version = "1.2.1"
repositories {
mavenLocal()

View File

@@ -80,6 +80,14 @@ public class XmlElement implements Iterable<XmlElement> {
}
}
public List<String> getAttributeAsListString(String key) {
if (element.hasAttribute(key)) {
return Arrays.asList(element.getAttribute(key).split(","));
} else {
return Collections.emptyList();
}
}
@Override
public Iterator<XmlElement> iterator() {
return new XmlElementIterator(element.getChildNodes());