Class NestedPropertiesBuilder
- java.lang.Object
-
- org.apache.commons.digester3.binder.NestedPropertiesBuilder
-
- All Implemented Interfaces:
RuleProvider<SetNestedPropertiesRule>
public final class NestedPropertiesBuilder extends java.lang.Object
Builder chained when invokingLinkedRuleBuilder.setNestedProperties().- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AddAliasBuilder<NestedPropertiesBuilder>addAlias(java.lang.String elementName)Allows element2property mapping to be overridden.NestedPropertiesBuilderaddAlias(java.lang.String elementName, java.lang.String propertyName)Deprecated.NestedPropertiesBuilderallowUnknownChildElements(boolean allowUnknownChildElements)Determines whether an error is reported when a nested element is encountered for which there is no corresponding property-setter method.protected SetNestedPropertiesRulecreateRule()Provides an instance ofRule.Rget()Provides an instance ofRule.java.lang.StringgetNamespaceURI()Returns the namespace URI for which this Rule is relevant, if any.java.lang.StringgetPattern()Returns the rule pattern associated to this builder.NestedPropertiesBuilderignoreElement(java.lang.String elementName)Allows ignore a matching element.protected voidreportError(java.lang.String methodChain, java.lang.String message)LinkedRuleBuilderthen()Come back to the mainLinkedRuleBuilder.NestedPropertiesBuildertrimData(boolean trimData)When set to true, any text within child elements will have leading and trailing whitespace removed before assignment to the target object.
-
-
-
Method Detail
-
ignoreElement
public NestedPropertiesBuilder ignoreElement(java.lang.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(java.lang.String elementName, java.lang.String propertyName)
Deprecated.Allows element2property mapping to be overridden.- Parameters:
elementName- The child xml element to matchpropertyName- The java bean property to be assigned the value- Returns:
- this builder instance
-
addAlias
public AddAliasBuilder<NestedPropertiesBuilder> addAlias(java.lang.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 ofRule. Must never return null.- Returns:
- an instance of
Rule. - See Also:
RuleProvider.get()
-
then
public final LinkedRuleBuilder then()
Come back to the mainLinkedRuleBuilder.- Returns:
- the main
LinkedRuleBuilder
-
getNamespaceURI
public final java.lang.String getNamespaceURI()
Returns the namespace URI for which this Rule is relevant, if any.- Returns:
- The namespace URI for which this Rule is relevant, if any
-
get
public final R get()
Provides an instance ofRule. Must never return null.- Specified by:
getin interfaceRuleProvider<R extends Rule>- Returns:
- an instance of
Rule.
-
reportError
protected final void reportError(java.lang.String methodChain, java.lang.String message)
-
getPattern
public final java.lang.String getPattern()
Returns the rule pattern associated to this builder.- Returns:
- The rule pattern associated to this builder
-
-