'@param types: list of field types, in order of declaration
@type  types: [str]
@param names: list of field names, in order of declaration
@type  names: [str]
@param constants: Constant declarations
@type  constants: [L{Constant}]
@param text: text of declaration
@type  text: str
@raise MsgSpecException: if spec is invalid (e.g. fields with the same name)'

def __init__(self, types, names, constants, text, full_name='', short_name='', package=''):

    self.types = types
    if (len(set(names)) != len(names)):
        raise MsgSpecException(('Duplicate    field    names    in    message:    %s' % names))
    self.names = names
    self.constants = constants
    assert (len(self.types) == len(self.names)), ('len(%s)    !=    len(%s)' % (self.types, self.names))
    if len(self.types):
        self.header_present = (is_header_type(self.types[0]) and (self.names[0] == 'header'))
    else:
        self.header_present = False
    self.text = text
    self.full_name = full_name
    self.short_name = short_name
    self.package = package
    self._parsed_fields = [Field(name, type) for (name, type) in zip(self.names, self.types)]
