org.clearsilver.jni
Class JniCs

java.lang.Object
  extended by org.clearsilver.jni.JniCs
All Implemented Interfaces:
Closeable, CS

public class JniCs
extends Object
implements CS

JNI implementation of the CS interface.


Field Summary
protected  JniHdf globalHDF
           
protected  JniHdf localHDF
           
 
Method Summary
 void close()
          Clean up CS object state.
protected  String fileLoad(String filename)
           
protected  void finalize()
           
 CSFileLoader getFileLoader()
          Get the file loader in use, if any.
 HDF getGlobalHDF()
          Return global hdf in use
 void parseFile(String filename)
          Parses the specified file as if it has template content.
 void parseStr(String content)
          Parse the given string as a CS template.
 String render()
          Generate output from the CS templates and HDF objects that have been read in.
 void setFileLoader(CSFileLoader fileLoader)
          Set the CS file loader to use
 void setGlobalHDF(HDF global)
          Specify a new/different global HDF
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globalHDF

protected JniHdf globalHDF

localHDF

protected JniHdf localHDF
Method Detail

setGlobalHDF

public void setGlobalHDF(HDF global)
Description copied from interface: CS
Specify a new/different global HDF

Specified by:
setGlobalHDF in interface CS

getGlobalHDF

public HDF getGlobalHDF()
Description copied from interface: CS
Return global hdf in use

Specified by:
getGlobalHDF in interface CS

close

public void close()
Description copied from interface: CS
Clean up CS object state.

Specified by:
close in interface Closeable
Specified by:
close in interface CS

finalize

protected void finalize()
Overrides:
finalize in class Object

parseFile

public void parseFile(String filename)
               throws IOException
Parses the specified file as if it has template content. The file will be located using the HDF's loadpaths.

Specified by:
parseFile in interface CS
Parameters:
filename - the name of file to read in and parse.
Throws:
FileNotFoundException - if the specified file does not exist.
IOException - other problems reading the file.

parseStr

public void parseStr(String content)
Description copied from interface: CS
Parse the given string as a CS template.

Specified by:
parseStr in interface CS
Parameters:
content - string to parse.

render

public String render()
Description copied from interface: CS
Generate output from the CS templates and HDF objects that have been read in.

Specified by:
render in interface CS
Returns:
the output of the template rendering.

fileLoad

protected String fileLoad(String filename)
                   throws IOException,
                          FileNotFoundException
Throws:
IOException
FileNotFoundException

getFileLoader

public CSFileLoader getFileLoader()
Get the file loader in use, if any.

Specified by:
getFileLoader in interface CS
Returns:
the file loader in use.

setFileLoader

public void setFileLoader(CSFileLoader fileLoader)
Set the CS file loader to use

Specified by:
setFileLoader in interface CS
Parameters:
fileLoader - the file loader that should be used.


Copyright © 2010-2012 Google. All Rights Reserved.