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


Java PlexusConfiguration.getChildren方法代码示例

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


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

示例1: toXppDom

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
/**
 * Recursively convert PLEXUS config to Xpp3Dom.
 * @param config The config to convert
 * @return The Xpp3Dom document
 * @see #execute(String,String,Properties)
 */
private Xpp3Dom toXppDom(final PlexusConfiguration config) {
    final Xpp3Dom result = new Xpp3Dom(config.getName());
    result.setValue(config.getValue(null));
    for (final String name : config.getAttributeNames()) {
        try {
            result.setAttribute(name, config.getAttribute(name));
        } catch (final PlexusConfigurationException ex) {
            throw new IllegalArgumentException(ex);
        }
    }
    for (final PlexusConfiguration child : config.getChildren()) {
        result.addChild(this.toXppDom(child));
    }
    return result;
}
 
开发者ID:teamed,项目名称:qulice,代码行数:22,代码来源:MojoExecutor.java

示例2: fromConfiguration

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
private JdkToolchain fromConfiguration( PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator )
    throws ComponentConfigurationException
{
    PlexusConfiguration[] params = configuration.getChildren();
    Map parameters = new HashMap();
    for ( int j = 0; j < params.length; j++ )
    {
        try
        {
            String name = params[j].getName();
            String val = params[j].getValue();
            parameters.put( name, val );
        }
        catch ( PlexusConfigurationException ex )
        {
            throw new ComponentConfigurationException( ex );
        }
    }
    final JdkToolchain result = new JdkToolchain();
    result.setParameters( Collections.unmodifiableMap( parameters ) );
    return result;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:JdkToolchainConverter.java

示例3: convertPlexusConfiguration

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
private Xpp3Dom convertPlexusConfiguration(PlexusConfiguration config) {

    Xpp3Dom xpp3DomElement = new Xpp3Dom(config.getName());
    xpp3DomElement.setValue(config.getValue());

    for (String name : config.getAttributeNames()) {
      xpp3DomElement.setAttribute(name, config.getAttribute(name));
    }

    for (PlexusConfiguration child : config.getChildren()) {
      xpp3DomElement.addChild(convertPlexusConfiguration(child));
    }

    return xpp3DomElement;
  }
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-maven-plugin,代码行数:16,代码来源:AppengineEnhancerMojo.java

示例4: parseHibernateTool

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
public static PlexusConfiguration parseHibernateTool( PlexusConfiguration hibernatetool, String goalName,
                                                      ClassLoader classLoader, MavenSession session )
    throws PlexusConfigurationException
{
    // let's create the expression evaluator first
    HibernateExpressionEvaluator evaluator = new HibernateExpressionEvaluator( session );

    // now let's extract some basic information
    PlexusConfiguration defaultConfiguration = findConfiguration( hibernatetool, evaluator );
    List<PlexusConfiguration> goals = new Vector<PlexusConfiguration>();
    List<PlexusConfiguration> properties = new Vector<PlexusConfiguration>();

    for ( PlexusConfiguration child : hibernatetool.getChildren() )
    {
        if ( "goal".equals( PropertyUtils.getProperty( child.getName() ) ) )
        {
            goals.add( child );
        }
        else if ( !isConfiguration( child ) )
        {
            properties.add( child );
        }
    }

    PlexusConfiguration target = getTarget( "hibernatetool", classLoader );
    for ( PlexusConfiguration originalGoal : goals )
    {
        if ( "run".equals( goalName ) || originalGoal.getName().equals( goalName ) )
        {
            PlexusConfiguration task = getHibernateTask( hibernatetool, evaluator );
            setDestinationDirectory( task, originalGoal, target, session, evaluator );
            setHibernateConfiguration( task, originalGoal, defaultConfiguration, evaluator );
            setHibernateGoal( task, originalGoal, evaluator );
            setHibernateProperties( task, properties, evaluator );
            target.addChild( task );
        }
    }
    return target;
}
 
开发者ID:frincon,项目名称:openeos,代码行数:40,代码来源:PlexusConfigurationUtils.java

示例5: toIndentedString

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
static void toIndentedString(PlexusConfiguration xml, int indentationSize, int currentDepth, Writer wrt)
        throws IOException {

    indent(indentationSize, currentDepth, wrt);

    boolean hasChildren = xml.getChildCount() > 0;
    boolean hasContent = xml.getValue() != null && !xml.getValue().isEmpty();
    wrt.write('<');
    wrt.write(xml.getName());
    if (!hasChildren && !hasContent) {
        wrt.write("/>");
    } else {
        wrt.write('>');
        if (hasChildren) {
            wrt.write('\n');
            for (PlexusConfiguration c : xml.getChildren()) {
                toIndentedString(c, indentationSize, currentDepth + 1, wrt);
                wrt.append('\n');
            }

            if (!hasContent) {
                indent(indentationSize, currentDepth, wrt);
            }
        }

        if (hasContent) {
            wrt.write(xml.getValue());
        }

        wrt.write("</");
        wrt.write(xml.getName());
        wrt.write('>');
    }
}
 
开发者ID:revapi,项目名称:revapi,代码行数:35,代码来源:XmlUtil.java

示例6: extractAndMerge

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
/**
 * Extract the Mojo specific configuration from the incoming plugin configuration from Maven by looking at an enclosing element with the goal name. Use this and merge it with the default Mojo
 * configuration and use this to apply values to the Mojo.
 * 
 * @param goal
 * @param pluginConfigurationFromMaven
 * @param defaultMojoConfiguration
 * @return
 * @throws ComponentConfigurationException
 */
PlexusConfiguration extractAndMerge(String goal, PlexusConfiguration pluginConfigurationFromMaven, PlexusConfiguration defaultMojoConfiguration) throws ComponentConfigurationException {
  //
  // We need to extract the specific configuration for this goal out of the POM configuration
  //
  PlexusConfiguration mojoConfigurationFromPom = new XmlPlexusConfiguration("configuration");
  for (PlexusConfiguration element : pluginConfigurationFromMaven.getChildren()) {
    if (element.getName().equals(goal)) {
      for (PlexusConfiguration goalConfigurationElements : element.getChildren()) {
        mojoConfigurationFromPom.addChild(goalConfigurationElements);
      }
    }
  }
  return new XmlPlexusConfiguration(Xpp3Dom.mergeXpp3Dom(convert(mojoConfigurationFromPom), convert(defaultMojoConfiguration)));
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:25,代码来源:MojoConfigurationProcessor.java

示例7: toXpp3Dom

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
/**
 * Taken from MojoExecutor of Don Brown. Converts PlexusConfiguration to a Xpp3Dom.
 * 
 * @param config the PlexusConfiguration. Must not be {@code null}.
 * @return the Xpp3Dom representation of the PlexusConfiguration
 */
public Xpp3Dom toXpp3Dom( PlexusConfiguration config )
{
    Xpp3Dom result = new Xpp3Dom( config.getName() );
    result.setValue( config.getValue( null ) );
    for ( String name : config.getAttributeNames() )
    {
        result.setAttribute( name, config.getAttribute( name ) );
    }
    for ( PlexusConfiguration child : config.getChildren() )
    {
        result.addChild( toXpp3Dom( child ) );
    }
    return result;
}
 
开发者ID:khmarbaise,项目名称:iterator-maven-plugin,代码行数:21,代码来源:IteratorMojo.java

示例8: convert

import org.codehaus.plexus.configuration.PlexusConfiguration; //导入方法依赖的package包/类
public static Xpp3Dom convert( MojoDescriptor mojoDescriptor )
{
    Xpp3Dom dom = new Xpp3Dom( "configuration" );

    PlexusConfiguration c = mojoDescriptor.getMojoConfiguration();

    PlexusConfiguration[] ces = c.getChildren();

    if ( ces != null )
    {
        for ( PlexusConfiguration ce : ces )
        {
            String value = ce.getValue( null );
            String defaultValue = ce.getAttribute( "default-value", null );
            if ( value != null || defaultValue != null )
            {
                Xpp3Dom e = new Xpp3Dom( ce.getName() );
                e.setValue( value );
                if ( defaultValue != null )
                {
                    e.setAttribute( "default-value", defaultValue );
                }
                dom.addChild( e );
            }
        }
    }

    return dom;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:30,代码来源:MojoDescriptorCreator.java


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