/** * Sets activation configuration, see {@link Activation} * * @param activation new activation * @return this profile instance */ public Profile setActivation(Activation activation) { this.activation = activation; if (!isNew()) { if (activation == null) { element.removeChild("activation"); } else if (element.hasSingleChild("activation")) { element.removeChild("activation"); element.appendChild(activation.asXMLElement()); } else { element.appendChild(activation.asXMLElement()); } } return this; }
public Activation setJdk(String jdk) { this.jdk = jdk; if (!isNew()) { if (isNullOrEmpty(jdk)) { element.removeChild("jdk"); } else if (element.hasSingleChild("jdk")) { element.getSingleChild("jdk").setText(jdk); } else { element.appendChild(createElement("jdk", jdk)); } } return this; }
activation = new Activation(element.getSingleChild("activation"));
public Activation setActiveByDefault(String activeByDefault) { this.activeByDefault = activeByDefault; if (!isNew()) { if (isNullOrEmpty(activeByDefault)) { element.removeChild("activeByDefault"); } else if (element.hasSingleChild("activeByDefault")) { element.getSingleChild("activeByDefault").setText(activeByDefault); } else { element.appendChild(createElement("activeByDefault", activeByDefault)); } } return this; }
/** Returns profile element as XML element. */ public NewElement asXMLElement() { final NewElement profile = createElement("profile"); if (!isNullOrEmpty(id)) { profile.appendChild(createElement("id", id)); } if (modules != null && !modules.isEmpty()) { profile.appendChild(newModulesXMLElement(modules)); } if (activation != null) { profile.appendChild(activation.asXMLElement()); } if (build != null) { profile.appendChild(build.asXMLElement()); } if (repositories != null && !repositories.isEmpty()) { profile.appendChild(newRepositoryElement(repositories)); } if (dependencies != null && !dependencies.get().isEmpty()) { profile.appendChild(newDependencyElement(dependencies.get())); } if (properties != null && !properties.isEmpty()) { profile.appendChild(newPropertiesElement(properties)); } if (dependencyManagement != null && !dependencyManagement.getDependencies().isEmpty()) { profile.appendChild(newDependencyManagementElement(dependencies.get())); } return profile; }
public Activation setFile(ActivationFile file) { this.file = file; if (!isNew()) { if (file == null) { element.removeChild("file"); } else if (element.hasSingleChild("file")) { element.removeChild("file"); element.appendChild(file.asXMLElement()); } else { element.appendChild(file.asXMLElement()); } } return this; }
public Activation setOs(ActivationOS os) { this.os = os; if (!isNew()) { if (os == null) { element.removeChild("os"); } else if (element.hasSingleChild("os")) { element.removeChild("os"); element.appendChild(os.asXMLElement()); } else { element.appendChild(os.asXMLElement()); } } return this; }
public Activation setProperty(ActivationProperty property) { this.property = property; if (!isNew()) { if (property == null) { element.removeChild("property"); } else if (element.hasSingleChild("property")) { element.removeChild("property"); element.appendChild(property.asXMLElement()); } else { element.appendChild(property.asXMLElement()); } } return this; }