Constructor
new OpenSearchParserRegistry()
Constructs a parser registry.
Methods
getFormats() → {Array.<String>}
Returns a list with the supported mime types.
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. |
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. |
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. |