|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bbqjs.compiler.AbstractCompilableFile
public abstract class AbstractCompilableFile
Interrogates passed JavaScript files for their include statements. It's recommended that include statements are at the top of the file but it's not essential. Whitespace between include lines is ignored.
include(org.my.project.JSClass);
include(org.my.project.AnotherJSClass);
include(org.some.other.project.YetAnotherJSClass);
org.my.namespace.MyClass = Class.create({
...
});
Field Summary | |
---|---|
protected ByteArrayOutputStream |
contents
Holds contents of file after includes |
protected List<CompilableFile> |
includedFiles
List of files included by this file |
protected String[] |
sourceRoots
Java by default caches everything accessed via the classpath - this is fine for production, but if we are developing it means, for example, that if you are changing js/css files, the compiler servlets in the spring integration package will not be able to pick up your changes. |
Constructor Summary | |
---|---|
AbstractCompilableFile(URL filePath,
String[] sourceRoots)
|
Method Summary | |
---|---|
protected void |
encounteredInclude(String className)
|
protected void |
encounteredInclude(String className,
URL javaScriptFile)
|
boolean |
equals(Object file)
|
protected void |
findIncludes(URL file)
|
URL |
getFilePath()
Returns the path to this file. |
List<CompilableFile> |
getIncludedFiles()
Returns a list of files included by this source file. |
static void |
setLogger(org.slf4j.Logger log)
|
String |
toString()
|
void |
writeTo(OutputStream outputStream)
Calling this method will cause the contents of the file to be written into the output stream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ByteArrayOutputStream contents
protected List<CompilableFile> includedFiles
protected String[] sourceRoots
Constructor Detail |
---|
public AbstractCompilableFile(URL filePath, String[] sourceRoots)
Method Detail |
---|
public static void setLogger(org.slf4j.Logger log)
protected void findIncludes(URL file) throws IOException
IOException
protected void encounteredInclude(String className) throws IOException
IOException
protected void encounteredInclude(String className, URL javaScriptFile) throws IOException
IOException
public void writeTo(OutputStream outputStream) throws IOException
CompilableFile
writeTo
in interface CompilableFile
outputStream
-
IOException
public URL getFilePath()
CompilableFile
getFilePath
in interface CompilableFile
public List<CompilableFile> getIncludedFiles()
CompilableFile
getIncludedFiles
in interface CompilableFile
public boolean equals(Object file)
equals
in class Object
file
-
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |