Class ResourceModel

java.lang.Object
org.apache.wicket.model.ResourceModel
All Implemented Interfaces:
Serializable, IComponentAssignedModel<String>, IDetachable, IModel<String>, IClusterable

public class ResourceModel extends Object implements IComponentAssignedModel<String>
A model that represents a localized resource string. This is a lightweight version of the StringResourceModel. It lacks parameter substitutions, but is generally easier to use.

If you don't use this model as primary component model (you don't specify it in component constructor and don't assign it to component using Component.setDefaultModel(IModel)), you will need to connect the model with a component using wrapOnAssignment(Component).

Author:
Igor Vaynberg (ivaynberg)
See Also:
  • Constructor Details

    • ResourceModel

      public ResourceModel(String resourceKey)
      Constructor
      Parameters:
      resourceKey - key of the resource this model represents
    • ResourceModel

      public ResourceModel(String resourceKey, String defaultValue)
      Constructor
      Parameters:
      resourceKey - key of the resource this model represents
      defaultValue - value that will be returned if resource does not exist
    • ResourceModel

      public ResourceModel(String resourceKey, IModel<String> defaultValue)
  • Method Details