public interface ITemplateResource extends Serializable
Implement a template resource which can be load from some where. For example, a file in a file system or an input stream from the network, or even from the database
| Modifier and Type | Method and Description |
|---|---|
String |
asTemplateContent()
Return template content as a string.
|
ICodeType |
codeType(RythmEngine engine)
Return code type suggested by this resource, e.g.
|
Throwable |
getError() |
Object |
getKey()
The unique identifier used to fetch this resource by a
resource loader |
ITemplateResourceLoader |
getLoader()
Return the loader that loaded this resource
|
String |
getSuggestedClassName()
Propose a name of generated java class for this resource
|
boolean |
isValid()
Whether this resource is a valid resource
|
boolean |
refresh()
Refresh resource if necessary
|
void |
setError(Throwable error) |
Object getKey()
The unique identifier used to fetch this resource by a resource loader
String getSuggestedClassName()
Propose a name of generated java class for this resource
String asTemplateContent()
Return template content as a string. Call refresh() first to check if the resource has been modified
boolean refresh()
Refresh resource if necessary
boolean isValid()
Whether this resource is a valid resource
ICodeType codeType(RythmEngine engine)
Return code type suggested by this resource, e.g. html or js etc
ITemplateResourceLoader getLoader()
Return the loader that loaded this resource
Throwable getError()
void setError(Throwable error)
error - the error to setCopyright © 2017–2021 OSGL (Open Source General Library). All rights reserved.