StringAssetLocator
class StringAssetLocator
Implements: IAssetLocator
Package: dev.joid.lib.asset.locator.impl · Module: core · Source: StringAssetLocator.java
The built-in locator that turns a String into a URL, classpath or file asset.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| StringAssetLocator() | Creates the locator. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
boolean | supports(Object handle) | If true, handle is a String. |
Asset | locate(Object handle) | Returns a UrlAsset for a text that starts with a scheme of two letters or more (https:, file:, jar:), otherwise a ClasspathAsset when the classpath has the path, with or without a leading /, otherwise a FileAsset when the path is a file on disk. |
Creation details
Section titled “Creation details”StringAssetLocator
Section titled “StringAssetLocator”StringAssetLocator()
Creates the locator.
Method details
Section titled “Method details”supports
Section titled “supports”boolean supports(Object handle)
If true, handle is a String.
locate
Section titled “locate”Asset locate(Object handle)
Throws:
IllegalArgumentException: The asset … is not found in the classpath nor as a file, check the path or give a URL with its scheme (https:, file:, jar:)
Returns a UrlAsset for a text that starts with a scheme of two letters or more (https:, file:, jar:), otherwise a ClasspathAsset when the classpath has the path, with or without a leading /, otherwise a FileAsset when the path is a file on disk.
Throws IllegalArgumentException when the path is found nowhere.
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
