Class TryCatchJsResourceContentAnnotator
java.lang.Object
com.atlassian.plugin.webresource.impl.annotators.ResourceContentAnnotator
com.atlassian.plugin.webresource.impl.annotators.TryCatchJsResourceContentAnnotator
This should only be used for annotating Javascript resources. It will wrap each Javascript resource
in a try/catch block with console logging in the catch.
This implementation is stateless.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterResourceInBatch(LinkedHashSet<String> requiredResources, Resource resource, Map<String, String> params, OutputStream stream) Called after the resource content is written in batch.intbeforeAllResourcesInBatch(LinkedHashSet<String> requiredResources, String url, Map<String, String> params, OutputStream stream) Called before all content is written in batch.intbeforeResourceInBatch(LinkedHashSet<String> requiredResources, Resource resource, Map<String, String> params, OutputStream stream) Called before the resource content is written in batch.inthashCode()Produce a hash for this instance.Methods inherited from class com.atlassian.plugin.webresource.impl.annotators.ResourceContentAnnotator
afterAllResourcesInBatch, afterResource, beforeResource
-
Field Details
-
CATCH_BLOCK
- See Also:
-
-
Constructor Details
-
TryCatchJsResourceContentAnnotator
public TryCatchJsResourceContentAnnotator()
-
-
Method Details
-
beforeResourceInBatch
public int beforeResourceInBatch(LinkedHashSet<String> requiredResources, Resource resource, Map<String, String> params, OutputStream stream) throws IOExceptionDescription copied from class:ResourceContentAnnotatorCalled before the resource content is written in batch.- Overrides:
beforeResourceInBatchin classResourceContentAnnotator- Returns:
- amount of lines the annotator adds to the source, used for source map generation.
- Throws:
IOException- if there is a problem writing the annotation.
-
afterResourceInBatch
public void afterResourceInBatch(LinkedHashSet<String> requiredResources, Resource resource, Map<String, String> params, OutputStream stream) throws IOExceptionDescription copied from class:ResourceContentAnnotatorCalled after the resource content is written in batch.- Overrides:
afterResourceInBatchin classResourceContentAnnotator- Throws:
IOException- if there is a problem writing the annotation.
-
beforeAllResourcesInBatch
public int beforeAllResourcesInBatch(LinkedHashSet<String> requiredResources, String url, Map<String, String> params, OutputStream stream) throws IOExceptionDescription copied from class:ResourceContentAnnotatorCalled before all content is written in batch.- Overrides:
beforeAllResourcesInBatchin classResourceContentAnnotator- Returns:
- amount of lines the annotator adds to the source, used for source map generation.
- Throws:
IOException
-
hashCode
public int hashCode()Description copied from class:ResourceContentAnnotatorProduce a hash for this instance. Should be stable across jvms.- Specified by:
hashCodein classResourceContentAnnotator
-