Class ResourceIdentifier

java.lang.Object
org.omnifaces.resourcehandler.ResourceIdentifier

public class ResourceIdentifier extends Object
Convenience class to represent a resource identifier.
Since:
1.3
Author:
Bauke Scholtz
  • Constructor Details

    • ResourceIdentifier

      public ResourceIdentifier(String resourceIdentifier)
      Create a new instance based on given standard Faces resource identifier string format library:name.
      Parameters:
      resourceIdentifier - The standard Faces resource identifier.
    • ResourceIdentifier

      public ResourceIdentifier(UIComponent componentResource)
      Create a new instance based on library and name attributes of the given component resource.
      Parameters:
      componentResource - The component resource.
    • ResourceIdentifier

      public ResourceIdentifier(String library, String name)
      Create a new instance based on given resource library and name.
      Parameters:
      library - The resource lirbary.
      name - The resource name.
    • ResourceIdentifier

      public ResourceIdentifier(Resource resource)
      Create a new instance based on given resource.
      Parameters:
      resource - The resource.
      Since:
      3.13
  • Method Details

    • getLibrary

      public String getLibrary()
      Returns the resource library.
      Returns:
      The resource library.
    • getName

      public String getName()
      Returns the resource name.
      Returns:
      The resource name.
    • getIntegrity

      public String getIntegrity(FacesContext context)
      Returns the resource integrity as base64 encoded sha384 hash. This is lazily computed and will return an empty string when the integrity could not be computed. The reason for the compute failure will be logged as WARNING.
      Returns:
      The resource integrity as base64 encoded sha384 hash.
      Since:
      3.13
    • equals

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

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

      public String toString()
      Returns the resource identifier as string in standard Faces resource identifier format library:name. If there is no library, then only the name is returned without the colon separator like so name.
      Overrides:
      toString in class Object