TreeMaker.Apply
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using com.sun.tools.javac.tree.TreeMaker.Apply (Showing top 20 results out of 315)

  • Common ways to obtain TreeMaker
private void myMethod () {
TreeMaker t =
  • Context context;TreeMaker.instance(context)
  • Lower lower;JCTree.JCExpression jCTreeJCExpression;lower.make_at(jCTreeJCExpression.pos())
  • Context context;new TreeMaker(context)
  • Smart code suggestions by Codota
}
origin: google/error-prone

@Override
public Choice<State<JCMethodInvocation>> visitMethodInvocation(
  final MethodInvocationTree node, State<?> state) {
 return chooseSubtrees(
   state,
   s -> unifyExpression(node.getMethodSelect(), s),
   s -> unifyExpressions(node.getArguments(), s),
   (select, args) -> maker().Apply(null, select, args));
}
origin: google/error-prone

 @Override
 public JCMethodInvocation inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner
    .maker()
    .Apply(
      com.sun.tools.javac.util.List.<JCExpression>nil(),
      getMethodSelect().inline(inliner),
      inliner.<JCExpression>inlineList(getArguments()));
 }
}
origin: robolectric/robolectric

private static JCMethodInvocation createSyntheticShadowAccess(
  MethodInvocationTree shadowOfCall,
  String newFieldName,
  Symbol originalSymbol,
  VisitorState state) {
 TreeMaker treeMaker = state.getTreeMaker();
 Symbol newSymbol = createSymbol(originalSymbol, state.getName(newFieldName),
   ((JCExpression) shadowOfCall.getArguments().get(0)).type);
 JCExpression methodSelect = (JCExpression) shadowOfCall.getMethodSelect();
 if (methodSelect instanceof JCIdent) {
  // clone so start pos can be changed...
  methodSelect = treeMaker.Ident(((JCIdent) shadowOfCall.getMethodSelect()).sym);
 }
 JCMethodInvocation callShadowOf =
   treeMaker.Apply(
     null,
     methodSelect,
     com.sun.tools.javac.util.List.of(createIdent(treeMaker, newSymbol)));
 callShadowOf.type = ((JCMethodInvocation) shadowOfCall).type;
 return callShadowOf;
}
origin: robolectric/robolectric

private JCMethodInvocation createSyntheticShadowAccess(VisitorState state) {
 TreeMaker treeMaker = state.getTreeMaker();
 JCExpression application =
   treeMaker.Select(
     treeMaker.Ident(findSymbol(state, "org.robolectric.RuntimeEnvironment")),
     findSymbol(state, "org.robolectric.RuntimeEnvironment", "application"));
 JCExpression shadowOfApp =
   treeMaker.Select(
     treeMaker.Ident(findSymbol(state, "org.robolectric.Shadows")),
     findSymbol(state, "org.robolectric.Shadows", "shadowOf(android.app.Application)"));
 JCMethodInvocation callShadowOf =
   treeMaker.Apply(null, shadowOfApp, com.sun.tools.javac.util.List.of(application));
 callShadowOf.type = callShadowOf.meth.type;
 return callShadowOf;
}
origin: org.jvnet.sorcerer/sorcerer-javac

/**
 * Create a method invocation from a method tree and a list of
 * argument trees.
 */
public JCMethodInvocation App(JCExpression meth, List<JCExpression> args) {
  return Apply(null, meth, args).setType(meth.type.getReturnType());
}
origin: org.kohsuke.sorcerer/sorcerer-javac

/**
 * Create a method invocation from a method tree and a list of
 * argument trees.
 */
public JCMethodInvocation App(JCExpression meth, List<JCExpression> args) {
  return Apply(null, meth, args).setType(meth.type.getReturnType());
}
origin: konsoletyper/teavm-javac

JCMethodInvocation arguments(List<JCExpression> typeArgs, JCExpression t) {
  int pos = token.pos;
  List<JCExpression> args = arguments();
  return toP(F.at(pos).Apply(typeArgs, t, args));
}
origin: org.jvnet.sorcerer/sorcerer-javac

/**
 * Create a no-arg method invocation from a method tree
 */
public JCMethodInvocation App(JCExpression meth) {
  return Apply(null, meth, List.<JCExpression>nil()).setType(meth.type.getReturnType());
}
origin: sc.fiji/javac

/**
 * Create a no-arg method invocation from a method tree
 */
public JCMethodInvocation App(JCExpression meth) {
  return Apply(null, meth, List.<JCExpression>nil()).setType(meth.type.getReturnType());
}
origin: org.kohsuke.sorcerer/sorcerer-javac

/**
 * Create a no-arg method invocation from a method tree
 */
public JCMethodInvocation App(JCExpression meth) {
  return Apply(null, meth, List.<JCExpression>nil()).setType(meth.type.getReturnType());
}
origin: org.kohsuke.sorcerer/sorcerer-javac

JCMethodInvocation arguments(List<JCExpression> typeArgs, JCExpression t) {
  int pos = token.pos;
  List<JCExpression> args = arguments();
  return toP(F.at(pos).Apply(typeArgs, t, args));
}
origin: org.jvnet.sorcerer/sorcerer-javac

JCMethodInvocation arguments(List<JCExpression> typeArgs, JCExpression t) {
  int pos = S.pos();
  List<JCExpression> args = arguments();
  return toP(F.at(pos).Apply(typeArgs, t, args));
}
origin: sc.fiji/javac

public JCTree visitMethodInvocation(MethodInvocationTree node, P p) {
  JCMethodInvocation t = (JCMethodInvocation) node;
  List<JCExpression> typeargs = copy(t.typeargs, p);
  JCExpression meth = copy(t.meth, p);
  List<JCExpression> args = copy(t.args, p);
  return M.at(t.pos).Apply(typeargs, meth, args);
}
origin: sc.fiji/javac

JCMethodInvocation arguments(List<JCExpression> typeArgs, JCExpression t) {
  int pos = S.pos();
  List<JCExpression> args = arguments();
  return toP(F.at(pos).Apply(typeArgs, t, args));
}
origin: org.jvnet.sorcerer/sorcerer-javac

public JCTree visitMethodInvocation(MethodInvocationTree node, P p) {
  JCMethodInvocation t = (JCMethodInvocation) node;
  List<JCExpression> typeargs = copy(t.typeargs, p);
  JCExpression meth = copy(t.meth, p);
  List<JCExpression> args = copy(t.args, p);
  return M.at(t.pos).Apply(typeargs, meth, args);
}
origin: org.kohsuke.sorcerer/sorcerer-javac

public JCTree visitMethodInvocation(MethodInvocationTree node, P p) {
  JCMethodInvocation t = (JCMethodInvocation) node;
  List<JCExpression> typeargs = copy(t.typeargs, p);
  JCExpression meth = copy(t.meth, p);
  List<JCExpression> args = copy(t.args, p);
  return M.at(t.pos).Apply(typeargs, meth, args);
}
origin: com.google.errorprone/error_prone_core

 @Override
 public JCMethodInvocation inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner
    .maker()
    .Apply(
      com.sun.tools.javac.util.List.<JCExpression>nil(),
      getMethodSelect().inline(inliner),
      inliner.<JCExpression>inlineList(getArguments()));
 }
}
origin: com.google.errorprone/error_prone_core

@Override
public Choice<State<JCMethodInvocation>> visitMethodInvocation(
  final MethodInvocationTree node, State<?> state) {
 return chooseSubtrees(
   state,
   s -> unifyExpression(node.getMethodSelect(), s),
   s -> unifyExpressions(node.getArguments(), s),
   (select, args) -> maker().Apply(null, select, args));
}
origin: org.netbeans.api/org-netbeans-modules-java-source-base

public MethodInvocationTree MethodInvocation(List<? extends ExpressionTree> typeArguments, 
                       ExpressionTree method, 
                       List<? extends ExpressionTree> arguments) {
  ListBuffer<JCExpression> typeargs = new ListBuffer<JCExpression>();
  for (ExpressionTree t : typeArguments)
    typeargs.append((JCExpression)t);
  ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
  for (ExpressionTree t : arguments)
    args.append((JCExpression)t);
  return make.at(NOPOS).Apply(typeargs.toList(), (JCExpression)method, args.toList());
}

origin: org.kohsuke.sorcerer/sorcerer-javac

private JCExpression deserGetter(String func, Type type, List<Type> argTypes, List<JCExpression> args) {
  MethodType getmt = new MethodType(argTypes, type, List.<Type>nil(), syms.methodClass);
  Symbol getsym = rs.resolveQualifiedMethod(null, attrEnv, syms.serializedLambdaType, names.fromString(func), argTypes, List.<Type>nil());
  return make.Apply(
        List.<JCExpression>nil(),
        make.Select(make.Ident(kInfo.deserParamSym).setType(syms.serializedLambdaType), getsym).setType(getmt),
        args).setType(type);
}
com.sun.tools.javac.treeTreeMakerApply

Popular methods of TreeMaker

  • instance
    Get the TreeMaker instance.
  • Literal
  • Ident
  • Select
  • Block
  • MethodDef
  • Modifiers
  • Assign
  • Exec
  • VarDef
  • Binary
  • If
  • Binary,
  • If,
  • NewClass,
  • Return,
  • TypeCast,
  • NewArray,
  • Throw,
  • Try,
  • TypeIdent

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)