Parser

From MightyWiki

Jump to: navigation, search

Parsers are objects that Item Sources use to resolve catalog entries into logical Item collections. Most item sources are quite simple and do not require parsers, but complex item sources such as the file system item source do use parsers. Parsers extend item sources by allowing them to index additional data, or index existing data differently.

Using the file system item source as an example, there exist several parsers that are in use by it. The most popular one is the MBDirectoryParser which is capable of scanning a directory tree, and index its files, with additional optional parameters. Another useful parser is the HTMLLinkParser that knows how to parse a HTML page into a list of link items.

Using Parsers are a great way to extend an existing item source. for example we can easily build a parser that will know how to read archive files, and by doing so allowing user to browse through an archived file contents.

Personal tools