public interface ResourceVerifier
Resource dependencies are added to the Faces view automatically when a Renderer
is
annotated with @ResourceDependency
. They can also be added manually by calling UIViewRoot.addComponentResource(FacesContext, UIComponent)
or UIViewRoot.addComponentResource(FacesContext, UIComponent, String)
.
In some situations, resource dependencies may already be satisfied (meaning they are guaranteed to appear on the page already, or are already provided as a resource with a different library name or resource name). When this happens it unnecessary to render the resource. For example, Liferay Portal includes Bootstrap CSS on the page automatically. It would therefore be unnecessary for Liferay Faces Alloy or BootsFaces to render a Bootstrap CSS resource. Another example would be when a developer uses BootsFaces and PrimeFaces components in the same view. Each of those component libraries add the jQuery JavaScript library as a dependency, but only one would need to be rendered.
Modifier and Type | Method and Description |
---|---|
boolean |
isDependencySatisfied(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent componentResource)
Determines whether or not a
ResourceDependency represented by a UIComponent has already been
satisfied. |
boolean isDependencySatisfied(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent componentResource)
ResourceDependency
represented by a UIComponent
has already been
satisfied.
Since the ResourceVerifier
utilizes the delegation pattern, if an implementation in the delegation
chain determines that a resource dependency has been satisfied, then it returns true
. Otherwise it
will return the value from the next member in the delegation chain. The default implementation returns
false
assuming that a resource dependency has not already been satisfied and therefore needs to be
rendered.
true
when the resource dependency is already satisfied, otherwise false
.Copyright © 2018 Liferay, Inc.. All rights reserved.