Java 类com.fasterxml.jackson.annotation.JsonIdentityReference 实例源码

项目:dhis2-core    文件:Option.java   
@JsonProperty
@JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "organisationUnit", namespace = DxfNamespaces.DXF_2_0 )
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
@JsonIdentityReference(alwaysAsId=true)
public Set<OrganisationUnit> getOrganisationUnits()
{
    return organisationUnits;
}
项目:QuizUpWinner    文件:JacksonAnnotationIntrospector.java   
public ObjectIdInfo findObjectReferenceInfo(Annotated paramAnnotated, ObjectIdInfo paramObjectIdInfo)
{
  JsonIdentityReference localJsonIdentityReference = (JsonIdentityReference)paramAnnotated.getAnnotation(JsonIdentityReference.class);
  if (localJsonIdentityReference != null)
    paramObjectIdInfo = paramObjectIdInfo.withAlwaysAsId(localJsonIdentityReference.alwaysAsId());
  return paramObjectIdInfo;
}
项目:gwt-jackson    文件:PropertyProcessor.java   
private static void processBeanAnnotation( TreeLogger logger, JacksonTypeOracle typeOracle, RebindConfiguration configuration, JType
        type, PropertyAccessors propertyAccessors, PropertyInfoBuilder builder ) throws UnableToCompleteException {

    // identity
    Optional<JsonIdentityInfo> jsonIdentityInfo = propertyAccessors.getAnnotation( JsonIdentityInfo.class );
    Optional<JsonIdentityReference> jsonIdentityReference = propertyAccessors.getAnnotation( JsonIdentityReference.class );

    // type info
    Optional<JsonTypeInfo> jsonTypeInfo = propertyAccessors.getAnnotation( JsonTypeInfo.class );
    Optional<JsonSubTypes> propertySubTypes = propertyAccessors.getAnnotation( JsonSubTypes.class );

    // if no annotation is present that overrides bean processing, we just stop now
    if ( !jsonIdentityInfo.isPresent() && !jsonIdentityReference.isPresent() && !jsonTypeInfo.isPresent() && !propertySubTypes
            .isPresent() ) {
        // no override on field
        return;
    }

    // we need to find the bean to apply annotation on
    Optional<JClassType> beanType = extractBeanType( logger, typeOracle, type, builder.getPropertyName() );

    if ( beanType.isPresent() ) {
        if ( jsonIdentityInfo.isPresent() || jsonIdentityReference.isPresent() ) {
            builder.setIdentityInfo( BeanProcessor.processIdentity( logger, typeOracle, configuration, beanType
                    .get(), jsonIdentityInfo, jsonIdentityReference ) );
        }

        if ( jsonTypeInfo.isPresent() || propertySubTypes.isPresent() ) {
            builder.setTypeInfo( BeanProcessor.processType( logger, typeOracle, configuration, beanType
                    .get(), jsonTypeInfo, propertySubTypes ) );
        }
    } else {
        logger.log( Type.WARN, "Annotation present on property " + builder.getPropertyName() + " but no valid bean has been found." );
    }
}
项目:GitHub    文件:ByIdProperty.java   
@JsonIdentityReference(alwaysAsId = true)
@JsonIdentityInfo(
    resolver = ByidInstanceResolver.class,
    generator = ObjectIdGenerators.PropertyGenerator.class,
    property = "id")
Byid b();
项目:turing    文件:TurDataGroupSentence.java   
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
public TurMLCategory getTurMLCategory() {
    return this.turMLCategory;
}
项目:gwt-jackson    文件:BeanProcessor.java   
private static Optional<BeanIdentityInfo> processIdentity( TreeLogger logger, JacksonTypeOracle typeOracle, RebindConfiguration
        configuration, JClassType type ) throws UnableToCompleteException {
    return processIdentity( logger, typeOracle, configuration, type, Optional.<JsonIdentityInfo>absent(), Optional
            .<JsonIdentityReference>absent() );
}
项目:gwt-jackson    文件:ObjectIdBackReferenceTester.java   
@JsonProperty( "owner" )
@JsonIdentityReference
void setOwner( Owner owner ) {
    this.owner = owner;
}
项目:immutables    文件:ByIdProperty.java   
@JsonIdentityReference(alwaysAsId = true)
@JsonIdentityInfo(
    resolver = ByidInstanceResolver.class,
    generator = ObjectIdGenerators.PropertyGenerator.class,
    property = "id")
Byid b();