Package org.eclipse.tycho.versions.pom
Class PomFile
- java.lang.Object
-
- org.eclipse.tycho.versions.pom.PomFile
-
public class PomFile extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_XML_ENCODING
private de.pdark.decentxml.Document
document
private boolean
isMutable
private static de.pdark.decentxml.XMLParser
parser
static java.lang.String
POM_XML
private boolean
preferExplicitProjectVersion
private de.pdark.decentxml.Element
project
private java.lang.String
version
The (effective) project version
-
Constructor Summary
Constructors Constructor Description PomFile(de.pdark.decentxml.Document pom, boolean isMutable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static de.pdark.decentxml.Element
addEmptyVersionElementToXML(de.pdark.decentxml.Element project)
java.lang.String
getArtifactId()
Build
getBuild()
java.util.List<GAV>
getDependencies()
DependencyManagement
getDependencyManagement()
private java.lang.String
getElementValue(java.lang.String name)
private java.lang.String
getExplicitGroupId()
private java.lang.String
getExplicitVersionFromXML()
java.lang.String
getGroupId()
Returns the (effective) groupId of the project.java.util.List<java.lang.String>
getModules()
java.lang.String
getPackaging()
GAV
getParent()
java.lang.String
getParentVersion()
java.util.List<Profile>
getProfiles()
java.util.List<Property>
getProperties()
java.lang.String
getVersion()
Returns the (effective) version of the project.boolean
isMutable()
static PomFile
read(java.io.File file, boolean isMutable)
static PomFile
read(java.io.InputStream input, boolean isMutable)
private static void
removeVersionElementFromXML(de.pdark.decentxml.Element project)
void
setParentVersion(java.lang.String newVersion)
Sets the version in the parent POM declaration.void
setVersion(java.lang.String version)
Sets the version of the project.private void
setVersionInXML()
static void
write(PomFile pom, java.io.File file)
static void
write(PomFile pom, java.io.OutputStream out)
-
-
-
Field Detail
-
POM_XML
public static final java.lang.String POM_XML
- See Also:
- Constant Field Values
-
DEFAULT_XML_ENCODING
private static final java.lang.String DEFAULT_XML_ENCODING
- See Also:
- Constant Field Values
-
parser
private static de.pdark.decentxml.XMLParser parser
-
document
private de.pdark.decentxml.Document document
-
project
private de.pdark.decentxml.Element project
-
version
private java.lang.String version
The (effective) project version
-
preferExplicitProjectVersion
private final boolean preferExplicitProjectVersion
-
isMutable
private final boolean isMutable
-
-
Method Detail
-
read
public static PomFile read(java.io.File file, boolean isMutable) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static PomFile read(java.io.InputStream input, boolean isMutable) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public static void write(PomFile pom, java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public static void write(PomFile pom, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
getExplicitVersionFromXML
private java.lang.String getExplicitVersionFromXML()
-
setVersionInXML
private void setVersionInXML()
-
addEmptyVersionElementToXML
private static de.pdark.decentxml.Element addEmptyVersionElementToXML(de.pdark.decentxml.Element project)
-
removeVersionElementFromXML
private static void removeVersionElementFromXML(de.pdark.decentxml.Element project)
-
setParentVersion
public void setParentVersion(java.lang.String newVersion)
Sets the version in the parent POM declaration. This never affects the (effective) version of the project itself.- See Also:
setVersion(String)
-
setVersion
public void setVersion(java.lang.String version)
Sets the version of the project.
-
getVersion
public java.lang.String getVersion()
Returns the (effective) version of the project.
-
getPackaging
public java.lang.String getPackaging()
-
getParentVersion
public java.lang.String getParentVersion()
-
getExplicitGroupId
private java.lang.String getExplicitGroupId()
-
getGroupId
public java.lang.String getGroupId()
Returns the (effective) groupId of the project.
-
getArtifactId
public java.lang.String getArtifactId()
-
getParent
public GAV getParent()
-
getModules
public java.util.List<java.lang.String> getModules()
-
getProfiles
public java.util.List<Profile> getProfiles()
-
getDependencyManagement
public DependencyManagement getDependencyManagement()
-
getDependencies
public java.util.List<GAV> getDependencies()
-
getBuild
public Build getBuild()
-
getProperties
public java.util.List<Property> getProperties()
-
getElementValue
private java.lang.String getElementValue(java.lang.String name)
-
isMutable
public boolean isMutable()
-
-