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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
940
ぼっちプロジェクトとアジャイルサムライ
grimrose
0
300
Shibuya.Java #04
grimrose
1
650
I made out Gradle plug-in
grimrose
0
960
Other Decks in Programming
See All in Programming
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.1k
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.4k
OSもどきOS
arkw
0
440
Oxcを導入して開発体験が向上した話
yug1224
4
280
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
540
Swiftのレキシカルスコープ管理
kntkymt
0
210
Webフレームワークの ベンチマークについて
yusukebe
0
130
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
450
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
2.8k
関係性から理解する"同一性"の型用語たち
pvcresin
2
640
エージェンティックRAGにAWSで入門しよう!
har1101
7
1.1k
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
140
Six Lessons from altMBA
skipperchong
29
4.3k
Google's AI Overviews - The New Search
badams
0
1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
Rails Girls Zürich Keynote
gr2m
96
14k
How to build a perfect <img>
jonoalderson
1
5.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
400
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Chasing Engaging Ingredients in Design
codingconduct
0
210
Claude Code のすすめ
schroneko
67
230k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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 いかがでしょうか?
最後に ご清聴ありがとうございました