MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • Java
  • Gson

Gson

Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.

  • https://github.com/google/gson/blob/master/UserGuide.md

Maven

 <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.5</version>
      <scope>compile</scope>
    </dependency>

@Expose annotation

To use this annotation, you must create Gson by using new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(). The Gson instance created will exclude all fields in a class that are not marked with @Expose annotation.

  • http://google.github.io/gson/apidocs/com/google/gson/annotations/Expose.html

  • GSON gson = new GsonBuilder.excludeFieldsWithoutExposeAnnotation().create()

@SerializedName annotation

Sets the field name in the serialized JSON.

  • http://google.github.io/gson/apidocs/com/google/gson/annotations/SerializedName.html

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01