'Validate string property.
Returns:
A valid value.
Raises:
BadValueError if property is not multi-line but value is.'

def validate(self, value):

    value = super(StringProperty, self).validate(value)
    if ((value is not None) and (not isinstance(value, basestring))):
        raise BadValueError(('Property    %s    must    be    a    str    or    unicode    instance,    not    a    %s' % (self.name, type(value).__name__)))
    if ((not self.multiline) and value and (value.find('\n') != (-1))):
        raise BadValueError(('Property    %s    is    not    multi-line' % self.name))
    if ((value is not None) and (len(value) > self.MAX_LENGTH)):
        raise BadValueError(('Property    %s    is    %d    bytes    long;    it    must    be    %d    or    less.' % (self.name, len(value), self.MAX_LENGTH)))
    return value
