本文整理汇总了Java中com.fasterxml.jackson.annotation.JsonRawValue类的典型用法代码示例。如果您正苦于以下问题:Java JsonRawValue类的具体用法?Java JsonRawValue怎么用?Java JsonRawValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsonRawValue类属于com.fasterxml.jackson.annotation包,在下文中一共展示了JsonRawValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOutput
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonRawValue
public List<Output> getOutput() {
return output;
}
示例2: getDataAsJson
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonRawValue
@JsonProperty("data")
public String getDataAsJson() throws JsonProcessingException {
if (json == null) {
json = Json.mapper().writeValueAsString(data);
}
return json;
}
示例3: createContextual
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctx,
BeanProperty property) throws JsonMappingException {
if (property != null && property.getMember().getAnnotation(JsonRawValue.class) != null) {
return this;
}
return new StringDeserializer();
}
示例4: checkMethodHasJsonRawValueAnnotation
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
/**
* TODO(P2) try to do this with aspect @DeclareError
*
* Checks that the method annotated with {@link JsonRawString} also has the
* {@link JsonRawValue} for Jackson to actually serialize as expected.
*
* @param pjp
*/
private void checkMethodHasJsonRawValueAnnotation(ProceedingJoinPoint pjp) {
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
Method targetMethod = methodSignature.getMethod();
if (targetMethod.getAnnotation(JsonRawValue.class) == null) {
throw new RuntimeException("The method annotated with @JsonRawString must also be annotated with @JsonRawValue");
}
}
示例5: getBody
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonRawValue
public String getBody() {
if(body != null && body.trim().isEmpty()) {
return null;
}
return body;
}
示例6: getValue
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonProperty
@JsonRawValue
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getValue()
{
return value;
}
示例7: findSerializer
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
public Object findSerializer(Annotated paramAnnotated)
{
JsonSerialize localJsonSerialize = (JsonSerialize)paramAnnotated.getAnnotation(JsonSerialize.class);
if (localJsonSerialize != null)
{
Class localClass = localJsonSerialize.using();
if (localClass != JsonSerializer.None.class)
return localClass;
}
JsonRawValue localJsonRawValue = (JsonRawValue)paramAnnotated.getAnnotation(JsonRawValue.class);
if ((localJsonRawValue != null) && (localJsonRawValue.value()))
return new RawSerializer(paramAnnotated.getRawType());
return null;
}
示例8: updateBuilder
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@Override
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc,
BeanDeserializerBuilder builder) {
Iterator<SettableBeanProperty> it = builder.getProperties();
while (it.hasNext()) {
SettableBeanProperty p = it.next();
if (p.getAnnotation(JsonRawValue.class) != null) {
builder.addOrReplaceProperty(p.withValueDeserializer(JsonAsStringDeserializer.INSTANCE), true);
}
}
return builder;
}
示例9: getAllMetrics
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonRawValue
public String getAllMetrics() {
return allMetrics;
}
示例10: setDataFromJson
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonRawValue
@JsonProperty("data")
public void setDataFromJson(JsonNode json) throws JsonProcessingException {
this.data = null;
this.json = Json.mapper().writeValueAsString(json);
}
示例11: getEvent
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonGetter
@JsonRawValue
public String getEvent() {
return event;
}
示例12: getValue
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonValue
@JsonRawValue
public String getValue() {
return value;
}
示例13: getMe
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonView(RestrictedViews.Public.class)
@JsonRawValue
@JsonProperty
public String getMe() {
return me;
}
示例14: getMessageAsJson
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonProperty(value = "message")
@JsonRawValue
@JsonRawString
public String getMessageAsJson() {
return message;
}
示例15: getErrorMessageAsJson
import com.fasterxml.jackson.annotation.JsonRawValue; //导入依赖的package包/类
@JsonProperty(value = "errorMessage")
@JsonRawValue
@JsonRawString
public String getErrorMessageAsJson() {
return errorMessage;
}