All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.agimatec.commons.config.sax.BooleanHandler Maven / Gradle / Ivy

There is a newer version: 2.5.27
Show newest version
package com.agimatec.commons.config.sax;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

/**
 * Title:
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:
 *
 * @author Roman Stumm
 */
class BooleanHandler extends PrimNodeHandler {

    public BooleanHandler(final String aTag) {
        super(aTag);
    }

    protected Class getInstanceClass() {
        return Boolean.class;
    }

    protected Object startNode(final Attributes attr) throws SAXException {
        final String value = getValue(attr);
        return Boolean.valueOf(value != null &&
                ("true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy