childConfiguration.setAttribute( name, value );
/** * Copy constructor with alternative name. */ public Xpp3Dom( Xpp3Dom src, String name ) { this.name = name; int childCount = src.getChildCount(); childList = new ArrayList<Xpp3Dom>( childCount ); childMap = new HashMap<String, Xpp3Dom>( childCount << 1 ); setValue( src.getValue() ); String[] attributeNames = src.getAttributeNames(); for ( String attributeName : attributeNames ) { setAttribute( attributeName, src.getAttribute( attributeName ) ); } for ( int i = 0; i < childCount; i++ ) { addChild( new Xpp3Dom( src.getChild( i ) ) ); } }
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; }
dominant.setAttribute( attr, recessive.getAttribute( attr ) );
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; }
dominant.setAttribute( attr, recessive.getAttribute( attr ) );
&& StringUtils.isNotEmpty( parameter.getImplementation() ) ) parameterConfiguration.setAttribute( "implementation", parameter.getImplementation() );
private void toAttribute(Xpp3Dom parent, String key, Object value) { if (value instanceof List || value instanceof Map) { throw new YAMLException("Attribute's value has to be a plain string. Node: " + parent); } parent.setAttribute(key, value.toString()); }
private Xpp3Dom nodeToXpp3(final Node node) { Xpp3Dom dom = new Xpp3Dom((String) node.name()); Object value = node.value(); if (value instanceof String) { dom.setValue(String.valueOf(value)); } Map attrs = node.attributes(); for (Object key : attrs.keySet()) { dom.setAttribute(String.valueOf(key), String.valueOf(attrs.get(key))); } for (Object child : node.children()) { if (child instanceof Node) { dom.addChild(nodeToXpp3((Node) child)); } } return dom; } }
public Site(String url) { this.dom = new Xpp3Dom("site"); dom.setAttribute("url", url); dom.setAttribute("enabled", "true"); dom.setAttribute("updateable", "true"); dom.setAttribute("policy", "USER-INCLUDE"); }
&& StringUtils.isNotEmpty( parameter.getImplementation() ) ) parameterConfiguration.setAttribute( "implementation", parameter.getImplementation() );
private static void setAttribute( Xpp3Dom dom, String attribute, String value ) { String attr = dom.getAttribute( attribute ); if ( attr == null || value == null || value.length() <= 0 ) { return; } dom.setAttribute( attribute, value ); }
public void setRepositoryLocation( String locationURI ) { Xpp3Dom repositoryDom = dom.getChild( "repository" ); if ( repositoryDom != null ) { repositoryDom.setAttribute( "location", locationURI ); } }
public void setProperties(final LinkedHashMap<String, String> properties) { removeChild(dom, "properties"); final Xpp3Dom propertiesDom = new Xpp3Dom("properties"); for (final Map.Entry<String, String> property : properties.entrySet()) { final Xpp3Dom propertyDom = new Xpp3Dom("property"); propertyDom.setAttribute("name", property.getKey()); propertyDom.setAttribute("value", property.getValue()); propertiesDom.addChild(propertyDom); } propertiesDom.setAttribute("size", Integer.toString(properties.size())); dom.addChild(propertiesDom); }
public Platform() { this.dom = new Xpp3Dom("config"); dom.setAttribute("version", "3.0"); setTimestamp(System.currentTimeMillis()); setTransient(true); }
public Platform() { this.dom = new Xpp3Dom("config"); dom.setAttribute("version", "3.0"); setTimestamp(System.currentTimeMillis()); setTransient(true); }
public Platform() { this.dom = new Xpp3Dom("config"); dom.setAttribute("version", "3.0"); setTimestamp(System.currentTimeMillis()); setTransient(true); }
protected Xpp3Dom newElement(@Nullable org.eclipse.aether.RepositoryEvent event) { Xpp3Dom element = new Xpp3Dom("RepositoryEvent"); if (event == null) { return element; } element.setAttribute("class", event.getClass().getName()); element.setAttribute("type", event.getType().toString()); element.addChild(newElement("artifact", event.getArtifact())); element.addChild(newElement("repository", event.getRepository())); return element; }
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; } }
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; } }