Rename Globals.FINDER to Globals.finder.
This commit is contained in:
@@ -80,7 +80,7 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
* <li>{@link STDIN} Current value for standard input in the laaded IoLib, if any.
|
||||
* <li>{@link STDOUT} Current value for standard output in the loaded IoLib, if any.
|
||||
* <li>{@link STDERR} Current value for standard error in the loaded IoLib, if any.
|
||||
* <li>{@link FINDER} Current loaded {@link ResourceFinder}, if any.
|
||||
* <li>{@link finder} Current loaded {@link ResourceFinder}, if any.
|
||||
* <li>{@link compiler} Current loaded {@link Compiler}, if any.
|
||||
* <li>{@link undumper} Current loaded {@link Undumper}, if any.
|
||||
* <li>{@link loader} Current loaded {@link Loader}, if any.
|
||||
@@ -122,7 +122,7 @@ public class Globals extends LuaTable {
|
||||
public PrintStream STDERR = System.err;
|
||||
|
||||
/** The installed ResourceFinder for looking files by name. */
|
||||
public ResourceFinder FINDER;
|
||||
public ResourceFinder finder;
|
||||
|
||||
/** The currently running thread. Should not be changed by non-library code. */
|
||||
public LuaThread running = new LuaThread(this);
|
||||
@@ -178,7 +178,7 @@ public class Globals extends LuaTable {
|
||||
*/
|
||||
public LuaValue loadfile(String filename) {
|
||||
try {
|
||||
return load(FINDER.findResource(filename), "@"+filename, "bt", this);
|
||||
return load(finder.findResource(filename), "@"+filename, "bt", this);
|
||||
} catch (Exception e) {
|
||||
return error("load "+filename+": "+e);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.luaj.vm2.Varargs;
|
||||
* <p>
|
||||
* This contains all library functions listed as "basic functions" in the lua documentation for JME.
|
||||
* The functions dofile and loadfile use the
|
||||
* {@link #FINDER} instance to find resource files.
|
||||
* {@link #finder} instance to find resource files.
|
||||
* Since JME has no file system by default, {@link BaseLib} implements
|
||||
* {@link ResourceFinder} using {@link Class#getResource(String)},
|
||||
* which is the closest equivalent on JME.
|
||||
@@ -69,7 +69,7 @@ import org.luaj.vm2.Varargs;
|
||||
* This is a direct port of the corresponding library in C.
|
||||
* @see JseBaseLib
|
||||
* @see ResourceFinder
|
||||
* @see #FINDER
|
||||
* @see #finder
|
||||
* @see LibFunction
|
||||
* @see JsePlatform
|
||||
* @see JmePlatform
|
||||
@@ -81,7 +81,7 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder {
|
||||
|
||||
public LuaValue call(LuaValue modname, LuaValue env) {
|
||||
globals = env.checkglobals();
|
||||
globals.FINDER = this;
|
||||
globals.finder = this;
|
||||
globals.baselib = this;
|
||||
env.set( "_G", env );
|
||||
env.set( "_VERSION", Lua._VERSION );
|
||||
@@ -424,7 +424,7 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder {
|
||||
* @return Varargs containing chunk, or NIL,error-text on error
|
||||
*/
|
||||
public Varargs loadFile(String filename, String mode, LuaValue env) {
|
||||
InputStream is = globals.FINDER.findResource(filename);
|
||||
InputStream is = globals.finder.findResource(filename);
|
||||
if ( is == null )
|
||||
return varargsOf(NIL, valueOf("cannot open "+filename+": No such file or directory"));
|
||||
try {
|
||||
|
||||
@@ -299,7 +299,7 @@ public class PackageLib extends TwoArgFunction {
|
||||
}
|
||||
|
||||
// try opening the file
|
||||
InputStream is = globals.FINDER.findResource(filename);
|
||||
InputStream is = globals.finder.findResource(filename);
|
||||
if (is != null) {
|
||||
try { is.close(); } catch ( java.io.IOException ioe ) {}
|
||||
return valueOf(filename);
|
||||
|
||||
@@ -31,13 +31,13 @@ import java.io.InputStream;
|
||||
* for both the Jme and Jse platforms.
|
||||
* <p>
|
||||
* The Jme version of base lib {@link BaseLib}
|
||||
* implements {@link BaseLib#FINDER} via {@link Class#getResourceAsStream(String)},
|
||||
* implements {@link Globals#finder} via {@link Class#getResourceAsStream(String)},
|
||||
* while the Jse version {@link JseBaseLib} implements it using {@link java.io.File#File(String)}.
|
||||
* <p>
|
||||
* The io library does not use this API for file manipulation.
|
||||
* <p>
|
||||
* @see BaseLib
|
||||
* @see BaseLib#FINDER
|
||||
* @see Globals#finder
|
||||
* @see JseBaseLib
|
||||
* @see JmePlatform
|
||||
* @see JsePlatform
|
||||
|
||||
@@ -33,11 +33,11 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
|
||||
/**
|
||||
* Subclass of {@link BaseLib} and {@link LibFunction} which implements the lua basic library functions
|
||||
* and provides a directory based {@link ResourceFinder} as the {@link #FINDER}.
|
||||
* and provides a directory based {@link ResourceFinder} as the {@link #finder}.
|
||||
* <p>
|
||||
* Since JME has no file system by default, {@link BaseLib} implements
|
||||
* {@link ResourceFinder} using {@link Class#getResource(String)}.
|
||||
* The {@link JseBaseLib} implements {@link FINDER} by scanning the current directory
|
||||
* The {@link JseBaseLib} implements {@link finder} by scanning the current directory
|
||||
* first, then falling back to {@link Class#getResource(String)} if that fails.
|
||||
* Otherwise, the behavior is the same as that of {@link BaseLib}.
|
||||
* <p>
|
||||
@@ -62,7 +62,7 @@ import org.luaj.vm2.lib.ResourceFinder;
|
||||
* @see Globals
|
||||
* @see BaseLib
|
||||
* @see ResourceFinder
|
||||
* @see {@link Globals.FINDER}
|
||||
* @see {@link Globals.finder}
|
||||
* @see LibFunction
|
||||
* @see JsePlatform
|
||||
* @see org.luaj.vm2.lib.jme.JmePlatform
|
||||
|
||||
Reference in New Issue
Block a user