-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #8 Add support for mix-in annotations
- Loading branch information
Showing
50 changed files
with
2,390 additions
and
270 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
60 changes: 60 additions & 0 deletions
60
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/annotation/JsonMixIns.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,60 @@ | ||
/* | ||
* Copyright 2014 Nicolas Morel | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.github.nmorel.gwtjackson.client.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import com.fasterxml.jackson.annotation.JacksonAnnotation; | ||
import com.github.nmorel.gwtjackson.client.ObjectMapper; | ||
import com.github.nmorel.gwtjackson.client.ObjectReader; | ||
import com.github.nmorel.gwtjackson.client.ObjectWriter; | ||
|
||
/** | ||
* Annotation used to define mix-in annotations specific to the annotated {@link ObjectMapper}, | ||
* {@link ObjectReader} or {@link ObjectWriter}. | ||
* | ||
* @author Nicolas Morel. | ||
*/ | ||
@Target( {ElementType.TYPE} ) | ||
@Retention( RetentionPolicy.CLASS ) | ||
@JacksonAnnotation | ||
public @interface JsonMixIns { | ||
|
||
/** | ||
* List of {@link JsonMixIn} annotations | ||
*/ | ||
public JsonMixIn[] value(); | ||
|
||
/** | ||
* Definition of a mix-in annotation. | ||
*/ | ||
public @interface JsonMixIn { | ||
|
||
/** | ||
* Class targeted by the mix-in annotation | ||
*/ | ||
public Class<?> target(); | ||
|
||
/** | ||
* Mix-in class | ||
*/ | ||
public Class<?> mixIn(); | ||
} | ||
} |
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
Oops, something went wrong.