Class Reflection.PropertyPath

java.lang.Object
org.omnifaces.util.Reflection.PropertyPath
All Implemented Interfaces:
Serializable, Comparable<Reflection.PropertyPath>
Enclosing class:
Reflection

public static final class Reflection.PropertyPath extends Object implements Comparable<Reflection.PropertyPath>, Serializable
This class represents a property path. This is intended to be immutable. This is primarily used in Reflection.getBaseBeanPropertyPaths(Object) and Reflection.setBeanProperties(Object, Map).
Since:
3.8
Author:
Bauke Scholtz
See Also:
  • Method Details

    • of

      @SafeVarargs public static Reflection.PropertyPath of(Comparable<? extends Serializable>... nodes)
      Create a new property path composed of given nodes.
      Parameters:
      nodes - Nodes of property path.
      Returns:
      A new property path composed of given nodes.
      Throws:
      NullPointerException - When one of the nodes is null.
      IllegalArgumentException - When one of the nodes is actually not an instance of Serializable.
    • with

      public Reflection.PropertyPath with(Comparable<? extends Serializable> node)
      Create a new property path composed of the nodes of the current property path with the given node added. E.g. if the current property path is "person" and the given node is "name", then this returns a new property path representing "person.name". Or, if the current property path is "list" and the given node is "0", then this returns a new property path representing "list[0]". Or, if the current property path is "persons[0]" and the given node is "name", then this returns a new property path representing "persons[0].name"
      Parameters:
      node - Node to extend the current property path with.
      Returns:
      A new property path composed of the nodes of the current property path added with the given node.
      Throws:
      NullPointerException - When node is null.
    • compareTo

      public int compareTo(Reflection.PropertyPath other)
      Specified by:
      compareTo in interface Comparable<Reflection.PropertyPath>
    • equals

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

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

      public String toString()
      Returns the property path as string, conform the EL rules.
      Overrides:
      toString in class Object