gpt4 book ai didi

ro.isdc.wro.model.WroModel类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 15:19:05 25 4
gpt4 key购买 nike

本文整理了Java中ro.isdc.wro.model.WroModel类的一些代码示例,展示了WroModel类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WroModel类的具体详情如下:
包路径:ro.isdc.wro.model.WroModel
类名称:WroModel

WroModel介绍

[英]The resource model encapsulates the information about all existing groups.
[中]资源模型封装了关于所有现有组的信息。

代码示例

代码示例来源:origin: alexo/wro4j

public WroModel create() {
 return new WroModel();
}

代码示例来源:origin: alexo/wro4j

public WroModelInspector(final WroModel model) {
 Validate.notNull(model);
 for (final Group group : model.getGroups()) {
  map.put(group.getName(), group);
 }
}

代码示例来源:origin: alexo/wro4j

private void processImports(final Document document) {
 final NodeList importsList = document.getElementsByTagName(TAG_IMPORT);
 LOG.debug("number of imports: {}", importsList.getLength());
 for (int i = 0; i < importsList.getLength(); i++) {
  final Element element = (Element) importsList.item(i);
  final String name = element.getTextContent();
  LOG.debug("processing import: {}", name);
  Validate.notNull(locatorFactory, "The Locator cannot be null!");
  if (processedImports.contains(name)) {
   final String message = "Recursive import detected: " + name;
   LOG.error(message);
   throw new RecursiveGroupDefinitionException(message);
  }
  processedImports.add(name);
  model.merge(createImportedModel(name));
 }
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-web-resources-wro

@Override
public WroModel create() {
  WroModel model = new WroModel();
  WebResourceManager service = Framework.getService(WebResourceManager.class);
  ResourceContextImpl rcontext = new ResourceContextImpl();
  List<ResourceBundle> bundles = service.getResourceBundles();
  for (ResourceBundle bundle : bundles) {
    String groupName = bundle.getName();
    Group group = new Group(groupName);
    List<Resource> resources = service.getResources(rcontext, groupName, ResourceType.any.name());
    if (resources != null) {
      for (Resource resource : resources) {
        ro.isdc.wro.model.resource.Resource wr = toWroResource(groupName, resource);
        if (wr != null) {
          group.addResource(wr);
        }
      }
    }
    model.addGroup(group);
  }
  return model;
}

代码示例来源:origin: alexo/wro4j

if (!isAbstractGroup) {
 model.addGroup(group);

代码示例来源:origin: alexo/wro4j

/**
 * @param groups
 *          the groups to set
 */
public final WroModel setGroups(final Collection<Group> groups) {
 notNull(groups, "groups cannot be null!");
 LOG.debug("setGroups: {}", groups);
 identifyDuplicateGroupNames(groups);
 this.groups = new HashSet<Group>(groups);
 return this;
}

代码示例来源:origin: uk.ac.ebi.gxa/wro4j-tag

public Group getGroup(String name) {
    return model.getGroupByName(name);
  }
}

代码示例来源:origin: dragome/dragome-sdk

public WroModel create()
{
  Group dragomeGroup= new Group("dragome");
  dragomeGroup.addResource(Resource.create("/dragome-resources/js/hashtable.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/dragome-resources/js/deflate.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/dragome-resources/js/helpers.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/dragome-resources/js/string.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/dragome-resources/js/qx-oo-5.0.1.min.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/compiled-js/webapp.js", ResourceType.JS));
  dragomeGroup.addResource(Resource.create("/dragome-resources/css/dragome.css", ResourceType.CSS));
  Group compiledGroup= new Group("compiled");
  compiledGroup.addResource(Resource.create("/compiled-js/webapp.js", ResourceType.JS));
  WroModel wroModel= new WroModel();
  wroModel.addGroup(dragomeGroup);
  wroModel.addGroup(compiledGroup);
  return wroModel;
}
public void destroy()

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

if (!isAbstractGroup) {
 model.addGroup(group);

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

/**
 * @param groups
 *          the groups to set
 */
public final WroModel setGroups(final Collection<Group> groups) {
 notNull(groups, "groups cannot be null!");
 LOG.debug("setGroups: {}", groups);
 identifyDuplicateGroupNames(groups);
 this.groups = new HashSet<Group>(groups);
 return this;
}

代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-web-resources-wro

@Override
public WroModel create() {
  WroModel model = new WroModel();
  ThemeStylingService ts = Framework.getService(ThemeStylingService.class);
  WebResourceManager ws = Framework.getService(WebResourceManager.class);
  ResourceContextImpl rcontext = new ResourceContextImpl();
  List<PageDescriptor> pages = ts.getPages();
  for (PageDescriptor page : pages) {
    String groupName = page.getName();
    Group group = new Group(groupName);
    List<String> bundleNames = page.getResourceBundles();
    for (String bundleName : bundleNames) {
      List<Resource> resources = ws.getResources(rcontext, bundleName, ResourceType.any.name());
      if (resources != null) {
        for (Resource resource : resources) {
          ro.isdc.wro.model.resource.Resource wr = toWroResource(bundleName, resource);
          if (wr != null) {
            group.addResource(wr);
          }
        }
      }
    }
    model.addGroup(group);
  }
  return model;
}

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

public WroModel create() {
 return new WroModel();
}

代码示例来源:origin: org.nuiton.js/nuiton-js-wro

if (!isAbstractGroup) {
 model.addGroup(group);

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

public WroModelInspector(final WroModel model) {
 Validate.notNull(model);
 for (final Group group : model.getGroups()) {
  map.put(group.getName(), group);
 }
}

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

private void processImports(final Document document) {
 final NodeList importsList = document.getElementsByTagName(TAG_IMPORT);
 LOG.debug("number of imports: {}", importsList.getLength());
 for (int i = 0; i < importsList.getLength(); i++) {
  final Element element = (Element) importsList.item(i);
  final String name = element.getTextContent();
  LOG.debug("processing import: {}", name);
  notNull(locatorFactory, "The Locator cannot be null!");
  if (processedImports.contains(name)) {
   final String message = "Recursive import detected: " + name;
   LOG.error(message);
   throw new RecursiveGroupDefinitionException(message);
  }
  processedImports.add(name);
  model.merge(createImportedModel(name));
 }
}

代码示例来源:origin: alexo/wro4j

/**
 * @return a {@link BaseWroManagerFactory} which uses an empty model.
 */
public static BaseWroManagerFactory simpleManagerFactory() {
 return new BaseWroManagerFactory().setModelFactory(simpleModelFactory(new WroModel()));
}

代码示例来源:origin: org.nuiton.js/nuiton-js-wro

/**
 * Merge master model with another model. This is useful for supporting model imports.
 *
 * @param master master modele where we put imported model
 * @param importedModel model to import.
 */
protected void merge(WroModel master, WroModel importedModel) {
 Validate.notNull(importedModel, "imported model cannot be null!");
 LOG.debug("merging importedModel: {}", importedModel);
 for (final String groupName : new WroModelInspector(importedModel).getGroupNames()) {
  if (!new WroModelInspector(master).getGroupNames().contains(groupName)) {
    // si les deux modeles contiennent le meme groupe, on garde celui du master
    final Group importedGroup = new WroModelInspector(importedModel).getGroupByName(groupName);
    master.addGroup(importedGroup);
  }
 }
}

代码示例来源:origin: alexo/wro4j

/**
 * {@inheritDoc}
 */
public synchronized WroModel transform(final WroModel input) {
 final WroModel model = input;
 for (final Group group : model.getGroups()) {
  final List<Resource> resources = group.getResources();
  for (final Resource resource : resources) {
   processResource(group, resource);
  }
 }
 LOG.debug("Transformed model: {}", model);
 return model;
}

代码示例来源:origin: org.nuiton.js/nuiton-js-wro

protected void processImports(final Document document) {
 final NodeList importsList = document.getElementsByTagName(TAG_IMPORT);
 LOG.debug("number of imports: {}", importsList.getLength());
 for (int i = 0; i < importsList.getLength(); i++) {
  final Element element = (Element) importsList.item(i);
  final String name = element.getTextContent();
  LOG.debug("processing import: {}", name);
  Validate.notNull(locatorFactory, "The Locator cannot be null!");
  if (processedImports.contains(name)) {
   final String message = "Recursive import detected: " + name;
   LOG.error(message);
   throw new RecursiveGroupDefinitionException(message);
  }
  processedImports.add(name);
  model.merge(createImportedModel(name));
 }
}

代码示例来源:origin: ro.isdc.wro4j/wro4j-core

/**
 * @return a {@link BaseWroManagerFactory} which uses an empty model.
 */
public static BaseWroManagerFactory simpleManagerFactory() {
 return new BaseWroManagerFactory().setModelFactory(simpleModelFactory(new WroModel()));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com