Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
I wanna tell you about "Groovy Template"
Search
grimrose
October 17, 2014
Programming
5.4k
3
Share
I wanna tell you about "Groovy Template"
テンプレートエンジンNight
http://www.zusaar.com/event/10707003
grimrose
October 17, 2014
More Decks by grimrose
See All by grimrose
だいたい10分くらいで 知った気になれる Vert.x 3.0 #渋谷Java / Shibuya.java #11
grimrose
0
1.9k
Syobochim should read book of modeling #syoboben
grimrose
0
1.8k
Gradleで始めるGroovy expand #jjug_ccc #ccc_r14
grimrose
4
6.1k
Groovy Shell with Gradle
grimrose
0
5.3k
Shibuya.Java #07
grimrose
0
890
Ambiguous Groups #sqlap
grimrose
0
930
ぼっちプロジェクトとアジャイルサムライ
grimrose
0
300
Shibuya.Java #04
grimrose
1
650
I made out Gradle plug-in
grimrose
0
950
Other Decks in Programming
See All in Programming
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
640
tsserverとは何だったのか_これからどうなるのか
nowaki28
0
200
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
110
継続的な負荷検証を目指して
pyama86
3
1.2k
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
370
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
My daily life on Ruby
a_matsuda
3
410
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
180
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
120
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
[SF Ruby Conf 2025] Rails X
palkan
2
1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
Are puppies a ranking factor?
jonoalderson
1
3.4k
GraphQLとの向き合い方2022年版
quramy
50
15k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
370
Side Projects
sachag
455
43k
We Are The Robots
honzajavorek
0
230
Context Engineering - Making Every Token Count
addyosmani
9
890
The untapped power of vector embeddings
frankvandijk
2
1.7k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
Transcript
JVMで テンプレートに迷っている あなたに伝えたい "Groovy Template" @grimrose 2014-10-17 テンプレートエンジンNight
あなた誰? AboutMe { name "よしだ" twitter “@grimrose” favorite { lang
"Groovy" ide "IntelliJ IDEA" } }
Yokohama.groovy #yokohamagroovy #mattarigrails
話すこと • Groovyの紹介 • ヒアドキュメント • テンプレートエンジン • 用途
話さないこと • 詳細
Groovyとは?
Groovyとは • JVM上で動作する選択的型付け言語 • Javaより簡潔 • Javaの資産が使える • スクリプトも書ける •
etc...
ヒアドキュメント
ヒアドキュメント String
ヒアドキュメント def doc1 = '''Groovyは、 ヒアドキュメントが 書けます。 '''
ヒアドキュメント GString
ヒアドキュメント def bean = [ message: '出来ます' ] def doc2
= """ こんな感じに 式展開も${bean.message}。 """
テンプレートエンジン
テンプレートエンジン groovy-all.jar (とりあえず)
テンプレートエンジン • groovy.text • Template • TemplateEngine • SimpleTemplateEngine •
GStringTemplateEngine • XmlTemplateEngine
テンプレートエンジン G*Magazine Vol.6 オレオレ・プログラミング GROOVY
テンプレートエンジン XML/HTML
テンプレートエンジン Markup Template Engine
テンプレートエンジン ''' html { body { div(class: "container") { p
"$placeHolder" } } }
テンプレートエンジン <html> <body> <div class="container"> <p>Hello Groovy!</p> </div> </body> </html>
テンプレートエンジン • groovy.text.markup • TemplateConfiguration • MarkupTemplateEngine
テンプレートエンジン Groovy 2.3
テンプレートエンジン Type checked templates
テンプレートエンジン groovy-lang.org/templating.html
テンプレートエンジン Object to HTML, XML, JSON
テンプレートエンジン 動的に作りたいですよね?
テンプレートエンジン Builder
テンプレートエンジン • groovy.xml • MarkupBuilder • StreamingMarkupBuilder • groovy.json •
JsonBuilder • StreamingJsonBuilder
用途
用途 • 組み込み • オレオレ自動生成ツール • HTML
組み込み • XML • JSON • メール • etc...
オレオレ自動生成ツール
オレオレ自動生成ツール • xxx.properties • xxx.json • xxx.xml • xxx.java •
xxx.sql • etc...
HTML
HTML Grails grails.org
HTML Spring Boot projects.spring.io/spring-boot/
HTML Ratpack www.ratpack.io
HTML Yoke pmlopes.github.io/yoke/
HTML Aeromock github.com/CyberAgent/aeromock
最後に
最後に Groovy Template いかがでしょうか?
最後に ご清聴ありがとうございました