/** * This implementation would be simpler if java would have closures :). * * @return a comma separated list of group names. */ public String getGroupNamesAsString() { return String.format("%s", StringUtils.join(getGroupNames(), ", ")); }
/** * This implementation would be simpler if java would have closures :). * * @return a comma separated list of group names. */ public String getGroupNamesAsString() { return String.format("%s", StringUtils.join(getGroupNames(), ", ")); }
private List<String> getAllModelGroupNames() { return new WroModelInspector(getModel()).getGroupNames(); }
/** * Merge this model with another model. This is useful for supporting model imports. * * @param importedModel model to import. */ public void merge(final 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(this).getGroupNames().contains(groupName)) { throw new WroRuntimeException("Duplicate group name detected: " + groupName); } final Group importedGroup = new WroModelInspector(importedModel).getGroupByName(groupName); addGroup(importedGroup); } }
private List<String> getAllModelGroupNames() { return new WroModelInspector(getModel()).getGroupNames(); }
/** * 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); } } }
/** * @return a list containing all groups needs to be processed. */ private List<String> getTargetGroupsAsList() throws IOException { if (targetGroups == null) { final WroModel model= managerFactory.create().getModelFactory().create(); return new WroModelInspector(model).getGroupNames(); } return Arrays.asList(targetGroups.split(",")); }
/** * Merge this model with another model. This is useful for supporting model imports. * * @param importedModel model to import. */ public void merge(final 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(this).getGroupNames().contains(groupName)) { throw new WroRuntimeException("Duplicate group name detected: " + groupName); } final Group importedGroup = new WroModelInspector(importedModel).getGroupByName(groupName); addGroup(importedGroup); } }