org.codehaus.jackson.annotate.JsonTypeInfo.As Java Examples

The following examples show how to use org.codehaus.jackson.annotate.JsonTypeInfo.As. 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: ObjectMapperFactory.java    From Bats with Apache License 2.0 5 votes vote down vote up
public static ObjectMapper getOperatorValueSerializer()
{
  ObjectMapper returnVal = new ObjectMapper();
  returnVal.setVisibilityChecker(new VC());
  returnVal.configure(org.codehaus.jackson.map.SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
  returnVal.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, As.WRAPPER_OBJECT);
  returnVal.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
  return returnVal;
}
 
Example #2
Source File: ObjectMapperFactory.java    From Bats with Apache License 2.0 5 votes vote down vote up
public static ObjectMapper getOperatorValueDeserializer()
{
  ObjectMapper returnVal = new ObjectMapper();
  returnVal.setVisibilityChecker(new VC());
  returnVal.configure(org.codehaus.jackson.map.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  returnVal.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, As.WRAPPER_OBJECT);
  return returnVal;
}
 
Example #3
Source File: ObjectMapperFactory.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
public static ObjectMapper getOperatorValueSerializer()
{
  ObjectMapper returnVal = new ObjectMapper();
  returnVal.setVisibilityChecker(new VC());
  returnVal.configure(org.codehaus.jackson.map.SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
  returnVal.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, As.WRAPPER_OBJECT);
  returnVal.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
  return returnVal;
}
 
Example #4
Source File: ObjectMapperFactory.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
public static ObjectMapper getOperatorValueDeserializer()
{
  ObjectMapper returnVal = new ObjectMapper();
  returnVal.setVisibilityChecker(new VC());
  returnVal.configure(org.codehaus.jackson.map.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  returnVal.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, As.WRAPPER_OBJECT);
  return returnVal;
}
 
Example #5
Source File: AuditImpl.java    From Asqatasun with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
@XmlElementRefs({
    @XmlElementRef(type = org.asqatasun.entity.subject.PageImpl.class),
    @XmlElementRef(type = org.asqatasun.entity.subject.SiteImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.asqatasun.entity.subject.PageImpl.class, name="Page"),
    @JsonSubTypes.Type(value=org.asqatasun.entity.subject.SiteImpl.class, name="Site")})
public WebResourceImpl getSubject() {
    return subject;
}
 
Example #6
Source File: AuditImpl.java    From Asqatasun with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.asqatasun.entity.parameterization.ParameterImpl.class, name="Parameter")})
public Collection<Parameter> getParameterSet() {
    if (this.parameterSet == null) {
        this.parameterSet = new HashSet<>();
    }
    return (Collection)parameterSet;
}