FileDocCategorySizeDatePackage
MockFilter.javaAPI DocAndroid 1.5 API2539Wed May 06 22:41:06 BST 2009tests.api.org.xml.sax.support

MockFilter

public class MockFilter extends XMLFilterImpl
A helper class that extends XMLFilterImpl, provides dummy feature/property management, and logs some method calls.

Fields Summary
private MethodLogger
logger
private Set
features
private Map
properties
Constructors Summary
public MockFilter(MethodLogger logger)

    
       
        super();
        this.logger = logger;
    
Methods Summary
public booleangetFeature(java.lang.String name)

        return features.contains(name);
    
public java.lang.ObjectgetProperty(java.lang.String name)

        return properties.get(name);
    
public voidparse(org.xml.sax.InputSource input)

        logger.add("parse", input);
    
public voidparse(java.lang.String systemId)

        logger.add("parse", systemId);
    
public voidsetFeature(java.lang.String name, boolean value)

        if (value) {
            features.add(name);
        } else {
            features.remove(name);
        }
    
public voidsetProperty(java.lang.String name, java.lang.Object value)

        if (value == null) {
            properties.remove(name);
        } else {
            properties.put(name, value);
        }