SlideShare a Scribd company logo
1 of 15
Download to read offline
JOOX
Jakub Kubrynski
jkubrynski@gmail.com
http://www.kubrynski.com/
-------------------------------------------
JOOX
Java
Object
Oriented
XML
-------------------------------------------
CORE PRINCIPLES
- Simple wrapper for org.w3c.dom
- Inspired JOOQ
- Matches jQuery API
- Uses DOMParser internally
-------------------------------------------
GETTING JOOX
- Maven
dependency< >
groupId org.jooq /groupId< > < >
artifactId joox /artifactId< > < >
version 1.1.0 /version< > < >
/dependency< >
- Gradle 'org.jooq:joox:1.1.0'
-------------------------------------------
READING FILE
import static org.joox.JOOX.*;
Match document =
$(new File("pom.xml"));
-------------------------------------------
FINDING
Match dependencies =
document.find(„dependencies”);
-------------------------------------------
FILTERING
Match dependencies =
document.find(„dependency”)
.filter(even());
- or(...), and(...), all(), none()
- even(), odd()
- at(...), ids(...)
-------------------------------------------
XPATH
Match dependencies =
document.xpath(„//dependency”);
-------------------------------------------
ATTRIBUTES
String xmlns =
document.attr(„xmlns”);
String newValue =
document.attr(„id”, „100”);
-------------------------------------------
MODIFICATION
document
.children("version")
.content("1.0.1-SNAPSHOT");
Match trans = $("trans");
trans.append($("id", "102"));
trans.append($("client",$("name","Jan")));
WHAT
ELSE?
-------------------------------------------
JOOQ
- create.selectFrom(BOOK)
.where(PUBLISHED_IN.equal(2011))
.and(LANGUAGE.eq(„PL”))
.orderBy(TITLE)
.limit(20)
.offset(100)
-------------------------------------------
JOOR
String world = on("java.lang.String")
.create("Hello World")
.call("substring", 6)
.call("toString")
.get();
-------------------------------------------
LINKS
- http://www.jooq.org/
- http://code.google.com/p/joox/
- http://code.google.com/p/joor/
DEMO!!

More Related Content

More from Jakub Kubrynski

Work sample coding tests
Work sample coding testsWork sample coding tests
Work sample coding testsJakub Kubrynski
 
6 key tips for conducting an effective skill assessment interview
6 key tips for conducting an effective skill assessment interview6 key tips for conducting an effective skill assessment interview
6 key tips for conducting an effective skill assessment interviewJakub Kubrynski
 
JVM Dive for mere mortals
JVM Dive for mere mortalsJVM Dive for mere mortals
JVM Dive for mere mortalsJakub Kubrynski
 
Consumer Driven Contracts - 4Developers 2015
Consumer Driven Contracts - 4Developers 2015Consumer Driven Contracts - 4Developers 2015
Consumer Driven Contracts - 4Developers 2015Jakub Kubrynski
 
REST - the good and the bad parts
REST - the good and the bad partsREST - the good and the bad parts
REST - the good and the bad partsJakub Kubrynski
 
REST - the good and the bad parts
REST - the good and the bad partsREST - the good and the bad parts
REST - the good and the bad partsJakub Kubrynski
 
What you won't read in books about RESTful services
What you won't read in books about RESTful servicesWhat you won't read in books about RESTful services
What you won't read in books about RESTful servicesJakub Kubrynski
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!Jakub Kubrynski
 
Warsjawa profiling tools
Warsjawa profiling toolsWarsjawa profiling tools
Warsjawa profiling toolsJakub Kubrynski
 

More from Jakub Kubrynski (15)

Work sample coding tests
Work sample coding testsWork sample coding tests
Work sample coding tests
 
6 key tips for conducting an effective skill assessment interview
6 key tips for conducting an effective skill assessment interview6 key tips for conducting an effective skill assessment interview
6 key tips for conducting an effective skill assessment interview
 
JPA - Beyond copy-paste
JPA - Beyond copy-pasteJPA - Beyond copy-paste
JPA - Beyond copy-paste
 
JVM Dive for mere mortals
JVM Dive for mere mortalsJVM Dive for mere mortals
JVM Dive for mere mortals
 
-XX:+UseG1GC
-XX:+UseG1GC-XX:+UseG1GC
-XX:+UseG1GC
 
Consumer Driven Contracts - 4Developers 2015
Consumer Driven Contracts - 4Developers 2015Consumer Driven Contracts - 4Developers 2015
Consumer Driven Contracts - 4Developers 2015
 
REST - the good and the bad parts
REST - the good and the bad partsREST - the good and the bad parts
REST - the good and the bad parts
 
REST - the good and the bad parts
REST - the good and the bad partsREST - the good and the bad parts
REST - the good and the bad parts
 
What you won't read in books about RESTful services
What you won't read in books about RESTful servicesWhat you won't read in books about RESTful services
What you won't read in books about RESTful services
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
Warsjawa profiling tools
Warsjawa profiling toolsWarsjawa profiling tools
Warsjawa profiling tools
 
Warsjawa profiling
Warsjawa profilingWarsjawa profiling
Warsjawa profiling
 
Arquillian
ArquillianArquillian
Arquillian
 
Spring Data
Spring DataSpring Data
Spring Data
 
Profiling
ProfilingProfiling
Profiling
 

JOOX - Java Object Oriented XML