-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
1,569 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
= Mature Modular Meta-framework (mmm) | ||
|
||
image:https://raw.github.com/m-m-m/mmm/master/src/site/resources/images/logo.png[logo] | ||
|
||
*Welcome to the wonderful world of http://m-m-m.sourceforge.net/index.html[mmm]!* | ||
|
||
== mmm-util-property | ||
|
||
This module is part of link:../../..#mmm-util[mmm-util] and brings extended JSON support including: | ||
|
||
* https://m-m-m.github.io/maven/apidocs/net/sf/mmm/util/json/api/JsonUtil.html[JsonUtil] for advanced generic JSON support based on JSON-P. | ||
* https://m-m-m.github.io/maven/apidocs/net/sf/mmm/util/json/api/JsonSupport.html[JsonSupport] interface as API for objects with build-in JSON support. | ||
* https://m-m-m.github.io/maven/apidocs/[and much more... ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>net.sf.m-m-m</groupId> | ||
<artifactId>mmm-util-modules</artifactId> | ||
<version>dev-SNAPSHOT</version> | ||
<relativePath>../modules/pom.xml</relativePath> | ||
</parent> | ||
<artifactId>mmm-util-json</artifactId> | ||
<version>${net.sf.mmm.util8.version}</version> | ||
<packaging>jar</packaging> | ||
<name>${project.artifactId}</name> | ||
<description>This project provides advanced JSON support based on JSON-P.</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>mmm-util-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.json</groupId> | ||
<artifactId>javax.json-api</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish</groupId> | ||
<artifactId>javax.json</artifactId> | ||
<version>1.0.4</version> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>mmm-util-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
json/src/main/java/net/sf/mmm/util/json/api/JsonSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 */ | ||
package net.sf.mmm.util.json.api; | ||
|
||
import javax.json.stream.JsonGenerator; | ||
import javax.json.stream.JsonParser; | ||
|
||
/** | ||
* This is the interface for an object that supports to {@link #toJson(JsonGenerator) serialize itself to JSON}. | ||
* | ||
* @author hohwille | ||
* @since 8.0.0 | ||
*/ | ||
public interface JsonSupport { | ||
|
||
/** The JSON property name for the type information for polymorphic mapping of {@link #getClass()}. */ | ||
String PROPERTY_TYPE = "@type"; | ||
|
||
/** | ||
* Serializes this object as JSON (JavaScript-Object-Notation). | ||
* | ||
* @see JsonHelper#toJson(JsonGenerator, String, Object) | ||
* | ||
* @param json the {@link JsonGenerator} where to write this object to. Has to be in | ||
* {@link JsonGenerator#writeStartObject()} state. | ||
*/ | ||
void toJson(JsonGenerator json); | ||
|
||
/** | ||
* Deserializes this object from JSON (JavaScript-Object-Notation). This operation is typically NOT symmetric to | ||
* {@link #toJson(JsonGenerator)} - e.g. {@link #toJson(JsonGenerator)} might write a property with its value while | ||
* {@link #fromJson(JsonParser)} may only deserialze the value as the parent object has to handle the property names | ||
* that may appear in any order. | ||
* | ||
* @param json the {@link JsonParser} to read from. | ||
*/ | ||
void fromJson(JsonParser json); | ||
|
||
} |
Oops, something went wrong.