String getName();
-// Iterable<String> keys();
+ String getPath();
- <A> A get(String key, Class<A> clss);
+ Content getParent();
-// ContentSession getSession();
+ /*
+ * ATTRIBUTES OPERATIONS
+ */
+
+ <A> A get(String key, Class<A> clss) throws IllegalArgumentException;
+
+ /*
+ * CONTENT OPERATIONS
+ */
+ Content add(String name, ContentName... classes);
+
+ void remove();
/*
* DEFAULT METHODS
*/
- default <A> A adapt(Class<A> clss) {
- return null;
+ default <A> A adapt(Class<A> clss) throws IllegalArgumentException {
+ throw new IllegalArgumentException("Cannot adapt content " + this + " to " + clss.getName());
+ }
+
+ default <C extends AutoCloseable> C open(Class<C> clss) throws Exception, IllegalArgumentException {
+ throw new IllegalArgumentException("Cannot open content " + this + " as " + clss.getName());
}
/*