Java Code Examples for org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration#setValue()
The following examples show how to use
org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration#setValue() .
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: SchemaDrivenJSONToXmlConverter.java From revapi with Apache License 2.0 | 5 votes |
private static PlexusConfiguration convertSimple(String tagName, String id, String value) { XmlPlexusConfiguration ret = new XmlPlexusConfiguration(tagName); if (id != null) { ret.setAttribute("id", id); } ret.setValue(value); return ret; }
Example 2
Source File: IteratorMojo.java From iterator-maven-plugin with Apache License 2.0 | 5 votes |
/** * This will copy the configuration from <b>src</b> to the result whereas the placeholder will be replaced with the * current value. */ private PlexusConfiguration copyConfiguration( Xpp3Dom src, String iteratorName, String value ) { XmlPlexusConfiguration dom = new XmlPlexusConfiguration( src.getName() ); if ( src.getValue() == null ) { dom.setValue( src.getValue() ); } else { if ( src.getValue().contains( iteratorName ) ) { dom.setValue( src.getValue().replaceAll( iteratorName, value ) ); } else { dom.setValue( src.getValue() ); } } for ( String attributeName : src.getAttributeNames() ) { dom.setAttribute( attributeName, src.getAttribute( attributeName ) ); } for ( Xpp3Dom child : src.getChildren() ) { dom.addChild( copyConfiguration( child, iteratorName, value ) ); } return dom; }