Class: OpenSearchParserRegistry

OpenSearchParserRegistry()

Provides a parser registry. Parsers are stored for the provided mime type and relation. The mime type indicates the file format that the parser can handle. The relation specifies the role of the resource being parsed, and as specified in the description document. Services can register or retrieve a parser by specifying the mime type and relation.

Constructor

new OpenSearchParserRegistry()

Constructs a parser registry.
Source:

Methods

getFormats() → {Array.<String>}

Returns a list with the supported mime types.
Source:
Returns:
The list of supported mime types.
Type
Array.<String>

getParser(type, rel) → {Object|undefined}

Returns the parser for the specified mime type and relation.
Parameters:
Name Type Description
type String Mime type of the parser.
rel String Relation type of the parser.
Source:
Returns:
The parser.
Type
Object | undefined

registerParser(type, rel, parser)

Registers a parser for the specified mime type and relation. The parse method of the parser will be called with the response of the server when the mime type and relation type matches.
Parameters:
Name Type Description
type String Mime type of the parser to register.
rel String Relation type of the parser to register.
parser Object An object with a parse method.
Source:

removeParser(type, rel)

Removes a parser for the specified mime type and relation.
Parameters:
Name Type Description
type String Mime type of the registered parser.
rel String Relation type of the registered parser.
Source: