org.rythmengine.resource
Interface ITemplateResource

All Superinterfaces:
Serializable
All Known Implementing Classes:
ClasspathTemplateResource, FileTemplateResource, StringTemplateResource, TemplateResourceBase, ToStringTemplateResource

public interface ITemplateResource
extends Serializable

Created by IntelliJ IDEA. User: luog Date: 20/01/12 Time: 10:52 PM To change this template use File | Settings | File Templates.


Method Summary
 String asTemplateContent()
          Return template content as a string.
 ICodeType codeType()
          Return code type suggested by this resource, e.g.
 Object getKey()
          The unique identifier used to fetch this resource from ResourceManager
 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 setEngine(RythmEngine engine)
          Set engine instance to the resource
 String tagName()
          Return non-null value if this resource present a tag
 

Method Detail

getKey

Object getKey()
The unique identifier used to fetch this resource from ResourceManager

Returns:
the key of the resource

getSuggestedClassName

String getSuggestedClassName()
Propose a name of generated java class for this resource

Returns:
suggested class name

asTemplateContent

String asTemplateContent()
Return template content as a string. Call refresh() first to check if the resource has been modified

Returns:
resource content

refresh

boolean refresh()
Refresh resource if necessary

Returns:
true if resource is modified false otherwise

isValid

boolean isValid()
Whether this resource is a valid resource

Returns:
true if it's a valid resource

tagName

String tagName()
Return non-null value if this resource present a tag

Returns:
tag name

codeType

ICodeType codeType()
Return code type suggested by this resource, e.g. html or js etc

Returns:
code type suggested

setEngine

void setEngine(RythmEngine engine)
Set engine instance to the resource

Parameters:
engine -


Copyright © 2013. All Rights Reserved.