Package com.helger.photon.app.html
Class PhotonJS
java.lang.Object
com.helger.photon.app.html.PhotonJS
This class keeps track of all the JS files that must be included globally for
a single request.
- Author:
- Philip Helger
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void_readJSIncludes(com.helger.commons.io.resource.IReadableResource aRes, JSResourceSet aTarget) static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.js.IJSPathProvider>static voidgetAllRegisteredJSIncludesForGlobal(Collection<? super com.helger.html.resource.js.IJSPathProvider> aTarget) static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.js.IJSPathProvider>static voidgetAllRegisteredJSIncludesForThisRequest(Collection<? super com.helger.html.resource.js.IJSPathProvider> aTarget) static booleanstatic booleanstatic voidreadJSIncludesForGlobal(com.helger.commons.io.resource.IReadableResource aRes) static voidregisterJSIncludeForGlobal(int nIndex, com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item for global scope.static voidregisterJSIncludeForGlobal(com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item for global scope.static voidregisterJSIncludeForThisRequest(com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item only for this requeststatic voidUnregister all existing JS items from global scope.static voidUnregister all existing JS items from this requeststatic voidunregisterJSIncludeForGlobal(com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Unregister an existing JS item for global scope.static voidunregisterJSIncludeFromThisRequest(com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Unregister a existing JS item only from this request
-
Field Details
-
DEFAULT_FILENAME
- See Also:
-
-
Method Details
-
_readJSIncludes
public static void _readJSIncludes(@Nonnull com.helger.commons.io.resource.IReadableResource aRes, @Nonnull JSResourceSet aTarget) -
readJSIncludesForGlobal
public static void readJSIncludesForGlobal(@Nonnull com.helger.commons.io.resource.IReadableResource aRes) -
registerJSIncludeForGlobal
public static void registerJSIncludeForGlobal(@Nonnull com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item for global scope.- Parameters:
aJSPathProvider- The JS path provider to use. May not benull.
-
registerJSIncludeForGlobal
public static void registerJSIncludeForGlobal(int nIndex, @Nonnull com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item for global scope.- Parameters:
nIndex- The index to be used. If the value is < 0 the value is ignored and item is appended.aJSPathProvider- The JS path provider to use. May not benull.
-
unregisterJSIncludeForGlobal
public static void unregisterJSIncludeForGlobal(@Nonnull com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Unregister an existing JS item for global scope.- Parameters:
aJSPathProvider- The JS path provider to use. May not benull.
-
unregisterAllJSIncludesFromGlobal
public static void unregisterAllJSIncludesFromGlobal()Unregister all existing JS items from global scope. -
getAllRegisteredJSIncludesForGlobal
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.js.IJSPathProvider> getAllRegisteredJSIncludesForGlobal()- Returns:
- A non-
nullset with all JS paths to be included globally.
-
getAllRegisteredJSIncludesForGlobal
public static void getAllRegisteredJSIncludesForGlobal(@Nonnull Collection<? super com.helger.html.resource.js.IJSPathProvider> aTarget) -
hasRegisteredJSIncludesForGlobal
public static boolean hasRegisteredJSIncludesForGlobal()- Returns:
trueif at least a single JS path has been registered globally.
-
registerJSIncludeForThisRequest
public static void registerJSIncludeForThisRequest(@Nonnull com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Register a new JS item only for this request- Parameters:
aJSPathProvider- The JS path provider to use. May not benull.
-
unregisterJSIncludeFromThisRequest
public static void unregisterJSIncludeFromThisRequest(@Nonnull com.helger.html.resource.js.IJSPathProvider aJSPathProvider) Unregister a existing JS item only from this request- Parameters:
aJSPathProvider- The JS path provider to use. May not benull.
-
unregisterAllJSIncludesFromThisRequest
public static void unregisterAllJSIncludesFromThisRequest()Unregister all existing JS items from this request -
getAllRegisteredJSIncludesForThisRequest
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedSet<com.helger.html.resource.js.IJSPathProvider> getAllRegisteredJSIncludesForThisRequest()- Returns:
- A non-
nullset with all JS paths to be included in this request.
-
getAllRegisteredJSIncludesForThisRequest
public static void getAllRegisteredJSIncludesForThisRequest(@Nonnull Collection<? super com.helger.html.resource.js.IJSPathProvider> aTarget) -
hasRegisteredJSIncludesForThisRequest
public static boolean hasRegisteredJSIncludesForThisRequest()- Returns:
trueif at least a single JS path has been registered for this request only
-