Java 类org.apache.maven.model.ActivationOS 实例源码

项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeActivation(Activation activation, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (activation.isActiveByDefault() != false) {
        writeValue(serializer, "activeByDefault", String.valueOf(activation.isActiveByDefault()), activation);
    }
    if (activation.getJdk() != null) {
        writeValue(serializer, "jdk", activation.getJdk(), activation);
    }
    if (activation.getOs() != null) {
        writeActivationOS((ActivationOS) activation.getOs(), "os", serializer);
    }
    if (activation.getProperty() != null) {
        writeActivationProperty((ActivationProperty) activation.getProperty(), "property", serializer);
    }
    if (activation.getFile() != null) {
        writeActivationFile((ActivationFile) activation.getFile(), "file", serializer);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(activation, "", start, b.length());
}
项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
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());
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitProfileActivation( ModelVisitor visitor, Activation activation )
{
    ActivationOS os = activation.getOs();
    if ( os != null )
    {
        visitor.visitProfileActivationO( os );
        os = visitor.replaceProfileActivationO( os );
        activation.setOs( os );
    }

    ActivationProperty property = activation.getProperty();
    if ( property != null )
    {
        visitor.visitProfileActivationProperty( property );
        property = visitor.replaceProfileActivationProperty( property );
        activation.setProperty( property );
    }

    ActivationFile file = activation.getFile();
    if ( file != null )
    {
        visitor.visitProfileActivationFile( file );
        file = visitor.replaceProfileActivationFile( file );
        activation.setFile( file );
    }
}
项目:oceano    文件:OperatingSystemProfileActivator.java   
public boolean isActive( Profile profile )
{
    Activation activation = profile.getActivation();
    ActivationOS os = activation.getOs();

    boolean result = ensureAtLeastOneNonNull( os );

    if ( result && os.getFamily() != null )
    {
        result = determineFamilyMatch( os.getFamily() );
    }
    if ( result && os.getName() != null )
    {
        result = determineNameMatch( os.getName() );
    }
    if ( result && os.getArch() != null )
    {
        result = determineArchMatch( os.getArch() );
    }
    if ( result && os.getVersion() != null )
    {
        result = determineVersionMatch( os.getVersion() );
    }
    return result;
}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateActivationOS
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateActivationOS( ActivationOS value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
        findAndReplaceSimpleElement( innerCount, root, "family", value.getFamily(), null );
        findAndReplaceSimpleElement( innerCount, root, "arch", value.getArch(), null );
        findAndReplaceSimpleElement( innerCount, root, "version", value.getVersion(), null );
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MavenSettings.java   
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;
}
项目:spring-boot-concourse    文件:MavenSettings.java   
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;
}
项目:spring-cloud-function    文件:MavenSettings.java   
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;
}
项目:contestparser    文件:MavenSettings.java   
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;
}
项目:che    文件:MavenModelUtil.java   
private static MavenActivationOS convertOsActivation(ActivationOS os) {
  if (os == null) {
    return null;
  }

  return new MavenActivationOS(os.getName(), os.getFamily(), os.getArch(), os.getVersion());
}
项目:che    文件:MavenModelUtil.java   
private static ActivationOS convertToMavenActivationOs(MavenActivationOS os) {
  if (os != null) {
    ActivationOS result = new ActivationOS();
    result.setArch(os.getArch());
    result.setFamily(os.getFamily());
    result.setName(os.getName());
    result.setVersion(os.getVersion());
    return result;
  }
  return null;
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateActivationOS
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateActivationOS( ActivationOS value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
        findAndReplaceSimpleElement( innerCount, root, "family", value.getFamily(), null );
        findAndReplaceSimpleElement( innerCount, root, "arch", value.getArch(), null );
        findAndReplaceSimpleElement( innerCount, root, "version", value.getVersion(), null );
    }
}
项目:oceano    文件:OperatingSystemProfileActivator.java   
public boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
{
    Activation activation = profile.getActivation();

    if ( activation == null )
    {
        return false;
    }

    ActivationOS os = activation.getOs();

    if ( os == null )
    {
        return false;
    }

    boolean active = ensureAtLeastOneNonNull( os );

    if ( active && os.getFamily() != null )
    {
        active = determineFamilyMatch( os.getFamily() );
    }
    if ( active && os.getName() != null )
    {
        active = determineNameMatch( os.getName() );
    }
    if ( active && os.getArch() != null )
    {
        active = determineArchMatch( os.getArch() );
    }
    if ( active && os.getVersion() != null )
    {
        active = determineVersionMatch( os.getVersion() );
    }

    return active;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public ActivationOS replaceProfileActivationO( ActivationOS os )
{
    return os;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitProfileActivationO( ActivationOS os )
{
}
项目:oceano    文件:OperatingSystemProfileActivator.java   
private boolean ensureAtLeastOneNonNull( ActivationOS os )
{
    return os.getArch() != null || os.getFamily() != null || os.getName() != null || os.getVersion() != null;
}
项目:oceano    文件:OperatingSystemProfileActivator.java   
private boolean ensureAtLeastOneNonNull( ActivationOS os )
{
    return os.getArch() != null || os.getFamily() != null || os.getName() != null || os.getVersion() != null;
}
项目:xmvn    文件:ModelVisitor.java   
ActivationOS replaceProfileActivationO( ActivationOS os );
项目:xmvn    文件:ModelVisitor.java   
void visitProfileActivationO( ActivationOS os );