Package eu.maveniverse.domtrip.maven
Class PomEditor.Properties
- java.lang.Object
-
- eu.maveniverse.domtrip.maven.PomEditor.Properties
-
- Enclosing class:
- PomEditor
public class PomEditor.Properties extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Properties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description eu.maveniverse.domtrip.ElementaddProperty(eu.maveniverse.domtrip.Element propertiesElement, java.lang.String propertyName, java.lang.String propertyValue)Adds a property to the properties section.booleandeleteProperty(java.lang.String key)Removes a property fromproject/properties/key.booleanupdateProperty(boolean upsert, java.lang.String key, java.lang.String value)Updates or inserts a property value inproject/properties/key.
-
-
-
Method Detail
-
addProperty
public eu.maveniverse.domtrip.Element addProperty(eu.maveniverse.domtrip.Element propertiesElement, java.lang.String propertyName, java.lang.String propertyValue) throws eu.maveniverse.domtrip.DomTripExceptionAdds a property to the properties section.- Parameters:
propertiesElement- the properties container elementpropertyName- the name of the propertypropertyValue- the value of the property- Returns:
- the newly created property element
- Throws:
eu.maveniverse.domtrip.DomTripException- if the property cannot be added
-
updateProperty
public boolean updateProperty(boolean upsert, java.lang.String key, java.lang.String value) throws eu.maveniverse.domtrip.DomTripExceptionUpdates or inserts a property value inproject/properties/key.If the property already exists, its value is updated. If
upsertis true and the property doesn't exist, it will be created (along with the properties element if needed).- Parameters:
upsert- whether to create the property if it doesn't existkey- the property namevalue- the property value- Returns:
- true if the property was updated or created, false otherwise
- Throws:
eu.maveniverse.domtrip.DomTripException- if an error occurs during editing
-
deleteProperty
public boolean deleteProperty(java.lang.String key) throws eu.maveniverse.domtrip.DomTripExceptionRemoves a property fromproject/properties/key.- Parameters:
key- the property name- Returns:
- true if the property was removed, false if it didn't exist
- Throws:
eu.maveniverse.domtrip.DomTripException
-
-