'use strict';
var isA = require("Espresso/oop").isA;
var oop = require("Espresso/oop").oop;
var init = require("Espresso/oop").init;

var trim = require("Espresso/trim").trim;
var isA = require("Espresso/oop").isA;

var oop = require("Espresso/oop").oop;

var ScalarNode = require("Espresso/Config/Definition/ScalarNode");
var InvalidTypeException = require("Espresso/Config/Definition/Exception/InvalidTypeException");
var format = require("util").format;

function BooleanNode(name,parent){
	init(this,ScalarNode,name,parent);
	
	oop(this,"Espresso/Config/Definition/BooleanNode");
}

/**
 * {@inheritdoc}
 */
function validateType($value)
{
    if ( typeof $value !== 'boolean') {
        var $ex = new InvalidTypeException(format(
            'Invalid type for path "%s". Expected boolean, but got %s.',
            this.getPath(),
            getClass($value)
        ));
        var $hint = this.getInfo();
        if ($hint) {
            $ex.addHint($hint);
        }
        $ex.setPath(this.getPath());

        throw $ex;
    }
}

/**
 * {@inheritdoc}
 */
function isValueEmpty($value)



BooleanNode.prototype = Object.create( ScalarNode.prototype );
BooleanNode.prototype.validateType = validateType;
BooleanNode.prototype.isValueEmpty = isValueEmpty;

module.exports = BooleanNode;

{
    // a boolean value cannot be empty
    return false;
}