All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.tycho.versions.pom.Profile Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
/*******************************************************************************
 * Copyright (c) 2008, 2011 Sonatype Inc. and others.
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Sonatype Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.tycho.versions.pom;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;

import de.pdark.decentxml.Element;

public class Profile {

    private final Element dom;

    public Profile(Element dom) {
        this.dom = dom;
    }

    public List getModules() {
        LinkedHashSet result = new LinkedHashSet<>();
        for (Element modules : dom.getChildren("modules")) {
            for (Element module : modules.getChildren("module")) {
                result.add(module.getTrimmedText());
            }
        }
        return new ArrayList<>(result);
    }

    public String getId() {
        Element child = dom.getChild("id");
        return child != null ? child.getTrimmedText() : null;
    }

    public Build getBuild() {
        return Build.getBuild(dom);
    }

    public List getDependencies() {
        return Dependencies.getDependencies(dom);
    }

    public DependencyManagement getDependencyManagement() {
        return DependencyManagement.getDependencyManagement(dom);
    }

    public List getProperties() {
        return Property.getProperties(dom);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy