git404hub

what is javapoet fr?

square/javapoet — explained in plain English

Analysis updated 2026-06-24

10,849JavaAudience · developerComplexity · 2/5Setup · easy

tl;dr

JavaPoet is a deprecated Java library from Square that lets you write code which generates other Java code, automatically handling formatting details like imports, indentation, and semicolons.

vibe map

mindmap
  root((JavaPoet))
    What it does
      Generates Java code
      Formats source files
      Manages imports
    Building blocks
      Classes and interfaces
      Methods and fields
      Annotations
    Status
      Deprecated 2020
      Palantir fork available
    Use cases
      Annotation processing
      Code generation
      Android projects

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Generate repetitive Java boilerplate classes automatically using annotation processing instead of hand-writing them.

VIBE 2

Build a code generation tool that produces readable, well-formatted Java source files programmers can inspect and verify.

VIBE 3

Replace error-prone string concatenation in code generators with JavaPoet's type-safe builder API.

what's the stack?

Java

how it stacks up fr

square/javapoetclojure/clojuretootallnate/java-websocket
Stars10,84910,87910,809
LanguageJavaJavaJava
Setup difficultyeasymoderateeasy
Complexity2/55/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 30min

Project is officially deprecated since October 2020, use the Palantir fork for new Java language feature support.

No license information provided in the explanation, check the repository directly.

in plain english

JavaPoet is a Java library that lets you write programs that generate other Java programs. Instead of manually typing out repetitive Java code, you write Java code that describes what you want to produce, and JavaPoet assembles the final source file for you. This is useful in situations like annotation processing, where tools need to create helper classes automatically based on your project's structure. The library gives you building blocks for every part of a Java file: classes, interfaces, methods, constructors, fields, parameters, and annotations. You assemble these pieces with a builder-style API, then ask JavaPoet to render everything into a properly formatted .java file. It handles indentation, semicolons, import statements, and other formatting details so you do not have to. A small but important note: Square officially deprecated this project in October 2020. They no longer maintain it. The README points to a fork maintained by Palantir as an alternative for anyone who needs support for newer Java language features. Switching requires updating your build coordinates and running a short find-and-replace on your import statements. Before deprecation, the library had wide adoption for code generation tasks in Android and Java projects. The core concepts are straightforward: you describe a method or class in Java, and JavaPoet serializes that description into valid source text you can inspect, test, or write to disk. Because it produces readable source code rather than compiled bytecode, you can open the output files and verify they look exactly as intended. The README is detailed and covers the full API including type references, generics, annotations, Javadoc comments, and anonymous inner classes, with code examples for each feature.

prompts (copy fr)

prompt 1
Using JavaPoet, write code that generates a Java class called UserRepository with a findById(long id) method that returns Optional<User>.
prompt 2
Show me how to use JavaPoet's MethodSpec.methodBuilder to generate a method with a Javadoc comment and a generic return type.
prompt 3
How do I wire JavaPoet into a Java annotation processor so it writes generated .java files to the correct source output folder?
prompt 4
I'm migrating from square/javapoet to the Palantir fork. What import names do I need to find-and-replace and what build coordinates change?

Frequently asked questions

what is javapoet fr?

JavaPoet is a deprecated Java library from Square that lets you write code which generates other Java code, automatically handling formatting details like imports, indentation, and semicolons.

What language is javapoet written in?

Mainly Java. The stack also includes Java.

What license does javapoet use?

No license information provided in the explanation, check the repository directly.

How hard is javapoet to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is javapoet for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.