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
860
ぼっちプロジェクトとアジャイルサムライ
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
やっと腹落ち「スプリント毎に動くモノをリリースする」〜ゼロから始めるメガバンクグループのアジャイル実践〜
sasakendayo
0
130
Duke on CRaC with Jakarta EE
ivargrimstad
0
100
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
740
CloudNativePGを布教したい
nnaka2992
0
120
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
260
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
180
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
290
オレを救った Cline を紹介する
codehex
13
13k
Domain-Driven Design (Tutorial)
hschwentner
13
22k
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
130
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
300
たのしいSocketのしくみ / Socket Under a Microscope
coe401_
8
1.4k
Featured
See All Featured
Designing Experiences People Love
moore
140
23k
Speed Design
sergeychernyshev
27
820
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Being A Developer After 40
akosma
89
590k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
11
1.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
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 いかがでしょうか?
最後に ご清聴ありがとうございました