org.stjs.generator.javac
Class TreeWrapper<T extends com.sun.source.tree.Tree,JS>

java.lang.Object
  extended by org.stjs.generator.javac.TreeWrapper<T,JS>

public class TreeWrapper<T extends com.sun.source.tree.Tree,JS>
extends Object

this class is a wrapper around a Tree node to give you easier access to the most important methods of the elements in the AST

Author:
acraciun

Constructor Summary
TreeWrapper(Element element, com.sun.source.util.TreePath path, GenerationContext<JS> context)
           
TreeWrapper(com.sun.source.util.TreePath path, GenerationContext<JS> context)
           
 
Method Summary
 void addError(String message)
           
<C extends com.sun.source.tree.Tree>
TreeWrapper<C,JS>
child(C child)
           
 GenerationContext<JS> getContext()
           
 TreeWrapper<com.sun.source.tree.ClassTree,JS> getCurrentType()
           
 Element getElement()
           
 TreeWrapper<com.sun.source.tree.ClassTree,JS> getEnclosingType()
           
 String getMethodTemplate()
           
 String getNamespace()
           
 com.sun.source.util.TreePath getPath()
           
 T getTree()
           
 String getTypeName()
           
 boolean isFinal()
           
 boolean isGlobal()
           
 boolean isInnerType()
           
 boolean isJavaScriptFunction()
           
 boolean isJavaScriptPrimitive()
           
 boolean isNative()
           
 boolean isPrimitiveType()
           
 boolean isStatic()
           
 boolean isSuper()
           
 boolean isSyntheticType()
           
<P extends com.sun.source.tree.Tree>
TreeWrapper<P,JS>
parent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeWrapper

public TreeWrapper(@Nonnull
                   com.sun.source.util.TreePath path,
                   @Nonnull
                   GenerationContext<JS> context)

TreeWrapper

public TreeWrapper(@Nonnull
                   Element element,
                   @Nonnull
                   com.sun.source.util.TreePath path,
                   @Nonnull
                   GenerationContext<JS> context)
Method Detail

getTree

public T getTree()

getPath

public com.sun.source.util.TreePath getPath()

getContext

public GenerationContext<JS> getContext()

isFinal

public boolean isFinal()

isStatic

public boolean isStatic()

isSuper

public boolean isSuper()

isPrimitiveType

public boolean isPrimitiveType()

isJavaScriptFunction

public boolean isJavaScriptFunction()

isGlobal

public boolean isGlobal()

getNamespace

public String getNamespace()

isInnerType

public boolean isInnerType()

child

public <C extends com.sun.source.tree.Tree> TreeWrapper<C,JS> child(C child)

parent

public <P extends com.sun.source.tree.Tree> TreeWrapper<P,JS> parent()

isSyntheticType

public boolean isSyntheticType()

isNative

public boolean isNative()

isJavaScriptPrimitive

public boolean isJavaScriptPrimitive()

getElement

public Element getElement()

getEnclosingType

public TreeWrapper<com.sun.source.tree.ClassTree,JS> getEnclosingType()

getCurrentType

public TreeWrapper<com.sun.source.tree.ClassTree,JS> getCurrentType()

getTypeName

public String getTypeName()
Returns:
the type's name if the tree belongs to a type, undefined otherwise

addError

public void addError(String message)

getMethodTemplate

public String getMethodTemplate()


Copyright © 2014. All Rights Reserved.