X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api%2Fsrc%2Forg%2Fargeo%2Fapi%2Fgcr%2FContent.java;h=9ce6ea4f6b3f70f4add3ac5895c5e603523622de;hb=51efb630db7314b67654a03d1bd983b45aa2f1ed;hp=b032aa7b888020dce1779b34d0434ee36613fd28;hpb=8767858f1fca02ea7c53ca244f6c1fa745d91ac4;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.api/src/org/argeo/api/gcr/Content.java b/org.argeo.api/src/org/argeo/api/gcr/Content.java index b032aa7b8..9ce6ea4f6 100644 --- a/org.argeo.api/src/org/argeo/api/gcr/Content.java +++ b/org.argeo.api/src/org/argeo/api/gcr/Content.java @@ -9,17 +9,32 @@ public interface Content extends Iterable, Map { String getName(); -// Iterable keys(); + String getPath(); - A get(String key, Class clss); + Content getParent(); -// ContentSession getSession(); + /* + * ATTRIBUTES OPERATIONS + */ + + A get(String key, Class clss) throws IllegalArgumentException; + + /* + * CONTENT OPERATIONS + */ + Content add(String name, ContentName... classes); + + void remove(); /* * DEFAULT METHODS */ - default A adapt(Class clss) { - return null; + default A adapt(Class clss) throws IllegalArgumentException { + throw new IllegalArgumentException("Cannot adapt content " + this + " to " + clss.getName()); + } + + default C open(Class clss) throws Exception, IllegalArgumentException { + throw new IllegalArgumentException("Cannot open content " + this + " as " + clss.getName()); } /*