Class Xpp3Dom

java.lang.Object
org.apache.maven.shared.utils.xml.Xpp3Dom
All Implemented Interfaces:
Iterable<Xpp3Dom>

public class Xpp3Dom extends Object implements Iterable<Xpp3Dom>
A reimplementation of Plexus Xpp3Dom based on the public interface of Plexus Xpp3Dom.
Author:
Kristian Rosenvold
  • Field Details

    • CHILDREN_COMBINATION_MODE_ATTRIBUTE

      public static final String CHILDREN_COMBINATION_MODE_ATTRIBUTE
      The attribute which identifies merge/append.
      See Also:
    • CHILDREN_COMBINATION_APPEND

      public static final String CHILDREN_COMBINATION_APPEND
      The attribute append.
      See Also:
    • SELF_COMBINATION_MODE_ATTRIBUTE

      public static final String SELF_COMBINATION_MODE_ATTRIBUTE
      The name of the attribute.
      See Also:
    • SELF_COMBINATION_OVERRIDE

      public static final String SELF_COMBINATION_OVERRIDE
      The attributes which identifies override.
      See Also:
    • SELF_COMBINATION_MERGE

      public static final String SELF_COMBINATION_MERGE
      The attribute which identifies merge
      See Also:
  • Constructor Details

    • Xpp3Dom

      public Xpp3Dom(String name)
      Parameters:
      name - The name of the instance.
    • Xpp3Dom

      public Xpp3Dom(Xpp3Dom source)
      Create instance.
      Parameters:
      source - The source.
    • Xpp3Dom

      public Xpp3Dom(@Nonnull Xpp3Dom src, String name)
      Create instance.
      Parameters:
      src - The source Dom.
      name - The name of the Dom.
  • Method Details

    • getName

      public String getName()
      Returns:
      The current name.
    • getValue

      @Nonnull public String getValue()
      Returns:
      The current value.
    • setValue

      public void setValue(@Nonnull String value)
      Parameters:
      value - The value to be set.
    • getAttributeNames

      public String[] getAttributeNames()
      Returns:
      The array of attribute names.
    • getAttribute

      public String getAttribute(String nameParameter)
      Parameters:
      nameParameter - The name of the attribute.
      Returns:
      The attribute value.
    • setAttribute

      public void setAttribute(@Nonnull String nameParameter, @Nonnull String valueParameter)
      Parameters:
      nameParameter - The name of the attribute.
      valueParameter - The value of the attribute.
    • getChild

      public Xpp3Dom getChild(int i)
      Parameters:
      i - The index to be selected.
      Returns:
      The child selected by index.
    • getChild

      public Xpp3Dom getChild(String nameParameter)
      Parameters:
      nameParameter - The name of the child.
      Returns:
      The child selected by name.
    • addChild

      public void addChild(Xpp3Dom child)
      Parameters:
      child - The child to be added.
    • getChildren

      public Xpp3Dom[] getChildren()
      Returns:
      The array of childs.
    • getChildren

      public Xpp3Dom[] getChildren(String nameParameter)
      Parameters:
      nameParameter - The name of the child.
      Returns:
      The array of the Dom.
    • getChildCount

      public int getChildCount()
      Returns:
      The number of childs.
    • removeChild

      public void removeChild(int i)
      Parameters:
      i - The child to be removed.
    • getParent

      public Xpp3Dom getParent()
      Returns:
      The current parent.
    • setParent

      public void setParent(Xpp3Dom parent)
      Parameters:
      parent - Set the parent.
    • mergeXpp3Dom

      public static Xpp3Dom mergeXpp3Dom(Xpp3Dom dominant, Xpp3Dom recessive, Boolean childMergeOverride)
      Parameters:
      dominant - The dominant part.
      recessive - The recessive part.
      childMergeOverride - true if child merge will take precedence false otherwise.
      Returns:
      The merged Xpp3Dom.
    • mergeXpp3Dom

      public static Xpp3Dom mergeXpp3Dom(Xpp3Dom dominant, Xpp3Dom recessive)
      Parameters:
      dominant - The dominant part.
      recessive - The recessive part.
      Returns:
      The merged Xpp3Dom.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUnescapedString

      public String toUnescapedString()
      Returns:
      Unescaped string.
    • isNotEmpty

      @Deprecated public static boolean isNotEmpty(String str)
      Deprecated.
      use str != null && !str.isEmpty()
      Warning: this is not the reverse of isEmpty(java.lang.String). Whitespace only strings are both empty and not empty.
      Parameters:
      str - the string to be checked
      Returns:
      true if the string is not empty (length > 0) and not null
    • isEmpty

      @Deprecated public static boolean isEmpty(String str)
      Deprecated.
      use str == null || str.trim().isEmpty()
      Warning: this is not the reverse of isNotEmpty(java.lang.String). Whitespace only strings are both empty and not empty.
      Parameters:
      str - the string to be checked
      Returns:
      true if the string only contains whitespace or is null
    • iterator

      public Iterator<Xpp3Dom> iterator()
      Specified by:
      iterator in interface Iterable<Xpp3Dom>