Class SubInheritanceHierarchyFunction

All Implemented Interfaces:
CtConsumableFunction<CtTypeInformation>, CtQueryAware

public class SubInheritanceHierarchyFunction extends Object implements CtConsumableFunction<CtTypeInformation>, CtQueryAware
Expects a CtTypeInformation as input and produces all sub classes and sub interfaces recursively.
The output is produced in arbitrary order.
  • Constructor Details

    • SubInheritanceHierarchyFunction

      public SubInheritanceHierarchyFunction()
      The mapping function created using this constructor will visit each sub class and sub interface following sub hierarchy.
  • Method Details

    • includingSelf

      public SubInheritanceHierarchyFunction includingSelf(boolean includingSelf)
      includingSelf - if true then input element is sent to output too. By default it is false.
    • includingInterfaces

      public SubInheritanceHierarchyFunction includingInterfaces(boolean includingInterfaces)
      includingInterfaces - if false then interfaces are not visited - only super classes. By default it is true.
    • failOnClassNotFound

      public SubInheritanceHierarchyFunction failOnClassNotFound(boolean failOnClassNotFound)
      failOnClassNotFound - sets whether processing should throw an exception if class is missing in noClassPath mode
    • apply

      public void apply(CtTypeInformation input, CtConsumer<Object> outputConsumer)
      Description copied from interface: CtConsumableFunction
      Evaluates the function on the given input.
      Specified by:
      apply in interface CtConsumableFunction<CtTypeInformation>
      input - the input of the function
      outputConsumer - the consumer which accepts the results of this function.
    • setQuery

      public void setQuery(CtQuery query)
      Description copied from interface: CtQueryAware
      This method is called when the filter/function is added as a step to a CtQuery by the query engine (CtQueryImpl).
      Specified by:
      setQuery in interface CtQueryAware
      query - an instance registering this function/filter.