Class Template<M extends TemplateMatch>

    • Constructor Detail

      • Template

        public Template()
    • Method Detail

      • annotations

        public abstract com.google.common.collect.ImmutableClassToInstanceMap<Annotation> annotations()
      • templateTypeVariables

        public abstract com.google.common.collect.ImmutableList<UTypeVar> templateTypeVariables()
      • expressionArgumentTypes

        public abstract com.google.common.collect.ImmutableMap<String,​UType> expressionArgumentTypes()
      • match

        public abstract Iterable<M> match​(com.sun.tools.javac.tree.JCTree tree,
                                          com.sun.tools.javac.util.Context context)
      • replace

        public abstract Fix replace​(M match)
      • expectedTypes

        protected com.sun.tools.javac.util.List<com.sun.tools.javac.code.Type> expectedTypes​(Inliner inliner)
                                                                                      throws CouldNotResolveImportException
        Returns a list of the expected types to be matched. This consists of the argument types from the @BeforeTemplate method, concatenated with the return types of expression placeholders, sorted by the name of the placeholder method.
        Throws:
        CouldNotResolveImportException - if a referenced type could not be resolved
      • actualTypes

        protected com.sun.tools.javac.util.List<com.sun.tools.javac.code.Type> actualTypes​(Inliner inliner)
                                                                                    throws CouldNotResolveImportException
        Returns a list of the actual types to be matched. This consists of the types of the expressions bound to the @BeforeTemplate method parameters, concatenated with the types of the expressions bound to expression placeholders, sorted by the name of the placeholder method.
        Throws:
        CouldNotResolveImportException
      • typecheck

        @Nullable
        protected com.google.common.base.Optional<Unifier> typecheck​(Unifier unifier,
                                                                     Inliner inliner,
                                                                     com.sun.tools.javac.util.Warner warner,
                                                                     com.sun.tools.javac.util.List<com.sun.tools.javac.code.Type> expectedTypes,
                                                                     com.sun.tools.javac.util.List<com.sun.tools.javac.code.Type> actualTypes)
      • pretty

        protected static com.sun.tools.javac.tree.Pretty pretty​(com.sun.tools.javac.util.Context context,
                                                                Writer writer)