def __build_parser_for_fileobject_and_desiredtype(self, obj_on_filesystem: PersistedObject, object_typ: Type[T],<EOL>logger: Logger = None) -> Parser:
<EOL>object_type = get_base_generic_type(object_typ)<EOL>matching, no_type_match_but_ext_match, no_ext_match_but_type_match, no_match =self.find_all_matching_parsers(strict=self.is_strict, desired_type=object_type,<EOL>required_ext=obj_on_filesystem.ext)<EOL>matching_parsers = matching[<NUM_LIT:0>] + matching[<NUM_LIT:1>] + matching[<NUM_LIT:2>]<EOL>if len(matching_parsers) == <NUM_LIT:0>:<EOL><INDENT>if len(no_ext_match_but_type_match) > <NUM_LIT:0>:<EOL><INDENT>raise NoParserFoundForObjectExt.create(obj_on_filesystem, object_type,<EOL>set([ext_ for ext_set in<EOL>[p.supported_exts for p in no_ext_match_but_type_match]<EOL>for ext_ in ext_set]))<EOL><DEDENT>else:<EOL><INDENT>raise NoParserFoundForObjectType.create(obj_on_filesystem, object_type,<EOL>set([typ_ for typ_set in<EOL>[p.supported_types for p in no_type_match_but_ext_match]<EOL>for typ_ in typ_set]))<EOL><DEDENT><DEDENT>elif len(matching_parsers) == <NUM_LIT:1>:<EOL><INDENT>return matching_parsers[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return CascadingParser(list(reversed(matching_parsers)))<EOL><DEDENT>
Builds from the registry, a parser to parse object obj_on_filesystem as an object of type object_type.

To do that, it iterates through all registered parsers in the list in reverse order (last inserted first),
and checks if they support the provided object format (single or multifile) and type.
If several parsers match, it returns a cascadingparser that will try them in order.

:param obj_on_filesystem:
:param object_typ:
:param logger:
:return: