public class DefaultAssetRegistry extends java.lang.Object implements AssetRegistry
Constructor and Description |
---|
DefaultAssetRegistry(org.bladerunnerjs.model.AssetContainer assetContainer) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Asset> |
discoverFurtherAssets(MemoizedFile dir,
java.lang.String requirePrefix,
java.util.List<Asset> implicitDependencies)
The method retrieves the List of
Asset s identified by the AssetPlugins available for the current AssetContainer ,
specified by a MemoizedFile . |
Asset |
getRegisteredAsset(java.lang.String requirePath)
The method retrieves the registered
Asset identified by the specified require path within the current registry. |
java.util.Set<Asset> |
getRegisteredAssets()
Returns all Assets registered with the Asset registry
|
java.util.Set<LinkedAsset> |
getRegisteredSeedAssets()
Returns all Assets registered as seed assets with the Asset registry
|
boolean |
hasRegisteredAsset(java.lang.String requirePath)
The method verifies whether the specified require path is the valid require path for one of its registered assets.
|
boolean |
hasSeedAsset(java.lang.String requirePath)
The method verifies whether the specified require path is the valid require path for one of its seed assets.
|
void |
promoteRegisteredAssetToSeed(LinkedAsset asset)
The method adds an already registered
LinkedAsset to the list of seed assets. |
void |
registerAsset(Asset asset)
The method registers the specified
LinkedAsset by adding it to the assets for the current directory, provided it has not been
registered beforehand. |
void |
registerSeedAsset(LinkedAsset asset)
The method adds the specified
LinkedAsset to the existing list of seed assets. |
public DefaultAssetRegistry(org.bladerunnerjs.model.AssetContainer assetContainer)
public void registerSeedAsset(LinkedAsset asset)
AssetRegistry
LinkedAsset
to the existing list of seed assets.registerSeedAsset
in interface AssetRegistry
asset
- a LinkedAsset object that will be added to the existing list of seed assetspublic void promoteRegisteredAssetToSeed(LinkedAsset asset)
AssetRegistry
LinkedAsset
to the list of seed assets.promoteRegisteredAssetToSeed
in interface AssetRegistry
asset
- an already registered LinkedAsset object that will be added to the list of seed assetspublic void registerAsset(Asset asset)
AssetRegistry
LinkedAsset
by adding it to the assets for the current directory, provided it has not been
registered beforehand.registerAsset
in interface AssetRegistry
asset
- a LinkedAsset object that will be registered by adding it to the assets for the current directorypublic boolean hasSeedAsset(java.lang.String requirePath)
AssetRegistry
hasSeedAsset
in interface AssetRegistry
requirePath
- a String object that will be verified to establish whether it denotes an Asset part of the seed assets for the registry.public boolean hasRegisteredAsset(java.lang.String requirePath)
AssetRegistry
hasRegisteredAsset
in interface AssetRegistry
requirePath
- a String object that will be verified to establish whether it denotes an Asset part of the registered assets
for the registry.public Asset getRegisteredAsset(java.lang.String requirePath)
AssetRegistry
Asset
identified by the specified require path within the current registry.getRegisteredAsset
in interface AssetRegistry
requirePath
- a String object that will determine which Asset will be retrievedpublic java.util.Set<Asset> getRegisteredAssets()
AssetRegistry
getRegisteredAssets
in interface AssetRegistry
public java.util.Set<LinkedAsset> getRegisteredSeedAssets()
AssetRegistry
getRegisteredSeedAssets
in interface AssetRegistry
public java.util.List<Asset> discoverFurtherAssets(MemoizedFile dir, java.lang.String requirePrefix, java.util.List<Asset> implicitDependencies)
AssetRegistry
Asset
s identified by the AssetPlugins available for the current AssetContainer
,
specified by a MemoizedFile
.discoverFurtherAssets
in interface AssetRegistry
dir
- a MemoizedFile object specifying the assetContainer for which the AssetPlugins will be determinedrequirePrefix
- a String object specifying what require prefix the newly discovered Assets should adhere toimplicitDependencies
- a List of Assets specifying the already determined implicit dependencies for the container