TAP5-2640: tapestry-json improvements

(implement Collection/Map, better exceptions)

tapestry-json: added JSONTypeMismatchException

Added JSONTypeMismatchException and JSONValueNotFoundException. JSONObject behaviour improved by using opt() isntead of get for mor specific types, so we can actually use the new exceptions.

tapestry-json: JSONArray get() now throws IndexOutOfBoundsException

There's no reason to repackage the original exception into a RuntimeException.

tapestry-json: JSONTokener constructors exceptions improved

tapestry-json: improve JSONSpec tests

tapestry-json: better exception building

tapestry-json: added JSONSyntaxException

tapesty-json: javadoc updated

tapestry-json: JSONArray non-finite/nan check fixed

The constructor wasn't using checkedPut, even though the javadoc states that doubles are checked.

tapestry-json: javadoc typo

tapestry-json: added JSONArrayIndexOutOfBoundsException

tapestry-json: code style

tapestrsy-json: fix lossy conversion

tapestry-json: source formatting

tapestry-json: throw IllegalArgumentException on invalid doubles

tapestry-json: JSONObject implements Map<String, Object>

To provide better interoperability with Java collections the JSONObject type now implements Map<String, Object>.

The needed changes are marginal:
- putAll -> now returns void (breaking change)
- Arguments for key are Object -> shouldn't be a problem

tapestry-json: added get{type}OrDefault methods to JSONObject

tapestry-json: make JSONArray a "real" Collection (wip)

tapestry-json: JSONArray improve javadoc

tapestry-json: JSONObject improve javadoc
14 files changed
tree: b6b88a94dd6b9b3f16224e812be0dca0a59a7eec
  1. .gitignore
  2. .travis.yml
  3. 54_RELEASE_NOTES.md
  4. 55_RELEASE_NOTES.md
  5. LICENSE.txt
  6. NOTICE.txt
  7. README.md
  8. beanmodel/
  9. build.gradle
  10. buildSrc/
  11. commons/
  12. genericsresolver-guava/
  13. gradle/
  14. gradlew
  15. gradlew.bat
  16. md5.gradle
  17. plastic/
  18. quickstart/
  19. settings.gradle
  20. sha256.gradle
  21. src/
  22. ssh.gradle
  23. support/
  24. tapestry-beanvalidator/
  25. tapestry-cdi/
  26. tapestry-clojure/
  27. tapestry-core/
  28. tapestry-func/
  29. tapestry-hibernate-core/
  30. tapestry-hibernate/
  31. tapestry-internal-test/
  32. tapestry-ioc-jcache/
  33. tapestry-ioc-junit/
  34. tapestry-ioc/
  35. tapestry-javadoc/
  36. tapestry-jmx/
  37. tapestry-jpa/
  38. tapestry-json/
  39. tapestry-kaptcha/
  40. tapestry-mongodb/
  41. tapestry-runner/
  42. tapestry-spring/
  43. tapestry-test-constants/
  44. tapestry-test-data/
  45. tapestry-test/
  46. tapestry-upload/
  47. tapestry-webresources/
  48. tapestry5-annotations/
README.md

Tapestry is a component-oriented Java web app framework focusing on performance and developer productivity.

A component is just a reusable part of a page. It's trivially easy to create your own components, and Tapestry comes with a large number of components you can use (Form, Loop, Select, Checkbox, Grid, BeanEditor, etc.).

In Tapestry, each page and component is a simple Java POJO with a corresponding HTML template. The HTML template and corresponding Java class have the same name (e.g. “Breadcrumbs.html” and “Breadcrumbs.java”), so you don‘t have to tell Tapestry which template uses which Java class. It’s automatic.

Tapestry features live class reloading: change your Java code, refresh the browser and see the changes instantly.

AJAX support allows you to create responsive web interfaces while writing little to no JavaScript. (But if you like writing JavaScript, great, no problem, Tapestry gets out of your way.)

Quick Start

Main article: Getting Started

You can let Apache Maven create your initial project for you:

mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org

Maven will prompt you for the archetype to create (“Tapestry 5 Quickstart Project”) and the exact version number (e.g., “5.4.3”). It also asks you for a group id, an artifact id, and a version number. Once Maven dowloads everything, then you can start the app:

$ cd newapp
$ mvn jetty:run

Then just send your browser to http://localhost:8080/newapp

See the Getting Started introduction as well as the Tapestry Tutorial for a deeper dive.

Main Docs

See https://tapestry.apache.org/documentation.html for the details on every Tapestry topic.