'Returns a human-readable string representation of the constant pool
entry.  It is used for pretty-printing of the CPIndex fields pointing
to it.'

def __str__(self):

    if (self.constant_type == 'Utf8'):
        return self['bytes'].value
    elif (self.constant_type in ('Integer', 'Float', 'Long', 'Double')):
        return self['bytes'].display
    elif (self.constant_type == 'Class'):
        class_name = str(self['name_index'].get_cp_entry())
        return class_name.replace('/', '.')
    elif (self.constant_type == 'String'):
        return str(self['string_index'].get_cp_entry())
    elif (self.constant_type == 'Fieldref'):
        return ('%s    (from    %s)' % (self['name_and_type_index'], self['class_index']))
    elif (self.constant_type == 'Methodref'):
        return ('%s    (from    %s)' % (self['name_and_type_index'], self['class_index']))
    elif (self.constant_type == 'InterfaceMethodref'):
        return ('%s    (from    %s)' % (self['name_and_type_index'], self['class_index']))
    elif (self.constant_type == 'NameAndType'):
        return parse_any_descriptor(str(self['descriptor_index'].get_cp_entry()), name=str(self['name_index'].get_cp_entry()))
    else:
        raise ParserError(('Not    a    valid    constant    pool    element    type:    ' + self['tag'].value))
