Class SetPropertiesBuilder
- java.lang.Object
-
- org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<SetPropertiesRule>
-
- org.apache.commons.digester3.binder.SetPropertiesBuilder
-
- All Implemented Interfaces:
RuleProvider<SetPropertiesRule>
public final class SetPropertiesBuilder extends AbstractBackToLinkedRuleBuilder<SetPropertiesRule>
Builder chained when invokingLinkedRuleBuilder.setProperties()
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
aliases
private boolean
ignoreMissingProperty
-
Constructor Summary
Constructors Constructor Description SetPropertiesBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AddAliasBuilder<SetPropertiesBuilder>
addAlias(java.lang.String attributeName)
Add an additional attribute name to property name mapping.SetPropertiesBuilder
addAlias(java.lang.String attributeName, java.lang.String propertyName)
Deprecated.protected SetPropertiesRule
createRule()
Provides an instance ofRule
.SetPropertiesBuilder
ignoreAttribute(java.lang.String attributeName)
Add an attribute name to the ignore list.SetPropertiesBuilder
ignoreMissingProperty(boolean ignoreMissingProperty)
Sets whether attributes found in the XML without matching properties should be ignored.-
Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
-
-
-
Constructor Detail
-
SetPropertiesBuilder
SetPropertiesBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder)
-
-
Method Detail
-
addAlias
@Deprecated public SetPropertiesBuilder addAlias(java.lang.String attributeName, java.lang.String propertyName)
Deprecated.Add an additional attribute name to property name mapping.- Parameters:
attributeName
- The attribute to matchpropertyName
- The java bean property to be assigned the value- Returns:
- this builder instance
-
addAlias
public AddAliasBuilder<SetPropertiesBuilder> addAlias(java.lang.String attributeName)
Add an additional attribute name to property name mapping.- Parameters:
attributeName
- The attribute to match- Returns:
- the property alias builder
- Since:
- 3.2
-
ignoreAttribute
public SetPropertiesBuilder ignoreAttribute(java.lang.String attributeName)
Add an attribute name to the ignore list.- Parameters:
attributeName
- The attribute to match has to be ignored- Returns:
- this builder instance
-
ignoreMissingProperty
public SetPropertiesBuilder ignoreMissingProperty(boolean ignoreMissingProperty)
Sets whether attributes found in the XML without matching properties should be ignored. If set to false, the parsing will throw anNoSuchMethodException
if an unmatched attribute is found. This allows to trap misspellings in the XML file.- Parameters:
ignoreMissingProperty
- false to stop the parsing on unmatched attributes- Returns:
- this builder instance
-
createRule
protected SetPropertiesRule createRule()
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<SetPropertiesRule>
- Returns:
- an instance of
Rule
. - See Also:
AbstractBackToLinkedRuleBuilder.get()
-
-