public class DefaultResourceManagerBackend extends java.lang.Object implements ResourceManagerBackend
| Constructor and Description |
|---|
DefaultResourceManagerBackend() |
| Modifier and Type | Method and Description |
|---|---|
Resource |
create(ResourceManager frontEnd,
ResourceData data,
ResourceKey context,
java.lang.Class[] target) |
ResourceKey |
createKey(java.lang.Object data,
java.util.Map parameters) |
ResourceKey |
deriveKey(ResourceKey parent,
java.lang.String path,
java.util.Map parameters)
Derives a new key from the given resource-key.
|
ResourceKey |
deserialize(ResourceKey bundleKey,
java.lang.String serializedKey)
Converts a serialized version of a
ResourceKey into an actual ResourceKey
by locating the proper ResourceLoader that can perform the deserialization. |
boolean |
isResourceUnchanged(ResourceManager frontEnd,
Resource resource) |
ResourceData |
loadRawData(ResourceManager frontEnd,
ResourceKey key) |
ResourceBundleData |
loadResourceBundle(ResourceManager frontEnd,
ResourceKey key)
Tries to find the first resource-bundle-loader that would be able to process the key.
|
void |
registerBundleLoader(ResourceBundleLoader loader) |
void |
registerDefaultFactories() |
void |
registerDefaultLoaders() |
void |
registerFactory(ResourceFactory factory) |
void |
registerLoader(ResourceLoader loader) |
java.lang.String |
serialize(ResourceKey bundleKey,
ResourceKey key)
Creates a String version of the
ResourceKey that can be deserialized with the
deserialize() method. |
java.net.URL |
toURL(ResourceKey key) |
public ResourceKey createKey(java.lang.Object data, java.util.Map parameters) throws ResourceKeyCreationException
createKey in interface ResourceManagerBackendResourceKeyCreationExceptionpublic ResourceKey deriveKey(ResourceKey parent, java.lang.String path, java.util.Map parameters) throws ResourceKeyCreationException
deriveKey in interface ResourceManagerBackendparent - the parent key, or null to interpret the path as absolute key.path - the relative path, that is used to derive the key.parameters - a optional map containing resource-key parameters.ResourceKeyCreationException - if deriving the key failed.public java.net.URL toURL(ResourceKey key)
toURL in interface ResourceManagerBackendpublic Resource create(ResourceManager frontEnd, ResourceData data, ResourceKey context, java.lang.Class[] target) throws ResourceLoadingException, ResourceCreationException
create in interface ResourceManagerBackendResourceLoadingExceptionResourceCreationExceptionpublic boolean isResourceUnchanged(ResourceManager frontEnd, Resource resource) throws ResourceLoadingException
isResourceUnchanged in interface ResourceManagerBackendResourceLoadingExceptionpublic ResourceBundleData loadResourceBundle(ResourceManager frontEnd, ResourceKey key) throws ResourceLoadingException
loadResourceBundle in interface ResourceManagerBackendkey - the resource-key.ResourceLoadingException - if an error occured.public ResourceData loadRawData(ResourceManager frontEnd, ResourceKey key) throws UnrecognizedLoaderException, ResourceLoadingException
loadRawData in interface ResourceManagerBackendUnrecognizedLoaderExceptionResourceLoadingExceptionpublic void registerDefaultFactories()
registerDefaultFactories in interface ResourceManagerBackendpublic void registerDefaultLoaders()
registerDefaultLoaders in interface ResourceManagerBackendpublic void registerBundleLoader(ResourceBundleLoader loader)
registerBundleLoader in interface ResourceManagerBackendpublic void registerLoader(ResourceLoader loader)
registerLoader in interface ResourceManagerBackendpublic void registerFactory(ResourceFactory factory)
registerFactory in interface ResourceManagerBackendpublic ResourceKey deserialize(ResourceKey bundleKey, java.lang.String serializedKey) throws ResourceKeyCreationException
ResourceKey into an actual ResourceKey
by locating the proper ResourceLoader that can perform the deserialization.deserialize in interface ResourceManagerBackendbundleKey - serializedKey - the String serialized key to be deserialized @returns the ResourceKey that has been deserializedResourceKeyCreationExceptionpublic java.lang.String serialize(ResourceKey bundleKey, ResourceKey key) throws ResourceException
ResourceKey that can be deserialized with the
deserialize() method.serialize in interface ResourceManagerBackendbundleKey - key - @throw ResourceException indicates an error trying to serialize the keyResourceException