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.StringDEFAULT_XML_ENCODINGprivate de.pdark.decentxml.Documentdocumentprivate booleanisMutableprivate static de.pdark.decentxml.XMLParserparserstatic java.lang.StringPOM_XMLprivate booleanpreferExplicitProjectVersionprivate de.pdark.decentxml.Elementprojectprivate java.lang.StringversionThe (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.ElementaddEmptyVersionElementToXML(de.pdark.decentxml.Element project)java.lang.StringgetArtifactId()BuildgetBuild()java.util.List<GAV>getDependencies()DependencyManagementgetDependencyManagement()private java.lang.StringgetElementValue(java.lang.String name)private java.lang.StringgetExplicitGroupId()private java.lang.StringgetExplicitVersionFromXML()java.lang.StringgetGroupId()Returns the (effective) groupId of the project.java.util.List<java.lang.String>getModules()java.lang.StringgetPackaging()GAVgetParent()java.lang.StringgetParentVersion()java.util.List<Profile>getProfiles()java.util.List<Property>getProperties()java.lang.StringgetVersion()Returns the (effective) version of the project.booleanisMutable()static PomFileread(java.io.File file, boolean isMutable)static PomFileread(java.io.InputStream input, boolean isMutable)private static voidremoveVersionElementFromXML(de.pdark.decentxml.Element project)voidsetParentVersion(java.lang.String newVersion)Sets the version in the parent POM declaration.voidsetVersion(java.lang.String version)Sets the version of the project.private voidsetVersionInXML()static voidwrite(PomFile pom, java.io.File file)static voidwrite(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()
-
-