# ResourceParser

Interface · category: Other

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/framework/handlers/handler.js#L39

## Properties

### canParse

```ts
canParse: (context: ParserContext) => boolean
```

Returns true if this parser can handle the
described resource. Parsers are consulted newest-first; the first to return true is used.

### handler

```ts
handler?: ResourceHandler
```

Assigned by the owning handler on registration; available in
`load`/`open` (for example `this.handler.fetch(...)`).

### load

```ts
load: (url: string | { load: string; original: string }, callback: ResourceHandlerCallback, asset?: Asset<string>) => void
```

Fetches (typically via `this.handler.fetch`) and produces the resource, then invokes the callback.

### open

```ts
open?: (url: string, data: any, asset?: Asset<string>) => any
```

Optional. Called by the default
[ResourceHandler#open](https://api.playcanvas.com/engine/classes/ResourceHandler.md#open) when parsers are registered. Handlers that override `open` may call
it with an extended signature - for example the texture handler calls
`open(url, data, device, textureOptions)` on its parsers.
