This is a static site showcasing modern Java patterns vs legacy approaches. It is hosted on GitHub Pages at https://javaevolved.github.io.
Each pattern is defined as a JSON file under content/category/:
content/language/type-inference-with-var.json
content/collections/immutable-list-creation.json
content/streams/stream-tolist.json
...
Categories: language, collections, strings, streams, concurrency, io, errors, datetime, security, tooling
The following are generated by html-generators/generate.java and must not be edited directly:
site/index.html— homepage with preview cards (generated fromtemplates/index.html)site/language/*.html,site/collections/*.html, etc. — detail pagessite/data/snippets.json— aggregated search index
Run jbang html-generators/generate.java to rebuild all generated files from the JSON sources.
site/app.js— client-side search, filtering, code highlightingsite/styles.css— all stylingtemplates/slug-template.html— HTML template with{{placeholder}}tokens used by the generatortemplates/index.html— homepage template with{{tipCards}}and{{snippetCount}}placeholderstemplates/index-card.html— preview card template for the homepage grid
content/ # Source JSON files (one per pattern, organized by category)
site/ # Deployable site (static assets + generated HTML)
templates/ # HTML templates for detail pages
html-generators/ # Build scripts and pre-built JAR
Each content/category/slug.json file has this structure:
{
"id": 1,
"slug": "type-inference-with-var",
"title": "Type inference with var",
"category": "language",
"difficulty": "beginner|intermediate|advanced",
"jdkVersion": "10",
"oldLabel": "Java 8",
"modernLabel": "Java 10+",
"oldApproach": "Explicit Types",
"modernApproach": "var keyword",
"oldCode": "// old way...",
"modernCode": "// modern way...",
"summary": "One-line description.",
"explanation": "How it works paragraph.",
"whyModernWins": [
{ "icon": "⚡", "title": "Short title", "desc": "One sentence." },
{ "icon": "👁", "title": "Short title", "desc": "One sentence." },
{ "icon": "🔒", "title": "Short title", "desc": "One sentence." }
],
"support": {
"state": "available",
"description": "Widely available since JDK 10 (March 2018)"
},
"prev": "category/slug-of-previous",
"next": "category/slug-of-next",
"related": [
"category/slug-1",
"category/slug-2",
"category/slug-3"
],
"docs": [
{ "title": "Javadoc or Guide Title", "href": "https://docs.oracle.com/..." }
]
}slugmust match the filename (without.json)categorymust match the parent folder namewhyModernWinsmust have exactly 3 entriesrelatedmust have exactly 3 entries (ascategory/slugpaths)docsmust have at least 1 entry linking to Javadoc or Oracle documentationprev/nextarecategory/slugpaths ornullfor first/last- Code in
oldCode/modernCodeuses\nfor newlines
| ID | Display |
|---|---|
language |
Language |
collections |
Collections |
strings |
Strings |
streams |
Streams |
concurrency |
Concurrency |
io |
I/O |
errors |
Errors |
datetime |
Date/Time |
security |
Security |
tooling |
Tooling |
- Create
content/category/new-slug.jsonwith all required fields - Update
prev/nextin the adjacent patterns' JSON files - Run
jbang html-generators/generate.java
jbang html-generators/generate.java # Build HTML pages + snippets.json
jwebserver -d site -p 8090 # Serve locally