Skip to content

ResourceResolver

final class ResourceResolver
Package: dev.joid.lib.resource.resolver · Module: core · Source: ResourceResolver.java

The registry of resource resolvers that Resource.of(...) asks for inputs it cannot read itself.

It holds a TextureResourceResolver and a BufferedImageResourceResolver by default.

ReturnsSignatureSummary
voidregister(IResourceResolver resolver) staticRegisters a resolver before the others: the last registered is asked first.
voidunregister(IResourceResolver resolver) staticRemoves a resolver.
booleansupports(Object input) staticIf true, a registered resolver supports the input.
Resourceresolve(ResourceBuilder builder, Object input) staticReturns the resource of the first resolver that supports the input.

void register(IResourceResolver resolver) static

Registers a resolver before the others: the last registered is asked first.

void unregister(IResourceResolver resolver) static

Removes a resolver.

boolean supports(Object input) static

If true, a registered resolver supports the input.

Resource resolve(ResourceBuilder builder, Object input) static

Throws:

  • IllegalArgumentException: No resource resolver knows the input … of type …, register an IResourceResolver that supports it with ResourceResolver.register(…)

Returns the resource of the first resolver that supports the input. Throws an IllegalArgumentException that names the type of the input when none supports it.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page