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

MockReader

public class MockReader extends Object implements XMLReader
A helper class that implements the SAX XMLReader interface and logs method calls.

Fields Summary
private MethodLogger
logger
private ContentHandler
contentHandler
private DTDHandler
dtdHandler
private EntityResolver
resolver
private ErrorHandler
errorHandler
private Set
features
private Map
properties
Constructors Summary
public MockReader(MethodLogger logger)

    
       
        super();
        this.logger = logger;
    
Methods Summary
public org.xml.sax.ContentHandlergetContentHandler()

        return contentHandler;
    
public org.xml.sax.DTDHandlergetDTDHandler()

        return dtdHandler;
    
public org.xml.sax.EntityResolvergetEntityResolver()

        return resolver;
    
public org.xml.sax.ErrorHandlergetErrorHandler()

        return errorHandler;
    
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 voidsetContentHandler(org.xml.sax.ContentHandler handler)

        this.contentHandler = handler;
    
public voidsetDTDHandler(org.xml.sax.DTDHandler handler)

        this.dtdHandler = handler;
    
public voidsetEntityResolver(org.xml.sax.EntityResolver resolver)

        this.resolver = resolver;
    
public voidsetErrorHandler(org.xml.sax.ErrorHandler handler)

        this.errorHandler = handler;
    
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);
        }