Package org.yaac.shared.crud

Examples of org.yaac.shared.crud.MetaNamespace


    Map<String, MetaNamespace> namespacesMap = new HashMap<String, MetaNamespace>();
   
    // step 1 : populate kinds
    for (String namespaceName : kindsMap.keySet()) {
      for (Entity kindEntity : kindsMap.get(namespaceName)) {       
        MetaNamespace namespace = namespacesMap.get(namespaceName);
        if (namespace == null) {
          namespace = new MetaNamespace(namespaceName);
          namespacesMap.put(namespaceName, namespace);
        }
       
        String kindName = kindEntity.getKey().getName();
        namespace.getKindsMap().put(kindName, new MetaKind(kindName));       
      }
    }
   
    // step 2 : populate properties map
    for (String namespaceName : propertiesMap.keySet()) {
      for (Entity propertyEntity : propertiesMap.get(namespaceName)) {
        Key propertyKey = propertyEntity.getKey();
        Key kindKey = propertyKey.getParent();
       
        @SuppressWarnings("unchecked")
        List<String> representation =
          (List<String>) propertyEntity.getProperty(PROPERTY_REPRESENTATION);
       
        MetaNamespace namespace = namespacesMap.get(namespaceName);
        if (namespace == null) {
          throw new IllegalArgumentException("unknown namespace " + namespaceName);
        }
       
        MetaKind kind = namespace.getKindsMap().get(kindKey.getName());
        if (kind == null) {
          throw new IllegalArgumentException("unknown kind " + kindKey.getName());
        }
       
        kind.addProperty(propertyKey.getName(), representation);
View Full Code Here

TOP

Related Classes of org.yaac.shared.crud.MetaNamespace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.