com.fasterxml.jackson.annotation.JsonValue Java Examples

The following examples show how to use com.fasterxml.jackson.annotation.JsonValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnumToStringConverter.java    From mica with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Nullable
private static AccessibleObject getAnnotation(Class<?> clazz) {
	Set<AccessibleObject> accessibleObjects = new HashSet<>();
	// JsonValue METHOD, FIELD
	Field[] fields = clazz.getDeclaredFields();
	Collections.addAll(accessibleObjects, fields);
	// methods
	Method[] methods = clazz.getDeclaredMethods();
	Collections.addAll(accessibleObjects, methods);
	for (AccessibleObject accessibleObject : accessibleObjects) {
		// 复用 jackson 的 JsonValue 注解
		JsonValue jsonValue = accessibleObject.getAnnotation(JsonValue.class);
		if (jsonValue != null && jsonValue.value()) {
			accessibleObject.setAccessible(true);
			return accessibleObject;
		}
	}
	return null;
}
 
Example #2
Source File: RoleIdentifier.java    From emodb with Apache License 2.0 5 votes vote down vote up
@JsonValue
@Override
public String toString() {
    if (_group == null) {
        // When a role has no group the string representation is just the id.
        return _id;
    }
    // Since "/" isn't a valid character in groups or ids it can be used as a separator without
    // needing to encode either component.
    return _group + "/" + _id;
}
 
Example #3
Source File: RabbitMQManagementAPI.java    From james-project with Apache License 2.0 4 votes vote down vote up
@JsonValue
String getValue() {
    return value;
}
 
Example #4
Source File: SerializableReIndexingExecutionFailures.java    From james-project with Apache License 2.0 4 votes vote down vote up
@JsonValue
public Multimap<String, SerializableReIndexingFailure> failures() {
    return failures.stream()
        .collect(Guavate.toImmutableListMultimap(SerializableReIndexingFailure::getSerializedMailboxId));
}
 
Example #5
Source File: Order.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@Override
@JsonValue
public String toString() {
  return String.valueOf(value);
}
 
Example #6
Source File: BigCatAllOf.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #7
Source File: DataWord.java    From nuls with MIT License 4 votes vote down vote up
@JsonValue
@Override
public String toString() {
    return sData != null ? sData : toHexString(data);
}
 
Example #8
Source File: Order.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #9
Source File: ARN.java    From xyz-hub with Apache License 2.0 4 votes vote down vote up
@JsonValue
@Override
public String toString() {
  return String.join(":", nonResourceParts) + ":" + resource;
}
 
Example #10
Source File: MoveFileRequest.java    From cyberduck with GNU General Public License v3.0 4 votes vote down vote up
@JsonValue
public Integer getValue() {
  return value;
}
 
Example #11
Source File: DatasetResourcePath.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@JsonValue
@Override
public String toString() {
  // the json value should be a valid URL
  return dataset.getUrlFromPath(asPath());
}
 
Example #12
Source File: BigCatAllOf.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #13
Source File: Pet.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #14
Source File: CheckResponse.java    From artifactory-resource with Apache License 2.0 4 votes vote down vote up
@JsonValue
public List<Version> getVersions() {
	return this.versions;
}
 
Example #15
Source File: SQLInput.java    From jobson with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
    return value;
}
 
Example #16
Source File: EnumTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public Double getValue() {
  return value;
}
 
Example #17
Source File: Benefit.java    From Xero-Java with MIT License 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #18
Source File: Operator.java    From james-project with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getName() {
    return name;
}
 
Example #19
Source File: EnumTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #20
Source File: EnumTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #21
Source File: NotificationSettings.java    From gitlab4j-api with MIT License 4 votes vote down vote up
@JsonValue
public String toValue() {
    return (enumHelper.toString(this));
}
 
Example #22
Source File: MapTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #23
Source File: ConfigRoomRequest.java    From cyberduck with GNU General Public License v3.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #24
Source File: Invoice.java    From Xero-Java with MIT License 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #25
Source File: EnumTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #26
Source File: ErrorMap.java    From couchbase-jvm-core with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String strategy() {
    return strategy;
}
 
Example #27
Source File: Constants.java    From gitlab4j-api with MIT License 4 votes vote down vote up
@JsonValue
public String toValue() {
    return (enumHelper.toString(this));
}
 
Example #28
Source File: PayRun.java    From Xero-Java with MIT License 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #29
Source File: EnumTest.java    From openapi-generator with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
  return value;
}
 
Example #30
Source File: SchemaJsonPropertyGeneratorTest.java    From rest-schemagen with Apache License 2.0 4 votes vote down vote up
@JsonValue
public String getValue() {
    return UPPER_UNDERSCORE.to(LOWER_CAMEL, name());
}