Class ParserUtils

java.lang.Object
org.mapfish.print.parser.ParserUtils

public final class ParserUtils extends Object
Utility method for getting and setting parameters on Processor Input and Output objects.
  • Field Details

    • FILTER_ONLY_REQUIRED_ATTRIBUTES

      public static final Predicate<Field> FILTER_ONLY_REQUIRED_ATTRIBUTES
      A filter (for the get attribute methods) that selects only the attributes that are required and excludes all of those with defaults, and therefore are considered optional.
    • FILTER_HAS_DEFAULT_ATTRIBUTES

      public static final Predicate<Field> FILTER_HAS_DEFAULT_ATTRIBUTES
      A filter (for the get attribute methods) that selects only the attributes that are NOT required and excludes all of those that are considered required.
    • FILTER_NON_FINAL_FIELDS

      public static final Predicate<Field> FILTER_NON_FINAL_FIELDS
      A filter (for the get attribute methods) that selects only the attributes that are non final. (Can be modified)
    • FILTER_FINAL_FIELDS

      public static final Predicate<Field> FILTER_FINAL_FIELDS
      A filter (for the get attribute methods) that selects only the attributes that are final. (Can NOT be modified)
  • Method Details

    • getAllAttributes

      public static Collection<Field> getAllAttributes(Class<?> classToInspect)
      Inspects the object and all superclasses for public, non-final, accessible methods and returns a collection containing all the attributes found.
      Parameters:
      classToInspect - the class under inspection.
    • getAttributes

      public static Collection<Field> getAttributes(Class<?> classToInspect, Predicate<Field> filter)
      Get a subset of the attributes of the provided class. An attribute is each public field in the class or super class.
      Parameters:
      classToInspect - the class to inspect
      filter - a predicate that returns true when a attribute should be kept in resulting collection.
    • getAllAttributeNames

      public static Set<String> getAllAttributeNames(Class<?> classToInspect)
      Converts all non-final properties in getAllAttributes(Class) to a set of the attribute names.
      Parameters:
      classToInspect - the class to inspect
    • getAttributeNames

      public static Set<String> getAttributeNames(Class<?> classToInspect, Predicate<Field> filter)
      Converts all properties in getAllAttributes(Class) to a set of the attribute names.
      Parameters:
      classToInspect - the class to inspect
      filter - a predicate that returns true when a attribute should be kept in resulting collection.