org.codehaus.groovy.grails.web.pages
Class GroovyPageMetaInfo

java.lang.Object
  extended by org.codehaus.groovy.grails.web.pages.GroovyPageMetaInfo

 class GroovyPageMetaInfo
extends Object

Encapsulates the information necessary to describe a GSP.

Since:
0.5
Author:
Graeme Rocher, Lari Hotari

Field Summary
static String HTML_DATA_POSTFIX
           
static long LASTMODIFIED_CHECK_INTERVAL
           
static String LINENUMBERS_DATA_POSTFIX
           
 
Constructor Summary
GroovyPageMetaInfo()
           
GroovyPageMetaInfo(Class<?> pageClass)
           
 
Method Summary
 void applyLastModifiedFromResource(Resource resource)
           
 Class<?> getCodecClass()
           
 String getCodecName()
           
 GroovyPagesException getCompilationException()
           
 String getContentType()
           
 InputStream getGroovySource()
           
 String[] getHtmlParts()
           
 org.codehaus.groovy.grails.web.pages.ext.jsp.TagLibraryResolver getJspTagLibraryResolver()
           
 Map getJspTags()
           
 long getLastModified()
           
 int[] getLineNumbers()
           
 Class<?> getPageClass()
           
 TagLibraryLookup getTagLibraryLookup()
           
 void initCodec()
           
 boolean isPrecompiledMode()
           
 void setCodecName(String codecName)
           
 void setCompilationException(GroovyPagesException e)
           
 void setContentType(String contentType)
           
 void setGroovySource(InputStream groovySource)
           
 void setHtmlParts(String[] htmlParts)
           
 void setJspTagLibraryResolver(org.codehaus.groovy.grails.web.pages.ext.jsp.TagLibraryResolver jspTagLibraryResolver)
           
 void setJspTags(Map jspTags)
           
 void setLastModified(long lastModified)
           
 void setLineNumbers(int[] lineNumbers)
           
 void setPageClass(Class<?> pageClass)
           
 void setTagLibraryLookup(TagLibraryLookup tagLibraryLookup)
           
 boolean shouldReload(PrivilegedAction<Resource> resourceCallable)
          Checks if this GSP has expired and should be reloaded (there is a newer source gsp available) PrivilegedAction is used so that locating the Resource is lazily evaluated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML_DATA_POSTFIX

public static final String HTML_DATA_POSTFIX
See Also:
Constant Field Values

LINENUMBERS_DATA_POSTFIX

public static final String LINENUMBERS_DATA_POSTFIX
See Also:
Constant Field Values

LASTMODIFIED_CHECK_INTERVAL

public static final long LASTMODIFIED_CHECK_INTERVAL
Constructor Detail

GroovyPageMetaInfo

public GroovyPageMetaInfo()

GroovyPageMetaInfo

public GroovyPageMetaInfo(Class<?> pageClass)
Method Detail

initCodec

public void initCodec()

getTagLibraryLookup

public TagLibraryLookup getTagLibraryLookup()

setTagLibraryLookup

public void setTagLibraryLookup(TagLibraryLookup tagLibraryLookup)

getJspTagLibraryResolver

public org.codehaus.groovy.grails.web.pages.ext.jsp.TagLibraryResolver getJspTagLibraryResolver()

setJspTagLibraryResolver

public void setJspTagLibraryResolver(org.codehaus.groovy.grails.web.pages.ext.jsp.TagLibraryResolver jspTagLibraryResolver)

getPageClass

public Class<?> getPageClass()

setPageClass

public void setPageClass(Class<?> pageClass)

getLastModified

public long getLastModified()

setLastModified

public void setLastModified(long lastModified)

getGroovySource

public InputStream getGroovySource()

setGroovySource

public void setGroovySource(InputStream groovySource)

getContentType

public String getContentType()

setContentType

public void setContentType(String contentType)

getLineNumbers

public int[] getLineNumbers()

setLineNumbers

public void setLineNumbers(int[] lineNumbers)

setJspTags

public void setJspTags(Map jspTags)

getJspTags

public Map getJspTags()

setCompilationException

public void setCompilationException(GroovyPagesException e)

getCompilationException

public GroovyPagesException getCompilationException()

getHtmlParts

public String[] getHtmlParts()

setHtmlParts

public void setHtmlParts(String[] htmlParts)

getCodecClass

public Class<?> getCodecClass()

getCodecName

public String getCodecName()

setCodecName

public void setCodecName(String codecName)

applyLastModifiedFromResource

public void applyLastModifiedFromResource(Resource resource)

shouldReload

public boolean shouldReload(PrivilegedAction<Resource> resourceCallable)
Checks if this GSP has expired and should be reloaded (there is a newer source gsp available) PrivilegedAction is used so that locating the Resource is lazily evaluated. lastModified checking is done only when enough time has expired since the last check. This setting is controlled by the grails.gsp.reload.interval System property, by default it's value is 5000 (ms).

Parameters:
resourceCallable - call back that resolves the source gsp lazily
Returns:
true if the available gsp source file is newer than the loaded one.

isPrecompiledMode

public boolean isPrecompiledMode()