FileDocCategorySizeDatePackage
CS.javaAPI DocAndroid 1.5 API2778Wed May 06 22:41:10 BST 2009org.clearsilver

CS

public class CS extends Object

Fields Summary
public long
csptr
protected HDF
globalHDF
protected HDF
localHDF
private CSFileLoader
fileLoader
Constructors Summary
public CS(HDF ho)

    JNI.loadLibrary();
  
    this.globalHDF = null;
    this.localHDF = ho;
    csptr = _init(ho.hdfptr);
  
public CS(HDF ho, HDF global)

    this(ho);

    this.globalHDF = global;
    if (global != null) {
      _setGlobalHdf(csptr,global.hdfptr);
    }
  
Methods Summary
private native void_dealloc(long ptr)

private native long_init(long ptr)

private native void_parseFile(long ptr, java.lang.String filename, boolean use_cb)

private native void_parseStr(long ptr, java.lang.String content)

private native java.lang.String_render(long ptr)

private native void_setGlobalHdf(long csptr, long hdfptr)

public voidclose()

    if (csptr != 0) {
      _dealloc(csptr);
      csptr = 0;
    }
  
protected java.lang.StringfileLoad(java.lang.String filename)

    if (csptr == 0) {
      throw new NullPointerException("CS is closed.");
    }
    CSFileLoader aFileLoader = fileLoader;
    if (aFileLoader == null) {
      throw new NullPointerException("No fileLoader specified.");
    } else {
      String result = aFileLoader.load(localHDF, filename);
      if (result == null) {
        throw new NullPointerException("CSFileLoader.load() returned null");
      }
      return result;
    }
  
public voidfinalize()

    close();
  
public CSFileLoadergetFileLoader()
Get the file loader in use, if any.

return
the file loader in use.


                   
     
    return fileLoader;
  
public HDFgetGlobalHDF()

    return this.globalHDF;
  
public voidparseFile(java.lang.String filename)

    if (csptr == 0) {
      throw new NullPointerException("CS is closed.");
    }
    _parseFile(csptr, filename, fileLoader != null);
  
public voidparseStr(java.lang.String content)

    if (csptr == 0) {
      throw new NullPointerException("CS is closed.");
    }
    _parseStr(csptr,content);
  
public java.lang.Stringrender()

    if (csptr == 0) {
      throw new NullPointerException("CS is closed.");
    }
    return _render(csptr);
  
public voidsetFileLoader(CSFileLoader fileLoader)
Set the CS file loader to use

param
fileLoader the file loader that should be used.

    this.fileLoader = fileLoader;
  
public voidsetGlobalHDF(HDF global)

    _setGlobalHdf(csptr,global.hdfptr);
    this.globalHDF = global;