JOOX - Java Object Oriented XML
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

JOOX - Java Object Oriented XML

on

  • 898 views

 

Statistics

Views

Total Views
898
Views on SlideShare
898
Embed Views
0

Actions

Likes
1
Downloads
3
Comments
1

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Thanks again for publishing this presentation!

    There's another presentation about jOOQ - Java Object Oriented Querying on Slideshare, here:

    http://de.slideshare.net/LukasEder1/20131104-jjooq-topconf-2013
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

JOOX - Java Object Oriented XML Presentation Transcript

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