|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.util.template.TextTemplateSharedResourceFactory
public class TextTemplateSharedResourceFactory
A resource (reference) factory that takes a TextTemplate
and generates shared
resources for various interpolations of that template.
A scope for adding shared resources allows you to limit the namespace impact of the shared
resources created. If you omit the scope, the application-wide scope
Application.class
will be used by default.
You may use resources created by this factory directly by calling
resourceReference(Map)
to get a resource reference to the given shared resource
interpolation represented by the variables in the Map
. Or, for convenience, you can
use TextTemplateLink
to link to resources created by this factory.
In many cases, it will be useful to extend this class and override
sharedResourceName(Map)
in order to provide a unique name for resources created by
the factory using map values. If you don't provide an override, every value in the map will be
used to produce the unique name, which may create either longer names or more unique shared
resources than you really wanted.
Constructor Summary | |
---|---|
TextTemplateSharedResourceFactory(TextTemplate template)
Creates shared TextTemplate resources. |
|
TextTemplateSharedResourceFactory(TextTemplate template,
java.lang.Class scope)
Creates shared TextTemplate resources with the given scope. |
Method Summary | |
---|---|
ResourceReference |
resourceReference(java.util.Map variables)
Interpolates the given variables Map and returns a
ResourceReference . |
protected java.lang.String |
sharedResourceName(java.util.Map variables)
Returns a unique name for the variables to use as a resource key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextTemplateSharedResourceFactory(TextTemplate template)
TextTemplate
resources.
template
- the TextTemplate
to interpolate intopublic TextTemplateSharedResourceFactory(TextTemplate template, java.lang.Class scope)
TextTemplate
resources with the given scope.
template
- the TextTemplate
to interpolate intoscope
- the scope in shared resources at which to add resourcesMethod Detail |
---|
public ResourceReference resourceReference(java.util.Map variables)
Map
and returns a
ResourceReference
.
variables
- the variables to interpolate into the template
ResourceReference
to the template encoded as a resource with the given
variables interpolatedprotected java.lang.String sharedResourceName(java.util.Map variables)
variables
- variables that parameterize the linked-to resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |