org.itsnat.core.tmpl
Interface MarkupTemplate

All Superinterfaces:
ItsNatUserData
All Known Subinterfaces:
ItsNatDocFragmentTemplate, ItsNatDocumentTemplate, ItsNatHTMLDocFragmentTemplate

public interface MarkupTemplate
extends ItsNatUserData

Represents a generic markup template.

A markup template can be a document (page) or a fragment (to insert into documents) and is obtained from an ItsNatServlet where it was previously registered.

Author:
Jose Maria Arranz Santamaria

Method Summary
 java.lang.String getEncoding()
          Returns the encoding used.
 ItsNatServlet getItsNatServlet()
          Returns the ItsNat servlet where the template was registered.
 java.lang.String getMIME()
          Returns the template MIME type.
 java.lang.String getName()
          Returns the used name to register the template.
 java.lang.Object getSource()
          Returns the source specified to load the template.
 boolean isOnLoadCacheStaticNodes()
          Informs whether static nodes are serialized as text and globally cached when the template is loaded to save memory (it improves the performance too).
 void setEncoding(java.lang.String encoding)
          Sets the encoding used.
 void setOnLoadCacheStaticNodes(boolean cache)
          Sets if static nodes are serialized as text and globally cached when the template is loaded to save memory (it improves the performance too).
 
Methods inherited from interface org.itsnat.core.ItsNatUserData
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
 

Method Detail

getItsNatServlet

ItsNatServlet getItsNatServlet()
Returns the ItsNat servlet where the template was registered.

Returns:
the ItsNat servlet wrapper.

getName

java.lang.String getName()
Returns the used name to register the template.

Returns:
the template name.

getSource

java.lang.Object getSource()
Returns the source specified to load the template.

Current implementation returns the template source provided, if it was a String (file path or URL) it returns a String with URL format (including local files in this case the URL starts with "file:").

Returns:
the template source. Null if this template is of "attached server" type

getMIME

java.lang.String getMIME()
Returns the template MIME type. This MIME is the value used to render to text and in the header sent to clients.

Returns:
the MIME type.

getEncoding

java.lang.String getEncoding()
Returns the encoding used. This encoding is used to render to text and in the header sent to clients.

The default value is defined by ItsNatServletConfig.getDefaultEncoding()

Returns:
the encoding.
See Also:
setEncoding(String)

setEncoding

void setEncoding(java.lang.String encoding)
Sets the encoding used.

Parameters:
encoding - the new encoding.
See Also:
getEncoding()

isOnLoadCacheStaticNodes

boolean isOnLoadCacheStaticNodes()
Informs whether static nodes are serialized as text and globally cached when the template is loaded to save memory (it improves the performance too).

The default value is defined by ItsNatServletConfig.isOnLoadCacheStaticNodes(String) using the mime type of this template.

Returns:
true if caching is enabled.
See Also:
setOnLoadCacheStaticNodes(boolean)

setOnLoadCacheStaticNodes

void setOnLoadCacheStaticNodes(boolean cache)
Sets if static nodes are serialized as text and globally cached when the template is loaded to save memory (it improves the performance too).

Parameters:
cache - true to enable the static node cache.
See Also:
isOnLoadCacheStaticNodes()


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.