Java 类org.codehaus.jackson.annotate.JsonTypeInfo 实例源码

项目:communote-server    文件:MessagesConverterImpl.java   
/**
 * Inits the.
 */
@Validate
public void init() {
    ObjectMapper mapper = new ObjectMapper();
    mapper.enableDefaultTyping(
            ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE,
            JsonTypeInfo.As.PROPERTY);
    DeserializerProvider p = mapper.getDeserializerProvider();
    // mapper.setPropertyNamingStrategy(new
    // DotNetTollerantNamingStrategy());
    mapper.setDeserializerProvider(p);
    setMapper(mapper);
}
项目:RHome    文件:StdTypeResolverBuilder.java   
public StdTypeResolverBuilder init(JsonTypeInfo.Id idType, TypeIdResolver idRes)
{
    // sanity checks
    if (idType == null) {
        throw new IllegalArgumentException("idType can not be null");
    }
    _idType = idType;
    _customIdResolver = idRes;
    // Let's also initialize property name as per idType default
    _typeProperty = idType.getDefaultPropertyName();
    return this;
}
项目:RHome    文件:StdTypeResolverBuilder.java   
public StdTypeResolverBuilder inclusion(JsonTypeInfo.As includeAs) {
    if (includeAs == null) {
        throw new IllegalArgumentException("includeAs can not be null");
    }
    _includeAs = includeAs;
    return this;
}
项目:RHome    文件:ObjectMapper.java   
public ObjectMapper enableDefaultTyping(DefaultTyping dti, JsonTypeInfo.As includeAs)
{
    TypeResolverBuilder<?> typer = new DefaultTypeResolverBuilder(dti);
    // we'll always use full class name, when using defaulting
    typer = typer.init(JsonTypeInfo.Id.CLASS, null);
    typer = typer.inclusion(includeAs);
    return setDefaltTyping(typer);
}
项目:Tanaguru    文件:WebResourceImpl.java   
@Override
@XmlElementWrapper
@XmlElementRefs({
    @XmlElementRef(type = org.tanaguru.entity.audit.IndefiniteResultImpl.class),
    @XmlElementRef(type = org.tanaguru.entity.audit.DefiniteResultImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.audit.IndefiniteResultImpl.class, name="Indefinite"),
    @JsonSubTypes.Type(value=org.tanaguru.entity.audit.DefiniteResultImpl.class, name="Definite")})
public Collection<ProcessResult> getProcessResultList() {
    return (Collection)processResultSet;
}
项目:Tanaguru    文件:AuditImpl.java   
@Override
@XmlElementRefs({
    @XmlElementRef(type = org.tanaguru.entity.subject.PageImpl.class),
    @XmlElementRef(type = org.tanaguru.entity.subject.SiteImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.subject.PageImpl.class, name="Page"),
    @JsonSubTypes.Type(value=org.tanaguru.entity.subject.SiteImpl.class, name="Site")})
public WebResourceImpl getSubject() {
    return subject;
}
项目:Tanaguru    文件:AuditImpl.java   
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterImpl.class, name="Parameter")})
public Collection<Parameter> getParameterSet() {
    if (this.parameterSet == null) {
        this.parameterSet = new HashSet<>();
    }
    return (Collection)parameterSet;
}
项目:Tanaguru    文件:ProcessRemarkImpl.java   
@Override
@XmlElementWrapper
@XmlElementRefs({
    @XmlElementRef(type = org.tanaguru.entity.audit.EvidenceElementImpl.class)})
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.audit.EvidenceElementImpl.class, name="EvidenceElement")})
public Collection<EvidenceElement> getElementList() {
    return (Collection)elementSet;
}
项目:Tanaguru    文件:ProcessResultImpl.java   
@Override
    @XmlElementWrapper
    @XmlElementRefs({
        @XmlElementRef(type = org.tanaguru.entity.audit.ProcessRemarkImpl.class),
        @XmlElementRef(type = org.tanaguru.entity.audit.SourceCodeRemarkImpl.class)})
    @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
    @JsonSubTypes({
        @JsonSubTypes.Type(value=org.tanaguru.entity.audit.ProcessRemarkImpl.class, name="ProcessRemark"), 
        @JsonSubTypes.Type(value=org.tanaguru.entity.audit.SourceCodeRemarkImpl.class, name="SourceCodeRemark")})
//    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    public Collection<ProcessRemark> getRemarkSet() {
        return (Collection)remarkSet;
    }
项目:Tanaguru    文件:ProcessResultImpl.java   
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.TestImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.reference.TestImpl.class, name="Test")})
public Test getTest() {
    return test;
}
项目:Tanaguru    文件:EvidenceElementImpl.java   
@XmlTransient
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.audit.EvidenceImpl.class, name="Evidence")})
public Evidence getEvidence() {
    return (Evidence) evidence;
}
项目:Tanaguru    文件:DefiniteResultImpl.java   
@Override
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.audit.TestSolution.class, name="TestSolution")})
public Object getValue() {
    return getDefiniteValue();
}
项目:Tanaguru    文件:ParameterImpl.java   
@Override
@XmlElementWrapper
@XmlElementRef(type = org.tanaguru.entity.parameterization.ParameterElementImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterElementImpl.class, name="ParameterElement")})
public void setParameterElement(ParameterElement parameterElement) {
    this.parameterElement = (ParameterElementImpl)parameterElement;
}
项目:Tanaguru    文件:ParameterElementImpl.java   
@Override
@XmlElementWrapper
@XmlElementRef(type = org.tanaguru.entity.parameterization.ParameterFamilyImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.parameterization.ParameterFamilyImpl.class, name="ParameterFamily")})
public void setParameterFamily(ParameterFamily parameterFamily) {
    this.parameterFamily = (ParameterFamilyImpl)parameterFamily;
}
项目:Tanaguru    文件:TestImpl.java   
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.CriterionImpl.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value = org.tanaguru.entity.reference.CriterionImpl.class, name = "Criterion")})
public Criterion getCriterion() {
    return this.criterion;
}
项目:Tanaguru    文件:TestImpl.java   
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.LevelImpl.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value = org.tanaguru.entity.reference.LevelImpl.class, name = "Level")})
public Level getLevel() {
    return this.level;
}
项目:Tanaguru    文件:TestImpl.java   
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.ScopeImpl.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value = org.tanaguru.entity.reference.ScopeImpl.class, name = "Scope")})
public Scope getScope() {
    return this.scope;
}
项目:Tanaguru    文件:CriterionImpl.java   
@Override
@XmlElementRef(type = org.tanaguru.entity.reference.ThemeImpl.class)
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
    @JsonSubTypes.Type(value=org.tanaguru.entity.reference.ThemeImpl.class, name="Theme")})
public Theme getTheme() {
    return theme;
}
项目:curator    文件:ServiceInstance.java   
@JsonTypeInfo(use=Id.CLASS, defaultImpl=Object.class)
public T getPayload()
{
    return payload;
}
项目:curator    文件:OldServiceInstance.java   
@JsonTypeInfo(use = Id.CLASS, defaultImpl = Object.class)
public T getPayload()
{
    return payload;
}
项目:curator    文件:TestNewServiceInstance.java   
@JsonTypeInfo(use = Id.CLASS, defaultImpl = Object.class)
public T getPayload()
{
    return payload;
}
项目:ovirt-optimizer    文件:JacksonContextResolver.java   
public OvirtTypeResolverBuilder() {
    super(ObjectMapper.DefaultTyping.NON_FINAL);

    init(JsonTypeInfo.Id.CLASS, null);
    inclusion(JsonTypeInfo.As.PROPERTY);
}
项目:RHome    文件:AsPropertyTypeDeserializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() {
    return JsonTypeInfo.As.PROPERTY;
}
项目:RHome    文件:AsArrayTypeDeserializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() {
    return JsonTypeInfo.As.WRAPPER_ARRAY;
}
项目:RHome    文件:TypeSerializerBase.java   
@Override
public abstract JsonTypeInfo.As getTypeInclusion();
项目:RHome    文件:AsWrapperTypeDeserializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() {
    return JsonTypeInfo.As.WRAPPER_OBJECT;
}
项目:RHome    文件:AsWrapperTypeSerializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() { return JsonTypeInfo.As.WRAPPER_OBJECT; }
项目:RHome    文件:AsPropertyTypeSerializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() { return JsonTypeInfo.As.PROPERTY; }
项目:RHome    文件:AsArrayTypeSerializer.java   
@Override
public JsonTypeInfo.As getTypeInclusion() { return JsonTypeInfo.As.WRAPPER_ARRAY; }
项目:RHome    文件:TypeDeserializerBase.java   
@Override
public abstract JsonTypeInfo.As getTypeInclusion();
项目:RHome    文件:TypeDeserializer.java   
/**
 * Accessor for type information inclusion method
 * that deserializer uses; indicates how type information
 * is (expected to be) embedded in JSON input.
 */
public abstract JsonTypeInfo.As getTypeInclusion();
项目:RHome    文件:TypeIdResolver.java   
/**
 * Accessor for mechanism that this resolver uses for determining
 * type id from type.
 */
public JsonTypeInfo.Id getMechanism();
项目:RHome    文件:TypeResolverBuilder.java   
/**
 * Initialization method that is called right after constructing
 * the builder instance.
 *
 * @param idType Which type metadata is used
 * @param res (optional) Custom type id resolver used, if any
 * 
 * @return Resulting builder instance (usually this builder,
 *   but not necessarily)
 */
public T init(JsonTypeInfo.Id idType, TypeIdResolver res);
项目:RHome    文件:TypeResolverBuilder.java   
/**
 * Method for specifying mechanism to use for including type metadata
 * in JSON.
 * If not explicitly called, setting defaults to
 * {@link JsonTypeInfo.As#PROPERTY}.
 * 
 * @param includeAs Mechanism used for including type metadata in JSON
 * 
 * @return Resulting builder instance (usually this builder,
 *   but not necessarily)
 */
public T inclusion(JsonTypeInfo.As includeAs);
项目:RHome    文件:ObjectMapper.java   
/**
 * Convenience method that is equivalant to calling
 *<pre>
 *  enableObjectTyping(dti, JsonTypeInfo.As.WRAPPER_ARRAY);
 *</pre>
 */
public ObjectMapper enableDefaultTyping(DefaultTyping dti) {
    return enableDefaultTyping(dti, JsonTypeInfo.As.WRAPPER_ARRAY);
}
项目:RHome    文件:TypeSerializer.java   
/**
 * Accessor for type information inclusion method
 * that serializer uses; indicates how type information
 * is embedded in resulting JSON.
 */
public abstract JsonTypeInfo.As getTypeInclusion();
项目:RHome    文件:TypeNameIdResolver.java   
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.NAME; }
项目:RHome    文件:ClassNameIdResolver.java   
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.CLASS; }
项目:RHome    文件:MinimalClassNameIdResolver.java   
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.MINIMAL_CLASS; }