public abstract class DelegatedCs extends Object implements CS
This class, and its subclasses must take care to wrap or unwrap HDF and CS objects as they are passed through from the callers to the delegate object.
Constructor and Description |
---|
DelegatedCs(CS cs) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Clean up CS object state.
|
CS |
getCs() |
CSFileLoader |
getFileLoader()
Get the file loader in use, if any.
|
HDF |
getGlobalHDF()
Return global hdf in use
|
protected abstract DelegatedHdf |
newDelegatedHdf(HDF hdf)
Method subclasses are required to override with a method that returns a
new DelegatedHdf object that wraps the specified HDF object.
|
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
|
public DelegatedCs(CS cs)
public CS getCs()
protected abstract DelegatedHdf newDelegatedHdf(HDF hdf)
hdf
- an HDF object that should be wrapped in a new DelegatedHdf
object of the same type as this current object.public void setGlobalHDF(HDF global)
CS
setGlobalHDF
in interface CS
public HDF getGlobalHDF()
CS
getGlobalHDF
in interface CS
public void close()
CS
public void parseFile(String filename) throws IOException
CS
parseFile
in interface CS
filename
- the name of file to read in and parse.FileNotFoundException
- if the specified file does not
exist.IOException
- other problems reading the file.public void parseStr(String content)
CS
public String render()
CS
public CSFileLoader getFileLoader()
CS
getFileLoader
in interface CS
public void setFileLoader(CSFileLoader fileLoader)
CS
setFileLoader
in interface CS
fileLoader
- the file loader that should be used.Copyright © 2010–2016 Google. All rights reserved.