FileDocCategorySizeDatePackage
SetAllPropertiesRule.javaAPI DocApache Tomcat 6.0.142481Fri Jul 20 04:20:36 BST 2007org.apache.catalina.startup

SetAllPropertiesRule

public class SetAllPropertiesRule extends org.apache.tomcat.util.digester.Rule
Rule that uses the introspection utils to set properties.
author
Remy Maucherat
author
Filip Hanik

Fields Summary
protected HashMap
excludes
Constructors Summary
public SetAllPropertiesRule()

public SetAllPropertiesRule(String[] exclude)

        for (int i=0; i<exclude.length; i++ ) if (exclude[i]!=null) this.excludes.put(exclude[i],exclude[i]);
    
Methods Summary
public voidbegin(java.lang.String namespace, java.lang.String nameX, org.xml.sax.Attributes attributes)
Handle the beginning of an XML element.

param
attributes The attributes of this element
exception
Exception if a processing error occurs


    // --------------------------------------------------------- Public Methods


                              
           
          

        for (int i = 0; i < attributes.getLength(); i++) {
            String name = attributes.getLocalName(i);
            if ("".equals(name)) {
                name = attributes.getQName(i);
            }
            String value = attributes.getValue(i);
            if ( !excludes.containsKey(name)) 
                IntrospectionUtils.setProperty(digester.peek(), name, value);
        }