Class ContextBatch

java.lang.Object
com.atlassian.plugin.webresource.legacy.ContextBatch

public class ContextBatch extends Object
An intermediary object used for constructing and merging context batches. This is a bean that holds the different resources and parameters that apply to a particular batch. The batch can both include and exclude one or more contexts Resources are expected to be in dependency order, with no duplicates.
  • Constructor Details

    • ContextBatch

      public ContextBatch(List<String> contexts, Iterable<String> excludedContexts, Iterable<ModuleDescriptorStub> resources, boolean removeSuperResources)
      Parameters:
      contexts - the ordering of contexts is important since it determines the ordering of resources within a batch (which could be important for badly written Javascripts).
      excludedContexts - the ordering of excluded contexts is not important.
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • isRemoveSuperResources

      public boolean isRemoveSuperResources()
    • buildPluginResources

      public Iterable<PluginResource> buildPluginResources()
      Iterates over the batch parameters for the context and creates a ContextBatchPluginResource for each.

      It should be noted that the created ContextBatchPluginResource will not actually contain any DownloadableResource. The PluginResource created is primarily representing a URL to be used in constructing a particular resource/download reference.

      Returns:
      ContextBatchPluginResource instances, although containing no DownloadableResources.
    • getContexts

      public List<String> getContexts()
    • getExcludedContexts

      public Iterable<String> getExcludedContexts()
    • getResources

      public Iterable<ModuleDescriptorStub> getResources()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getKey

      public String getKey()