Java Code Examples for org.codehaus.plexus.configuration.PlexusConfiguration#getAttributeNames()

The following examples show how to use org.codehaus.plexus.configuration.PlexusConfiguration#getAttributeNames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MojoExecutionService.java    From jkube with Eclipse Public License 2.0 5 votes vote down vote up
private 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;
}
 
Example 2
Source File: AppengineEnhancerMojo.java    From appengine-maven-plugin with Apache License 2.0 5 votes vote down vote up
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;
  }
 
Example 3
Source File: MavenHelper.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Convert a Plexus configuration to its XML equivalent.
 *
 * @param config the Plexus configuration.
 * @return the XML configuration.
 * @throws PlexusConfigurationException in case of problem.
 * @since 0.8
 */
public Xpp3Dom toXpp3Dom(PlexusConfiguration config) throws PlexusConfigurationException {
	final Xpp3Dom result = new Xpp3Dom(config.getName());
	result.setValue(config.getValue(null));
	for (final String name : config.getAttributeNames()) {
		result.setAttribute(name, config.getAttribute(name));
	}
	for (final PlexusConfiguration child : config.getChildren()) {
		result.addChild(toXpp3Dom(child));
	}
	return result;
}
 
Example 4
Source File: AntXmlPlexusConfigurationWriter.java    From was-maven-plugin with Apache License 2.0 5 votes vote down vote up
private void writeAttributes(PlexusConfiguration c, XMLWriter w) throws IOException {
  String[] names = c.getAttributeNames();

  for (int i = 0; i < names.length; i++) {
    w.addAttribute(names[i], c.getAttribute(names[i], null));
  }
}
 
Example 5
Source File: AppengineEnhancerMojo.java    From gcloud-maven-plugin with Apache License 2.0 5 votes vote down vote up
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;
  }
 
Example 6
Source File: MojoExecutionService.java    From docker-maven-plugin with Apache License 2.0 5 votes vote down vote up
private 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;
}
 
Example 7
Source File: IteratorMojo.java    From iterator-maven-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}