java.lang.Objectorg.apache.commons.digester.Rule
org.apache.commons.digester.SetPropertiesRule
Rule implementation that sets properties on the object at the top of the stack, based on attributes with corresponding names.
This rule supports custom mapping of attribute names to property names. The default mapping for particular attributes can be overridden by using #SetPropertiesRule(String[] attributeNames, String[] propertyNames) . This allows attributes to be mapped to properties with different names. Certain attributes can also be marked to be ignored.
| Fields inherited from org.apache.commons.digester.Rule: |
|---|
| digester, namespaceURI |
| Constructor: |
|---|
|
|
Convenience constructor overrides the mapping for just one property. For details about how this works, see #SetPropertiesRule(String[] attributeNames, String[] propertyNames) .
|
Constructor allows attribute->property mapping to be overriden. Two arrays are passed in. One contains the attribute names and the other the property names. The attribute name / property name pairs are match by position In order words, the first string in the attribute name list matches to the first string in the property name list and so on. If a property name is null or the attribute name has no matching property name, then this indicates that the attibute should be ignored. Example One The following constructs a rule that maps the Example Two The following constructs a rule that maps the
|
| Method from org.apache.commons.digester.SetPropertiesRule Summary: |
|---|
| addAlias, begin, isIgnoreMissingProperty, setIgnoreMissingProperty, toString |
| Methods from org.apache.commons.digester.Rule: |
|---|
| begin, begin, body, body, end, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.commons.digester.SetPropertiesRule Detail: |
|---|
Add an additional attribute name to property name mapping. This is intended to be used from the xml rules. |
|
Are attributes found in the xml without matching properties to be ignored?
If false, the parsing will interrupt with an |
NoSuchMethodException
if an unmatched
attribute is found. This allows to trap misspellings in the XML file. |
|