org.apache.maven.model.ActivationOS Java Examples

The following examples show how to use org.apache.maven.model.ActivationOS. 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: LocationAwareMavenXpp3Writer.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void writeActivationOS(ActivationOS activationOS, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (activationOS.getName() != null) {
        writeValue(serializer, "name", activationOS.getName(), activationOS);
    }
    if (activationOS.getFamily() != null) {
        writeValue(serializer, "family", activationOS.getFamily(), activationOS);
    }
    if (activationOS.getArch() != null) {
        writeValue(serializer, "arch", activationOS.getArch(), activationOS);
    }
    if (activationOS.getVersion() != null) {
        writeValue(serializer, "version", activationOS.getVersion(), activationOS);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(activationOS, "", start, b.length());
}
 
Example #2
Source File: MavenSettings.java    From spring-init with Apache License 2.0 5 votes vote down vote up
private org.apache.maven.model.Activation createModelActivation(
		Activation activation) {
	org.apache.maven.model.Activation modelActivation = new org.apache.maven.model.Activation();
	modelActivation.setActiveByDefault(activation.isActiveByDefault());
	if (activation.getFile() != null) {
		ActivationFile activationFile = new ActivationFile();
		activationFile.setExists(activation.getFile().getExists());
		activationFile.setMissing(activation.getFile().getMissing());
		modelActivation.setFile(activationFile);
	}
	modelActivation.setJdk(activation.getJdk());
	if (activation.getOs() != null) {
		ActivationOS os = new ActivationOS();
		os.setArch(activation.getOs().getArch());
		os.setFamily(activation.getOs().getFamily());
		os.setName(activation.getOs().getName());
		os.setVersion(activation.getOs().getVersion());
		modelActivation.setOs(os);
	}
	if (activation.getProperty() != null) {
		ActivationProperty property = new ActivationProperty();
		property.setName(activation.getProperty().getName());
		property.setValue(activation.getProperty().getValue());
		modelActivation.setProperty(property);
	}
	return modelActivation;
}
 
Example #3
Source File: MavenSettings.java    From spring-cloud-function with Apache License 2.0 5 votes vote down vote up
private org.apache.maven.model.Activation createModelActivation(
		Activation activation) {
	org.apache.maven.model.Activation modelActivation = new org.apache.maven.model.Activation();
	modelActivation.setActiveByDefault(activation.isActiveByDefault());
	if (activation.getFile() != null) {
		ActivationFile activationFile = new ActivationFile();
		activationFile.setExists(activation.getFile().getExists());
		activationFile.setMissing(activation.getFile().getMissing());
		modelActivation.setFile(activationFile);
	}
	modelActivation.setJdk(activation.getJdk());
	if (activation.getOs() != null) {
		ActivationOS os = new ActivationOS();
		os.setArch(activation.getOs().getArch());
		os.setFamily(activation.getOs().getFamily());
		os.setName(activation.getOs().getName());
		os.setVersion(activation.getOs().getVersion());
		modelActivation.setOs(os);
	}
	if (activation.getProperty() != null) {
		ActivationProperty property = new ActivationProperty();
		property.setName(activation.getProperty().getName());
		property.setValue(activation.getProperty().getValue());
		modelActivation.setProperty(property);
	}
	return modelActivation;
}