|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.loaders.Loader
public abstract class Loader
This is the base class of all loaders in MillScript. A loader is responsible for compiling the contents of a file into a MillScript structure. e.g. a text file is compiled to a string, while a template is compiled into a function wrapping some recursive XML.
| Field Summary | |
|---|---|
protected org.millscript.commons.vfs.VEntry |
entry
The source we want to compile from |
protected Package |
pack
The package we want to compile the source file into |
protected java.lang.String |
symbol
The symbol we want bound after compiling the source file |
| Constructor Summary | |
|---|---|
Loader()
|
|
| Method Summary | |
|---|---|
Loader |
getInstance()
Returns a new instance of this loader, to be used as appropriate. |
int |
getLineNumber()
|
java.lang.String |
getOrigin()
|
java.lang.String |
getSymbol()
Returns the symbol this loader will compile. |
abstract void |
loadBindings()
Causes this loader to load it's bindings. |
abstract java.lang.Object |
loadValue()
Causes this loader to load it's value. |
Loader |
newLoader(Package p,
java.lang.String sym,
org.millscript.commons.vfs.VEntry e)
Returns a new loader to load the specified source file into the specified package, binding a value to the specified symbol. |
void |
setContext(java.lang.String s,
int n)
|
void |
setLineNumber(int n)
|
Loader |
setLoader(Package p,
java.lang.String sym,
org.millscript.commons.vfs.VEntry e)
Sets the package this loader will import into, the symbol for the loaded resource and the virtual filesystem entry for the data to compile. |
void |
setOrigin(java.lang.String o)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Package pack
protected org.millscript.commons.vfs.VEntry entry
protected java.lang.String symbol
| Constructor Detail |
|---|
public Loader()
| Method Detail |
|---|
public Loader setLoader(Package p,
java.lang.String sym,
org.millscript.commons.vfs.VEntry e)
p - the package to compile intosym - the symbol for the compiled resourcee - the entry of the data to compile
public Loader getInstance()
public int getLineNumber()
getLineNumber in interface org.millscript.commons.alert.AlertOriginAlertOrigin.getLineNumber()public java.lang.String getOrigin()
getOrigin in interface org.millscript.commons.alert.AlertOriginAlertOrigin.getOrigin()public java.lang.String getSymbol()
public abstract java.lang.Object loadValue()
throws java.io.IOException
java.io.IOException - if something goes wrong reading from the source
public abstract void loadBindings()
throws java.io.IOException
java.io.IOException - if something goes wrong reading from the source
public Loader newLoader(Package p,
java.lang.String sym,
org.millscript.commons.vfs.VEntry e)
p - the package to load values intosym - the symbol that must be bound after loadinge - the entry of the data to compile
public void setContext(java.lang.String s,
int n)
setContext in interface org.millscript.commons.alert.AlertOriginAlertOrigin.setContext(java.lang.String, int)public void setLineNumber(int n)
setLineNumber in interface org.millscript.commons.alert.AlertOriginAlertOrigin.setLineNumber(int)public void setOrigin(java.lang.String o)
setOrigin in interface org.millscript.commons.alert.AlertOriginAlertOrigin.setOrigin(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||