Class ClientLocalizationMessageResource
- java.lang.Object
 - 
- org.apache.tapestry5.internal.util.VirtualResource
 - 
- org.apache.tapestry5.internal.services.messages.ClientLocalizationMessageResource
 
 
 
- 
- All Implemented Interfaces:
 Resource
public class ClientLocalizationMessageResource extends VirtualResource
Provides a number of symbols related to client-side localization; by exposing these in the global message catalog, they are available to the client (via the "t5/core/messages" module).- Since:
 - 5.4
 
 
- 
- 
Field Summary
- 
Fields inherited from class org.apache.tapestry5.internal.util.VirtualResource
UTF8 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ClientLocalizationMessageResource() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceforLocale(Locale locale)Returns a localized version of the resource.StringgetFile()Returns the file portion of the Resource path, everything that follows the final forward slash.StringgetPath()Return the path (the combination of folder and file).InputStreamopenStream()Opens a stream to the content of the resource, or returns null if the resource does not exist.URLtoURL()Returns the URL for the resource, or null if it does not exist.ResourcewithExtension(String extension)Returns a new Resource with the extension changed (or, if the resource does not have an extension, the extension is added).- 
Methods inherited from class org.apache.tapestry5.internal.util.VirtualResource
exists, forFile, getFolder, isVirtual, toInputStream, toInputStream 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
ClientLocalizationMessageResource
public ClientLocalizationMessageResource()
 
 - 
 
- 
Method Detail
- 
withExtension
public Resource withExtension(String extension)
Description copied from interface:ResourceReturns a new Resource with the extension changed (or, if the resource does not have an extension, the extension is added). The new Resource may not exist (that is,Resource.toURL()may return null.- Specified by:
 withExtensionin interfaceResource- Overrides:
 withExtensionin classVirtualResource- Parameters:
 extension- to apply to the resource, such as "html" or "properties"- Returns:
 - the new resource
 
 
- 
getPath
public String getPath()
Description copied from interface:ResourceReturn the path (the combination of folder and file). Starting in 5.4, certain "virtual resources", may return an arbitrary value here.- Specified by:
 getPathin interfaceResource- Overrides:
 getPathin classVirtualResource
 
- 
getFile
public String getFile()
Description copied from interface:ResourceReturns the file portion of the Resource path, everything that follows the final forward slash. Starting in 5.4, certain kinds of "virtual resources" may return null here.- Specified by:
 getFilein interfaceResource- Overrides:
 getFilein classVirtualResource
 
- 
toURL
public URL toURL()
Description copied from interface:ResourceReturns the URL for the resource, or null if it does not exist. This value is lazily computed; starting in 5.3.4, subclasses may cache the result. Starting in 5.4, some "virtual resources" may return null.- Specified by:
 toURLin interfaceResource- Overrides:
 toURLin classVirtualResource
 
- 
forLocale
public Resource forLocale(Locale locale)
Description copied from interface:ResourceReturns a localized version of the resource. May return null if no such resource exists. Starting in release 5.3.4, the result of this method is cached internally.- Specified by:
 forLocalein interfaceResource- Overrides:
 forLocalein classVirtualResource
 
- 
openStream
public InputStream openStream() throws IOException
Description copied from interface:ResourceOpens a stream to the content of the resource, or returns null if the resource does not exist. The native input stream supplied by the resource is wrapped in aBufferedInputStream.- Returns:
 - an open, buffered stream to the content, if available
 - Throws:
 IOException
 
 - 
 
 -