Enum TraversalStrategy

java.lang.Object
java.lang.Enum<TraversalStrategy>
spoon.processing.TraversalStrategy
All Implemented Interfaces:
Serializable, Comparable<TraversalStrategy>

public enum TraversalStrategy extends Enum<TraversalStrategy>
This enumeration defines the traversal strategies available for a processor.
See Also:
Processor.getTraversalStrategy()
  • Enum Constant Details

    • PRE_ORDER

      public static final TraversalStrategy PRE_ORDER
      When this strategy is selected, the processor will traverse the parent elements before the children. This implies that if the processor adds new elements to a given model sub-tree, these new elements will be processed too. This strategy can easily lead to complex processing behavior, so it is to be used with care.
    • POST_ORDER

      public static final TraversalStrategy POST_ORDER
      When this strategy is selected, the processor will traverse the child elements before the parents. This implies that child elements that are removed by a processor will still be processed before they are removed.
  • Method Details

    • values

      public static TraversalStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TraversalStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null