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.1k
Shibuya.Java #07
grimrose
0
800
Ambiguous Groups #sqlap
grimrose
0
850
ぼっちプロジェクトとアジャイルサムライ
grimrose
0
250
Shibuya.Java #04
grimrose
1
600
I made out Gradle plug-in
grimrose
0
900
Other Decks in Programming
See All in Programming
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
740
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
240
sappoRo.R #12 初心者セッション
kosugitti
0
240
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
380
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
1
180
時計仕掛けのCompose
mkeeda
1
290
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
220
SpringBoot3.4の構造化ログ #kanjava
irof
2
980
GAEログのコスト削減
mot_techtalk
0
120
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
35
14k
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
340
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.9k
Featured
See All Featured
A better future with KSS
kneath
238
17k
GitHub's CSS Performance
jonrohan
1030
460k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Embracing the Ebb and Flow
colly
84
4.6k
Why Our Code Smells
bkeepers
PRO
336
57k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
320
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
YesSQL, Process and Tooling at Scale
rocio
171
14k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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 いかがでしょうか?
最後に ご清聴ありがとうございました