private function parseValue(
        $name,
        $value,
        $type,
        $translatable,
        SwatUIObject $object
    ) {
        switch ($type) {
            case 'string':
                return $this->translateValue($value, $translatable, $object);
            case 'boolean':
                return $value == 'true' ? true : false;
            case 'integer':
                return intval($value);
            case 'float':
                return floatval($value);
            case 'constant':
                return $this->parseConstantExpression($value, $object);
            case 'data':
                return $this->parseMapping($name, $value, $object);
            case 'date':
                return new SwatDate($value);
            case 'implicit-string':
                if ($value == 'false' || $value == 'true') {
                    trigger_error(
                        __CLASS__ .
                            ': Possible missing type="boolean" ' .
                            'attribute on property element',
                        E_USER_NOTICE
                    );
                }

                if (is_numeric($value)) {
                    trigger_error(
                        __CLASS__ .
                            ': Possible missing type="integer" ' .
                            ' or type="float" attribute on property element',
                        E_USER_NOTICE
                    );
                }

                return $this->translateValue($value, $translatable, $object);
            default:
                throw new SwatInvalidPropertyTypeException(
                    "Property type '{$type}' is not a recognized type " .
                        'but is used in SwatML.',
                    0,
                    $object,
                    $type
                );
        }
    }