JOOX - Java Object Oriented XML

1,634 views

Published on

Published in: Technology, News & Politics
1 Comment
1 Like
Statistics
Notes
  • 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
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,634
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
7
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

JOOX - Java Object Oriented XML

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

×