Class 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.Element addProperty​(eu.maveniverse.domtrip.Element propertiesElement, java.lang.String propertyName, java.lang.String propertyValue)
      Adds a property to the properties section.
      boolean deleteProperty​(java.lang.String key)
      Removes a property from project/properties/key.
      boolean updateProperty​(boolean upsert, java.lang.String key, java.lang.String value)
      Updates or inserts a property value in project/properties/key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Properties

        public Properties()
    • 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.DomTripException
        Adds a property to the properties section.
        Parameters:
        propertiesElement - the properties container element
        propertyName - the name of the property
        propertyValue - 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.DomTripException
        Updates or inserts a property value in project/properties/key.

        If the property already exists, its value is updated. If upsert is 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 exist
        key - the property name
        value - 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.DomTripException
        Removes a property from project/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