当前位置: 首页>>代码示例>>Java>>正文


Java Xpp3Dom.getChildren方法代码示例

本文整理汇总了Java中org.codehaus.plexus.util.xml.Xpp3Dom.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Xpp3Dom.getChildren方法的具体用法?Java Xpp3Dom.getChildren怎么用?Java Xpp3Dom.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.plexus.util.xml.Xpp3Dom的用法示例。


在下文中一共展示了Xpp3Dom.getChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listProperty

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
static @NonNull ConfigurationBuilder<String[]> listProperty(final @NonNull String multiProperty, final @NonNull String singleProperty) {
    return new ConfigurationBuilder<String[]>() {
        @Override
        public String[] build(Xpp3Dom conf, ExpressionEvaluator eval) {
            if (conf != null) {
                Xpp3Dom dom = (Xpp3Dom) conf; // MNG-4862
                Xpp3Dom source = dom.getChild(multiProperty);
                if (source != null) {
                    List<String> toRet = new ArrayList<String>();
                    Xpp3Dom[] childs = source.getChildren(singleProperty);
                    for (Xpp3Dom ch : childs) {
                        String chvalue = ch.getValue() == null ? "" : ch.getValue().trim();  //NOI18N
                        toRet.add(chvalue);  //NOI18N
                    }
                    return toRet.toArray(new String[toRet.size()]);
                }
            }
            return null;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:PluginPropertyUtils.java

示例2: getNonFilteredFileExtensions

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private List<String> getNonFilteredFileExtensions(List<Plugin> plugins) {
    for (Plugin plugin : plugins) {
        if (MAVEN_RESOURCES_PLUGIN.equals(plugin.getArtifactId())) {
            final Object configuration = plugin.getConfiguration();
            if (configuration != null) {
                Xpp3Dom xpp3Dom = (Xpp3Dom) configuration;
                final Xpp3Dom nonFilteredFileExtensions = xpp3Dom.getChild(NON_FILTERED_FILE_EXTENSIONS);
                List<String> nonFilteredFileExtensionsList = new ArrayList<>();
                final Xpp3Dom[] children = nonFilteredFileExtensions.getChildren();
                for (Xpp3Dom child : children) {
                    nonFilteredFileExtensionsList.add(child.getValue());
                }
                return nonFilteredFileExtensionsList;
            }
        }
    }
    return null;
}
 
开发者ID:wavemaker,项目名称:wavemaker-app-build-tools,代码行数:19,代码来源:AppBuildMojo.java

示例3: executePluginDef

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private void executePluginDef(InputStream is) throws Exception {
    Xpp3Dom pluginDef = Xpp3DomBuilder.build(is, "utf-8");
    Plugin plugin = loadPlugin(pluginDef);
    Xpp3Dom config = pluginDef.getChild("configuration");
    PluginDescriptor pluginDesc = pluginManager.loadPlugin(plugin, 
                                                           mavenProject.getRemotePluginRepositories(), 
                                                           mavenSession.getRepositorySession());
    Xpp3Dom executions = pluginDef.getChild("executions");
    
    for ( Xpp3Dom execution : executions.getChildren()) {
        Xpp3Dom goals = execution.getChild("goals");
        for (Xpp3Dom goal : goals.getChildren()) {
            MojoDescriptor desc = pluginDesc.getMojo(goal.getValue());
            pluginManager.executeMojo(mavenSession, new MojoExecution(desc, config));
        }
    }
}
 
开发者ID:apache,项目名称:karaf-boot,代码行数:18,代码来源:GenerateMojo.java

示例4: findNodeWith

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
@CheckForNull
private Xpp3Dom findNodeWith(String key) {
  String[] keyParts = key.split("/");
  Xpp3Dom node = configuration;
  for (String keyPart : keyParts) {

    if (node.getChildren(removeIndexSnippet(keyPart)).length <= getIndex(keyPart)) {
      return null;
    }

    node = node.getChildren(removeIndexSnippet(keyPart))[getIndex(keyPart)];
    if (node == null) {
      return null;
    }
  }
  return node;
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:18,代码来源:MavenPlugin.java

示例5: addExcludedGroups

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private Xpp3Dom addExcludedGroups(Xpp3Dom configNode) {
    for (Xpp3Dom config : configNode.getChildren()) {
        if ("excludedGroups".equals(config.getName())) {
            Logger.getGlobal().log(Level.INFO, "Adding excluded groups to existing ones");
            String current = config.getValue();
            // Should not add duplicate entry for NonDexIgnore
            if (current.contains("edu.illinois.NonDexIgnore")) {
                return configNode;
            }
            current = "," + current;
            // It seems there is an error if you have the variable
            // in the excludedGroups string concatenated (in any
            // position) to the concrete class we are adding to
            // the excludedGroups
            // ${excludedGroups} appears when
            // there is no excludedGroups specified in the pom
            // and potentially in other situations
            current = current.replace(",${excludedGroups}", "");
            config.setValue("edu.illinois.NonDexIgnore" + current);
            return configNode;
        }
    }
    Logger.getGlobal().log(Level.INFO, "Adding excluded groups to newly created one");
    configNode.addChild(this.makeNode("excludedGroups", "edu.illinois.NonDexIgnore"));
    return configNode;
}
 
开发者ID:TestingResearchIllinois,项目名称:NonDex,代码行数:27,代码来源:NonDexSurefireExecution.java

示例6: setupArgline

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
protected void setupArgline(Xpp3Dom configNode) {
    // create the NonDex argLine for surefire based on the current configuration
    // this adds things like where to save test reports, what directory NonDex
    // should store results in, what seed and mode should be used.
    String argLineToSet =  this.configuration.toArgLine();
    boolean added = false;
    for (Xpp3Dom config : configNode.getChildren()) {
        if ("argLine".equals(config.getName())) {
            Logger.getGlobal().log(Level.INFO, "Adding NonDex argLine to existing argLine specified by the project");
            String current = sanitizeAndRemoveEnvironmentVars(config.getValue());

            config.setValue(argLineToSet + " " + current);
            added = true;
            break;
        }
    }
    if (!added) {
        Logger.getGlobal().log(Level.INFO, "Creating new argline for Surefire");
        configNode.addChild(this.makeNode("argLine", argLineToSet));
    }

    // originalArgLine is the argLine set from Maven, not through the surefire config
    // if such an argLine exists, we modify that one also
    this.mavenProject.getProperties().setProperty("argLine",
            this.originalArgLine + " " + argLineToSet);
}
 
开发者ID:TestingResearchIllinois,项目名称:NonDex,代码行数:27,代码来源:CleanSurefireExecution.java

示例7: fullClone

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
@Nullable
protected Xpp3Dom fullClone(@Nonnull String elementName, @Nullable Xpp3Dom element) {
    if (element == null) {
        return null;
    }

    Xpp3Dom result = new Xpp3Dom(elementName);

    Xpp3Dom[] childs = element.getChildren();
    if (childs != null && childs.length > 0) {
        for (Xpp3Dom child : childs) {
            result.addChild(fullClone(child.getName(), child));
        }
    } else {
        result.setValue(element.getValue() == null ? element.getAttribute("default-value") : element.getValue());
    }

    return result;
}
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:20,代码来源:AbstractExecutionHandler.java

示例8: getConfigurationParametersToReport

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
@Nonnull
@Override
protected List<String> getConfigurationParametersToReport(ExecutionEvent executionEvent) {

    MojoExecution mojoExecution = executionEvent.getMojoExecution();
    if (mojoExecution == null) {
        return Collections.emptyList();
    }

    Xpp3Dom configuration = mojoExecution.getConfiguration();
    List<String> parameters = new ArrayList<String>();
    for (Xpp3Dom configurationParameter : configuration.getChildren()) {
        parameters.add(configurationParameter.getName());
    }
    return parameters;
}
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:17,代码来源:CatchAllExecutionHandler.java

示例9: xppToElement

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private static Element xppToElement(Xpp3Dom xpp) throws RemoteException {
  Element result;
  try {
    result = new Element(xpp.getName());
  }
  catch (IllegalNameException e) {
    Maven3ServerGlobals.getLogger().info(e);
    return null;
  }

  Xpp3Dom[] children = xpp.getChildren();
  if (children == null || children.length == 0) {
    result.setText(xpp.getValue());
  }
  else {
    for (Xpp3Dom each : children) {
      Element child = xppToElement(each);
      if (child != null) result.addContent(child);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:MavenModelConverter.java

示例10: xppToElement

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private static Element xppToElement(Xpp3Dom xpp) throws RemoteException {
  Element result;
  try {
    result = new Element(xpp.getName());
  }
  catch (IllegalNameException e) {
    Maven2ServerGlobals.getLogger().info(e);
    return null;
  }

  Xpp3Dom[] children = xpp.getChildren();
  if (children == null || children.length == 0) {
    result.setText(xpp.getValue());
  }
  else {
    for (Xpp3Dom each : children) {
      Element child = xppToElement(each);
      if (child != null) result.addContent(child);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:Maven2ModelConverter.java

示例11: createRuleListWithNameSortedChildren

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * As Xpp3Dom is very picky about the order of children while comparing, create a new list where the children
 * are added in alphabetical order. See <a href="https://jira.codehaus.org/browse/MOJO-1931">MOJO-1931</a>.
 *
 * @param originalListFromPom order not specified
 * @return a list where children's member are alphabetically sorted.
 */
private List<Xpp3Dom> createRuleListWithNameSortedChildren( final List<Xpp3Dom> originalListFromPom )
{
    final List<Xpp3Dom> listWithSortedEntries = new ArrayList<Xpp3Dom>( originalListFromPom.size() );
    for ( Xpp3Dom unsortedXpp3Dom : originalListFromPom )
    {
        final Xpp3Dom sortedXpp3Dom = new Xpp3Dom( getRuleName() );
        final SortedMap<String, Xpp3Dom> childrenMap = new TreeMap<String, Xpp3Dom>();
        final Xpp3Dom[] children = unsortedXpp3Dom.getChildren();
        for ( Xpp3Dom child : children )
        {
            childrenMap.put( child.getName(), child );
        }
        for ( Xpp3Dom entry : childrenMap.values() )
        {
            sortedXpp3Dom.addChild( entry );
        }
        listWithSortedEntries.add( sortedXpp3Dom );
    }
    return listWithSortedEntries;
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:28,代码来源:RequirePropertyDiverges.java

示例12: convertXpp

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private static Element convertXpp(Xpp3Dom xpp3Dom) {
  Element result;
  try {
    result = new Element(xpp3Dom.getName());
  } catch (IllegalNameException e) {
    return null;
  }

  Xpp3Dom[] children = xpp3Dom.getChildren();
  if (children == null || children.length == 0) {
    result.setText(xpp3Dom.getValue());
  } else {
    for (Xpp3Dom child : children) {
      Element element = convertXpp(child);
      if (element != null) {
        result.addContent(element);
      }
    }
  }

  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:MavenModelUtil.java

示例13: getGwtModuleName

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Get the GWT Maven plugin 2 <moduleName/>.
 *
 * @param mavenProject
 * @return the moduleName from configuration
 */
private String getGwtModuleName(MavenProject mavenProject) {
  if (!isGwtMavenPlugin2(mavenProject)) {
    return null;
  }

  Plugin gwtPlugin2 = getGwtMavenPlugin2(mavenProject);
  if (gwtPlugin2 == null) {
    return null;
  }

  Xpp3Dom gwtPluginConfig = (Xpp3Dom) gwtPlugin2.getConfiguration();
  if (gwtPluginConfig == null) {
    return null;
  }

  String moduleName = null;
  for (Xpp3Dom child : gwtPluginConfig.getChildren()) {
    if (child != null && GWT_MAVEN_MODULENAME.equals(child.getName())) {
      moduleName = child.getValue().trim();
    }
  }
  return moduleName;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:MavenProjectConfigurator.java

示例14: getGwtModuleShortName

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Get the GWT Maven plugin 2 <moduleShort=Name/>.
 *
 * @param mavenProject
 * @return the moduleName from configuration
 */
private String getGwtModuleShortName(MavenProject mavenProject) {
  if (!isGwtMavenPlugin2(mavenProject)) {
    return null;
  }

  Plugin gwtPlugin2 = getGwtMavenPlugin2(mavenProject);
  if (gwtPlugin2 == null) {
    return null;
  }

  Xpp3Dom gwtPluginConfig = (Xpp3Dom) gwtPlugin2.getConfiguration();
  if (gwtPluginConfig == null) {
    return null;
  }

  String moduleName = null;
  for (Xpp3Dom child : gwtPluginConfig.getChildren()) {
    if (child != null && GWT_MAVEN_MODULESHORTNAME.equals(child.getName())) {
      moduleName = child.getValue().trim();
    }
  }
  return moduleName;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:MavenProjectConfigurator.java

示例15: getGwtMavenPluginHostedWebAppDirectory

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Get the GWT Maven <hostedWebapp/> directory.
 *
 * @param mavenProject
 * @return the webapp directory
 */
private IPath getGwtMavenPluginHostedWebAppDirectory(MavenProject mavenProject) {
  Plugin warPlugin = getGwtMavenPlugin(mavenProject);
  if (warPlugin == null) {
    return null;
  }

  Xpp3Dom warPluginConfig = (Xpp3Dom) warPlugin.getConfiguration();
  if (warPluginConfig == null) {
    return null;
  }

  IPath warOut = null;
  for (Xpp3Dom child : warPluginConfig.getChildren()) {
    if (child != null && HOSTED_WEB_APP_DIRECTORY.equals(child.getName())) {
      String path = child.getValue().trim();
      if (!path.isEmpty()) {
        warOut = new Path(path);
      }
    }
  }

  return warOut;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:MavenProjectConfigurator.java


注:本文中的org.codehaus.plexus.util.xml.Xpp3Dom.getChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。