|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.scijava.util.XML
org.scijava.util.POM
public class POM
Helper class for working with Maven POMs.
Constructor Summary | |
---|---|
POM(File file)
Parses a POM from the given file. |
|
POM(InputStream in)
Parses a POM from the given input stream. |
|
POM(String s)
Parses a POM from the given string. |
|
POM(URL url)
Parses a POM from the given URL. |
Method Summary | |
---|---|
int |
compareTo(POM pom)
|
static int |
compareVersions(String v1,
String v2)
Compares two version strings. |
static List<POM> |
getAllPOMs()
Gets all available Maven POMs on the class path. |
String |
getArtifactId()
Gets the POM's artifactId. |
String |
getGroupId()
Gets the POM's groupId. |
String |
getOrganizationName()
Gets the organization name. |
String |
getOrganizationURL()
Gets the organization URL. |
static POM |
getPOM(Class<?> c,
String groupId,
String artifactId)
Gets the Maven POM associated with the given class. |
String |
getProjectDescription()
Gets the project description. |
String |
getProjectInceptionYear()
Gets the project inception year. |
String |
getProjectName()
Gets the project name. |
String |
getProjectURL()
Gets the project URL. |
String |
getVersion()
Gets the POM's version. |
Methods inherited from class org.scijava.util.XML |
---|
cdata, getDocument, getPath, loadXML, loadXML, toString, xpath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public POM(File file) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public POM(URL url) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public POM(InputStream in) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
public POM(String s) throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
SAXException
IOException
Method Detail |
---|
public String getGroupId()
public String getArtifactId()
public String getProjectName()
public String getProjectDescription()
public String getProjectURL()
public String getProjectInceptionYear()
public String getOrganizationName()
public String getOrganizationURL()
public int compareTo(POM pom)
compareTo
in interface Comparable<POM>
public String getVersion()
getVersion
in interface Versioned
public static POM getPOM(Class<?> c, String groupId, String artifactId)
c
- The class to use as a base when searching for a pom.xml.groupId
- The Maven groupId of the desired POM.artifactId
- The Maven artifactId of the desired POM.public static List<POM> getAllPOMs()
public static int compareVersions(String v1, String v2)
Given the variation between versioning styles, there is no single comparison method that can possibly be correct 100% of the time. So this method works on a "best effort" basis; YMMV.
The algorithm is as follows:
-
), the version with
suffix will be considered less than the one without a suffix. The
reason for this is to accommodate the SemVer versioning scheme's usage of
"prerelease" version suffixes. For example, 2.0.0
will compare
greater than 2.0.0-beta-1
, whereas 2.0.0
will compare less
than 2.0.0.1
.
Comparator.compare(Object, Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |