X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api.acr%2Fsrc%2Forg%2Fargeo%2Fapi%2Facr%2FContent.java;h=df5c149e6fc1fc696187d197766ad5f9cf0c2c52;hb=87982f6676d89d5945e5e1371b4d254f2d032e9f;hp=865705f64cde265bfc08dbb8862a91f526a4429a;hpb=9ece61bb03dd788ac5f2e26ef33c0b4e3859d4d9;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.api.acr/src/org/argeo/api/acr/Content.java b/org.argeo.api.acr/src/org/argeo/api/acr/Content.java index 865705f64..df5c149e6 100644 --- a/org.argeo.api.acr/src/org/argeo/api/acr/Content.java +++ b/org.argeo.api.acr/src/org/argeo/api/acr/Content.java @@ -16,6 +16,8 @@ import javax.xml.namespace.QName; * A semi-structured content, with attributes, within a hierarchical structure. */ public interface Content extends Iterable, Map { + /** The base of a repository path. */ + String ROOT_PATH = "/"; QName getName(); @@ -208,6 +210,14 @@ public interface Content extends Iterable, Map { return res; } + default List children(QNamed name) { + return children(name.qName()); + } + + default Optional soleChild(QNamed name) { + return soleChild(name.qName()); + } + default Optional soleChild(QName name) { List res = children(name); if (res.isEmpty()) @@ -270,9 +280,9 @@ public interface Content extends Iterable, Map { /** * A content within this repository * - * @param path either an abolute path or a path relative to this content + * @param path either an absolute path or a path relative to this content */ - Content getContent(String path); + Optional getContent(String path); /* * EXPERIMENTAL UNSUPPORTED