@@ -0,0 +1,1310 @@
+package magic.data;%0A%0Aimport magic.Keywords;%0A%0A/**%0A * Class to represent a metadata declaration as data%0A * @author Mike%0A *%0A */%0Apublic class MetaData %7B%0A%0A%09private IPersistentMap%3CKeyword,Object%3E meta;%0A%0A%09public MetaData(IPersistentMap%3CKeyword,Object%3E meta) %7B%0A%09%09this.meta=meta;%0A%09%7D%0A%09%0A%09public IPersistentMap%3CKeyword,Object%3E meta() %7B%0A%09%09return meta;%0A%09%7D%0A%0A%09@SuppressWarnings(%22unchecked%22)%0A%09public static MetaData create(IPersistentMap%3C?, ?%3E meta) %7B%0A%09%09return new MetaData((IPersistentMap%3CKeyword, Object%3E) meta);%0A%09%7D%0A%0A%09/**%0A%09 * Create a metadata object with a keyword value set to true%0A%09 * @param key%0A%09 * @return%0A%09 */%0A%09public static MetaData create(magic.data.Keyword key) %7B%0A%09%09return create(key,Boolean.TRUE);%0A%09%7D%0A%0A%09public static MetaData create(Keyword key, Object val) %7B%0A%09%09return new MetaData(PersistentHashMap.create(key, val));%0A%09%7D%0A%09%0A%09/**%0A%09 * Creates a metadata object according to the following rule:%0A%09 * - Map -%3E unchanged%0A%09 * - Keyword -%3E %7B:keyword true%7D%0A%09 * - Any other expression -%3E %7B:tag expression%7D%0A%09 * %0A%09 * @param node%0A%09 * @return%0A%09 */%0A%09public MetaData interpretMetadata(Object node) %7B%0A%09%09if (node instanceof IPersistentMap) return MetaData.create((IPersistentMap%3C?,?%3E)node);%0A%09%09if (node instanceof magic.data.Keyword) return MetaData.create((magic.data.Keyword)node);%0A%09%09return MetaData.create(Keywords.TAG,node);%0A%09%7D%0A%7D%0A

Add MetaData class