This repository has been archived by the owner on Nov 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
defined an annotation to control Mapper.serializeAs
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
xstream/src/java/com/thoughtworks/xstream/annotations/XStreamSerializeAs.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,25 @@ | ||
package com.thoughtworks.xstream.annotations; | ||
|
||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.*; | ||
import static java.lang.annotation.RetentionPolicy.*; | ||
|
||
/** | ||
* Designates that the type and its derived types will serialize | ||
* as the specified type. This is useful if you want an entire | ||
* family of types serialize as the base type with its special converter. | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
@Retention(RUNTIME) | ||
@Target(TYPE) | ||
@Inherited | ||
public @interface XStreamSerializeAs { | ||
/** | ||
* Use {@code void.class} to cancel out the annotation defined in the super type. | ||
*/ | ||
Class<?> value(); | ||
} |
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