Package juzu.impl.plugin.asset

Examples of juzu.impl.plugin.asset.AssetsMetaModel


    return Collections.<Class<? extends java.lang.annotation.Annotation>>singleton(Less.class);
  }

  @Override
  public void processAnnotationAdded(ApplicationMetaModel metaModel, AnnotationKey key, AnnotationState added) {
    AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
    List<LessAsset> assets = getAssets(assetsMetaModel, added);
    for (LessAsset asset : assets) {
      assetsMetaModel.addAsset(asset);
    }
  }
View Full Code Here


    }
  }

  @Override
  public void processAnnotationRemoved(ApplicationMetaModel metaModel, AnnotationKey key, AnnotationState removed) {
    AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
    List<LessAsset> assets = getAssets(assetsMetaModel, removed);
    for (LessAsset asset : assets) {
      assetsMetaModel.removeAsset(asset);
    }
  }
View Full Code Here

  }

  @Override
  public void processAnnotationRemoved(ApplicationMetaModel metaModel, AnnotationKey key, AnnotationState removed) {
    Name pkg = key.getElement().getPackageName();
    AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
    for (Map.Entry<String, URL> entry : getAssets(metaModel, removed).entrySet()) {
      assetsMetaModel.removeResource(entry.getKey(), entry.getValue());

    }
  }
View Full Code Here

    if (metaModel.getHandle().equals(key.getElement())) {
      List<Map<String, Serializable>> value = (List<Map<String, Serializable>>)added.get("value");
      Integer maxAge = (Integer)added.get("maxAge");

      //
      AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
      assetsMetaModel.removeAssets("module");
      ArrayList<Asset> list = new ArrayList<Asset>();
      for (Map<String, Serializable> a : value) {
        HashMap<String, Serializable> asset = new HashMap<String, Serializable>(a);
        if (asset.get("location") == null) {
          asset.put("location", AssetLocation.APPLICATION.name());
        }
        if (asset.get("maxAge") == null && maxAge != null) {
          asset.put("maxAge", maxAge);
        }
        if (asset.get("id") == null) {
          asset.put("id", asset.get("value"));
        }
        List<String> aliases = (List<String>)a.get("aliases");
        String adapter = (String)a.get("adapter");
        list.add(new ModuleAsset(asset, adapter, aliases));
      }

      //
      for (Asset asset : list) {
        assetsMetaModel.addAsset(asset);
      }

      //
      assetsMetaModel.addAsset(REQUIRE_JS);
    }
  }
View Full Code Here

  }

  @Override
  public void processAnnotationRemoved(ApplicationMetaModel metaModel, AnnotationKey key, AnnotationState removed) {
    if (metaModel.getHandle().equals(key.getElement())) {
      AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
      assetsMetaModel.removeAssets("module");
      assetsMetaModel.removeAsset(REQUIRE_JS);
    }
  }
View Full Code Here

  }
 
  @Override
  public void processAnnotationAdded(ApplicationMetaModel metaModel, AnnotationKey key, AnnotationState added) {
    Name pkg = key.getElement().getPackageName();
    AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
    for (Map.Entry<String, URL> entry : getAssets(metaModel, added).entrySet()) {
      assetsMetaModel.addResource(entry.getKey(), entry.getValue());

    }
  }
View Full Code Here

TOP

Related Classes of juzu.impl.plugin.asset.AssetsMetaModel

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.