Class Xpp3Utils


  • public final class Xpp3Utils
    extends Object
    Utility class to manipulate Xpp3Dom model.
    Since:
    2.0
    Author:
    Christophe Friederich
    • Method Detail

      • getFirstChild

        @Nullable
        public static org.codehaus.plexus.util.xml.Xpp3Dom getFirstChild​(@Nullable
                                                                         org.codehaus.plexus.util.xml.Xpp3Dom parentNode,
                                                                         @Nonnull
                                                                         String name,
                                                                         @Nonnull
                                                                         String namespace)
        Retrieves the child node. Tests both default name and with namespace.
        Parameters:
        parentNode - the parent node
        name - the child name of node to get
        namespace - the namespace (can be empty or null).
        Returns:
        Returns Returns Xpp3Dom representing the child of parentNode if exists, otherwise returns null.
      • getChildren

        @Nonnull
        public static List<String> getChildren​(@Nullable
                                               org.codehaus.plexus.util.xml.Xpp3Dom parentNode)
        Gets the list of all children name for the parentNode.
        Parameters:
        parentNode - the parent node to use (can be null.
        Returns:
        Returns a list of String representing the name of all children, which may be empty but never null.
        Since:
        1.3
      • getChildrenNodes

        @Nonnull
        public static List<org.codehaus.plexus.util.xml.Xpp3Dom> getChildrenNodes​(@Nullable
                                                                                  org.codehaus.plexus.util.xml.Xpp3Dom parentNode,
                                                                                  String name)
        Gets children list filtered by name of parentNode.
        Parameters:
        parentNode - the parent node to use.
        name - the name of element to filter
        Returns:
        Returns a list of Xpp3Dom representing all children element filtered by name of parentNode.