public interface Asset
Modifier and Type | Method and Description |
---|---|
org.bladerunnerjs.model.AssetContainer |
assetContainer()
The method returns the AssetContainer in which the Asset is contained.
|
MemoizedFile |
file()
The method returns a
MemoizedFile object that provides similar methods to File and wraps a File object. |
java.lang.String |
getAssetName()
The method returns the name of the Asset file.
|
java.lang.String |
getAssetPath()
The method returns the path to the Asset relative to the
App that comprises it. |
java.lang.String |
getPrimaryRequirePath()
The method returns the primary require path to the Asset, which is calculated based on the require prefix of its
AssetContainer
and the Asset name. |
java.io.Reader |
getReader()
The method returns a
Reader object for obtaining the content of the Asset. |
java.util.List<java.lang.String> |
getRequirePaths()
The method returns the available require paths to the Asset.
|
boolean |
isRequirable()
BRJS distinguishes between Assets that may be required and those that may not.
|
boolean |
isScopeEnforced()
In order to encourage modularity, BRJS does not allow lower level entities to depend on higher level entities.
|
java.io.Reader getReader() throws java.io.IOException
Reader
object for obtaining the content of the Asset.java.io.IOException
- if there are any exceptions while creating the ReaderMemoizedFile file()
MemoizedFile
object that provides similar methods to File and wraps a File object.
Several of the methods' return values are 'memoized' and only regenerated if properties on the underlying file on disk change.
Changes are detected by using MemoizedValue
and the FileModificationRegistry
.java.lang.String getAssetName()
java.lang.String getAssetPath()
App
that comprises it.java.util.List<java.lang.String> getRequirePaths()
java.lang.String getPrimaryRequirePath()
AssetContainer
and the Asset name.org.bladerunnerjs.model.AssetContainer assetContainer()
Aspect
, a Workbench
,
a TestPack
, a Blade
, a Bladeset
or a library.boolean isScopeEnforced()
AssetContainer
basis. The method returns true if the scope is enforced, meaning that warnings about such out of scope require paths
will be logged, or false, if these will be ignored and retrieved.boolean isRequirable()