public class GenerationContext<JS> extends Object implements TreePathHolder
| Modifier and Type | Class and Description |
|---|---|
static class |
GenerationContext.AnnotationCacheKey |
static class |
GenerationContext.DummyTree
this is a dummy try just to have the wrapper thing working for cases where only the element is available
|
| Constructor and Description |
|---|
GenerationContext(File inputFile,
GeneratorConfiguration configuration,
JavaScriptNameProvider names,
com.sun.source.util.Trees trees,
Map<GenerationContext.AnnotationCacheKey,Object> cacheAnnotations,
JavaScriptBuilder<JS> javaScriptBuilder) |
| Modifier and Type | Method and Description |
|---|---|
JavascriptFileGenerationException |
addError(com.sun.source.tree.Tree tree,
String message) |
<T extends Annotation> |
getAnnotation(Element element,
Class<T> annotationType) |
ClassLoader |
getBuiltProjectClassLoader() |
Checks |
getChecks() |
com.sun.source.tree.CompilationUnitTree |
getCompilationUnit() |
GeneratorConfiguration |
getConfiguration() |
com.sun.source.util.TreePath |
getCurrentPath() |
<T extends com.sun.source.tree.Tree> |
getCurrentWrapper() |
Elements |
getElements() |
File |
getInputFile() |
JavaScriptNameProvider |
getNames() |
int |
getStartLine(com.sun.source.tree.Tree tree) |
com.sun.source.util.Trees |
getTrees() |
Types |
getTypes() |
JavaScriptBuilder<JS> |
js() |
void |
setCompilationUnit(com.sun.source.tree.CompilationUnitTree compilationUnit) |
void |
setCurrentPath(com.sun.source.util.TreePath currentPath) |
void |
setElements(Elements elements) |
void |
setTrees(com.sun.source.util.Trees trees) |
void |
setTypes(Types types) |
JS |
withPosition(com.sun.source.tree.Tree tree,
JS node)
add the position of the Java original node in the generated node.
|
<T extends com.sun.source.tree.Tree> |
wrap(Element enclosingElement) |
<T extends com.sun.source.tree.Tree> |
wrap(com.sun.source.util.TreePath path) |
void |
writeJavaScript(JS astRoot,
Writer writer) |
void |
writeSourceMap(Writer sourceMapWriter) |
public GenerationContext(File inputFile, GeneratorConfiguration configuration, JavaScriptNameProvider names, com.sun.source.util.Trees trees, Map<GenerationContext.AnnotationCacheKey,Object> cacheAnnotations, JavaScriptBuilder<JS> javaScriptBuilder)
public File getInputFile()
public GeneratorConfiguration getConfiguration()
public JavaScriptNameProvider getNames()
public com.sun.source.util.Trees getTrees()
public void setTrees(com.sun.source.util.Trees trees)
public com.sun.source.util.TreePath getCurrentPath()
getCurrentPath in interface TreePathHolderpublic void setCurrentPath(com.sun.source.util.TreePath currentPath)
setCurrentPath in interface TreePathHolderpublic Elements getElements()
public void setElements(Elements elements)
public Types getTypes()
public void setTypes(Types types)
public Checks getChecks()
public com.sun.source.tree.CompilationUnitTree getCompilationUnit()
public void setCompilationUnit(com.sun.source.tree.CompilationUnitTree compilationUnit)
public JavascriptFileGenerationException addError(com.sun.source.tree.Tree tree, String message)
public JS withPosition(com.sun.source.tree.Tree tree, JS node)
tree - node - public int getStartLine(com.sun.source.tree.Tree tree)
tree - public JavaScriptBuilder<JS> js()
public void writeSourceMap(Writer sourceMapWriter) throws IOException
IOExceptionpublic <T extends com.sun.source.tree.Tree> TreeWrapper<T,JS> getCurrentWrapper()
public <T extends com.sun.source.tree.Tree> TreeWrapper<T,JS> wrap(com.sun.source.util.TreePath path)
public <T extends com.sun.source.tree.Tree> TreeWrapper<T,JS> wrap(Element enclosingElement)
public ClassLoader getBuiltProjectClassLoader()
public <T extends Annotation> T getAnnotation(Element element, Class<T> annotationType)
Copyright © 2015. All Rights Reserved.