Class NestedPropertiesBuilder

All Implemented Interfaces:
RuleProvider<SetNestedPropertiesRule>

public final class NestedPropertiesBuilder extends AbstractBackToLinkedRuleBuilder<SetNestedPropertiesRule>
Builder chained when invoking LinkedRuleBuilder.setNestedProperties().
Since:
3.0
  • Field Details

    • elementNames

      private final Map<String,String> elementNames
    • trimData

      private boolean trimData
    • allowUnknownChildElements

      private boolean allowUnknownChildElements
  • Constructor Details

  • Method Details

    • ignoreElement

      public NestedPropertiesBuilder ignoreElement(String elementName)
      Allows ignore a matching element.
      Parameters:
      elementName - The child xml element to be ignored
      Returns:
      this builder instance
    • addAlias

      @Deprecated public NestedPropertiesBuilder addAlias(String elementName, String propertyName)
      Deprecated.
      Allows element2property mapping to be overridden.
      Parameters:
      elementName - The child xml element to match
      propertyName - The java bean property to be assigned the value
      Returns:
      this builder instance
    • addAlias

      public AddAliasBuilder<NestedPropertiesBuilder> addAlias(String elementName)
      Allows element2property mapping to be overridden.
      Parameters:
      elementName - The child xml element to match
      Returns:
      the property alias builder
      Since:
      3.2
    • trimData

      public NestedPropertiesBuilder trimData(boolean trimData)
      When set to true, any text within child elements will have leading and trailing whitespace removed before assignment to the target object.
      Parameters:
      trimData - Flag to set any text within child elements will have leading and trailing whitespace removed
      Returns:
      this builder instance
    • allowUnknownChildElements

      public NestedPropertiesBuilder allowUnknownChildElements(boolean allowUnknownChildElements)
      Determines whether an error is reported when a nested element is encountered for which there is no corresponding property-setter method.
      Parameters:
      allowUnknownChildElements - flag to ignore any child element for which there is no corresponding object property
      Returns:
      this builder instance
    • createRule

      protected SetNestedPropertiesRule createRule()
      Provides an instance of Rule. Must never return null.
      Specified by:
      createRule in class AbstractBackToLinkedRuleBuilder<SetNestedPropertiesRule>
      Returns:
      an instance of Rule.
      See Also: