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
3
5.3k
I wanna tell you about "Groovy Template"
テンプレートエンジンNight
http://www.zusaar.com/event/10707003
grimrose
October 17, 2014
Tweet
Share
More Decks by grimrose
See All by grimrose
だいたい10分くらいで 知った気になれる Vert.x 3.0 #渋谷Java / Shibuya.java #11
grimrose
0
1.8k
Syobochim should read book of modeling #syoboben
grimrose
0
1.7k
Gradleで始めるGroovy expand #jjug_ccc #ccc_r14
grimrose
4
5.9k
Groovy Shell with Gradle
grimrose
0
5.2k
Shibuya.Java #07
grimrose
0
830
Ambiguous Groups #sqlap
grimrose
0
870
ぼっちプロジェクトとアジャイルサムライ
grimrose
0
260
Shibuya.Java #04
grimrose
1
610
I made out Gradle plug-in
grimrose
0
910
Other Decks in Programming
See All in Programming
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
260
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
520
TypeScript LSP の今までとこれから
quramy
1
500
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
210
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
300
Perlで痩せる
yuukis
1
680
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
160
カクヨムAndroidアプリのリブート
numeroanddev
0
420
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
110
業務自動化をJavaとSeleniumとAWS Lambdaで実現した方法
greenflagproject
1
110
Create a website using Spatial Web
akkeylab
0
280
Passkeys for Java Developers
ynojima
3
860
Featured
See All Featured
BBQ
matthewcrist
89
9.7k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
A designer walks into a library…
pauljervisheath
206
24k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
910
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Faster Mobile Websites
deanohume
307
31k
Agile that works and the tools we love
rasmusluckow
329
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
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 いかがでしょうか?
最後に ご清聴ありがとうございました