org.apache.wicket.resource.aggregation
Class ResourceReferenceAndStringData

java.lang.Object
  extended by org.apache.wicket.resource.aggregation.ResourceReferenceAndStringData

public class ResourceReferenceAndStringData
extends Object

A data holder built for the AbstractResourceAggregatingHeaderResponse that groups the resource reference with a boolean representing whether it is css (or, if not, it is js), and the string that was passed in to the responsible render*Reference method (for JS, this is ID, for CSS, this is media). It acts as a temporary data holder while the IHeaderContributors are being called so that at the end of their traversal, we can render these references in an aggregated way, and still have the appropriate data (i.e. was it CSS or JS) to render it properly.

Author:
Jeremy Thomerson

Constructor Summary
ResourceReferenceAndStringData(CharSequence content, AbstractResourceDependentResourceReference.ResourceType type, String idOrMedia)
          Construct.
ResourceReferenceAndStringData(ResourceReference reference, PageParameters parameters, String url, String idOrMedia, AbstractResourceDependentResourceReference.ResourceType type, boolean jsDefer, String charset, String cssCondition)
          Construct.
ResourceReferenceAndStringData(ResourceReference reference, String idOrMedia, boolean isCss)
          Deprecated. use the other constructors instead
 
Method Summary
 boolean equals(Object obj)
           
 String getCharset()
           
 CharSequence getContent()
           
 String getCssCondition()
           
 String getIdOrMedia()
           
 PageParameters getParameters()
           
 ResourceReference getReference()
           
 AbstractResourceDependentResourceReference.ResourceType getResourceType()
           
 String getString()
          Deprecated. use getIdOrMedia() instead
 String getUrl()
           
 int hashCode()
           
 boolean isCss()
          Deprecated. Use getResourceType() instead.
 boolean isJsDefer()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceReferenceAndStringData

public ResourceReferenceAndStringData(ResourceReference reference,
                                      PageParameters parameters,
                                      String url,
                                      String idOrMedia,
                                      AbstractResourceDependentResourceReference.ResourceType type,
                                      boolean jsDefer,
                                      String charset,
                                      String cssCondition)
Construct.

Parameters:
reference -
parameters -
url -
idOrMedia -
type -
jsDefer -
charset -
cssCondition -

ResourceReferenceAndStringData

@Deprecated
public ResourceReferenceAndStringData(ResourceReference reference,
                                                 String idOrMedia,
                                                 boolean isCss)
Deprecated. use the other constructors instead

Construct.

Parameters:
reference -
idOrMedia -
isCss -

ResourceReferenceAndStringData

public ResourceReferenceAndStringData(CharSequence content,
                                      AbstractResourceDependentResourceReference.ResourceType type,
                                      String idOrMedia)
Construct.

Parameters:
content -
type -
idOrMedia -
Method Detail

getReference

public ResourceReference getReference()
Returns:
the resource reference that the user rendered

getParameters

public PageParameters getParameters()
Returns:
the parameters for the resource reference

getUrl

public String getUrl()
Returns:
the resource reference that the user rendered

getIdOrMedia

public String getIdOrMedia()
Returns:
the string representing media (if this isCss()), or id (if not, meaning it's js)

getString

@Deprecated
public String getString()
Deprecated. use getIdOrMedia() instead

Returns:
the string representing media (if this isCss()), or id (if not, meaning it's js)

isCss

@Deprecated
public boolean isCss()
Deprecated. Use getResourceType() instead.

Returns:
true if this is css, false if it's js

getResourceType

public AbstractResourceDependentResourceReference.ResourceType getResourceType()
Returns:
the type of the resource

isJsDefer

public boolean isJsDefer()
Returns:
whether the script should be deferred

getCharset

public String getCharset()
Returns:
the charset to use when loading the script

getCssCondition

public String getCssCondition()
Returns:
the IE CSS condition

getContent

public CharSequence getContent()
Returns:
inline content of CSS or JS contribution

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006–2015 Apache Software Foundation. All rights reserved.