當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonIdentityInfo類代碼示例

本文整理匯總了Java中com.fasterxml.jackson.annotation.JsonIdentityInfo的典型用法代碼示例。如果您正苦於以下問題:Java JsonIdentityInfo類的具體用法?Java JsonIdentityInfo怎麽用?Java JsonIdentityInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JsonIdentityInfo類屬於com.fasterxml.jackson.annotation包,在下文中一共展示了JsonIdentityInfo類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getOrganisationUnits

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
@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;
}
 
開發者ID:dhis2,項目名稱:dhis2-core,代碼行數:10,代碼來源:Option.java

示例2: getIdentityInfo

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
private void getIdentityInfo(ClassInformation information, ReflectClass<?> cls) {
    JsonIdentityInfo identity = cls.getAnnotation(JsonIdentityInfo.class);
    if (identity == null) {
        return;
    }

    Class<?> generator = identity.generator();
    if (generator.equals(ObjectIdGenerators.IntSequenceGenerator.class)) {
        information.idGenerator = IdGeneratorType.INTEGER;
    } else if (generator.equals(ObjectIdGenerators.PropertyGenerator.class)) {
        information.idGenerator = IdGeneratorType.PROPERTY;
    } else if (generator.equals(ObjectIdGenerators.None.class)) {
        information.idGenerator = IdGeneratorType.NONE;
    } else {
        information.idGenerator = IdGeneratorType.NONE;
        diagnostics.warning(null, "{{t0}}: unsupported identity generator {{t1}}", cls, generator);
    }

    if (information.idGenerator == IdGeneratorType.NONE) {
        information.idProperty = null;
    } else {
        information.idProperty = identity.property();
    }
}
 
開發者ID:konsoletyper,項目名稱:teavm-flavour,代碼行數:25,代碼來源:ClassInformationProvider.java

示例3: getTurMLCategory

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
public TurMLCategory getTurMLCategory() {
	return this.turMLCategory;
}
 
開發者ID:openviglet,項目名稱:turing,代碼行數:6,代碼來源:TurDataGroupSentence.java

示例4: findObjectIdInfo

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
public ObjectIdInfo findObjectIdInfo(Annotated paramAnnotated)
{
  JsonIdentityInfo localJsonIdentityInfo = (JsonIdentityInfo)paramAnnotated.getAnnotation(JsonIdentityInfo.class);
  if ((localJsonIdentityInfo == null) || (localJsonIdentityInfo.generator() == ObjectIdGenerators.None.class))
    return null;
  return new ObjectIdInfo(localJsonIdentityInfo.property(), localJsonIdentityInfo.scope(), localJsonIdentityInfo.generator());
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:8,代碼來源:JacksonAnnotationIntrospector.java

示例5: processBeanAnnotation

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
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." );
    }
}
 
開發者ID:nmorel,項目名稱:gwt-jackson,代碼行數:36,代碼來源:PropertyProcessor.java

示例6: b

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
@JsonIdentityReference(alwaysAsId = true)
@JsonIdentityInfo(
    resolver = ByidInstanceResolver.class,
    generator = ObjectIdGenerators.PropertyGenerator.class,
    property = "id")
Byid b();
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:ByIdProperty.java

示例7: processIdentity

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
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() );
}
 
開發者ID:nmorel,項目名稱:gwt-jackson,代碼行數:6,代碼來源:BeanProcessor.java

示例8: IdParameterWrapper

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
public IdParameterWrapper( @JsonProperty( "node" ) @JsonIdentityInfo( generator = ObjectIdGenerators.IntSequenceGenerator.class,
        property = "@id" ) ValueParameterNode node ) {
    this.test = node;
}
 
開發者ID:nmorel,項目名稱:gwt-jackson,代碼行數:5,代碼來源:ObjectIdDeserializationTester.java

示例9: IdParameterWrapperExt

import com.fasterxml.jackson.annotation.JsonIdentityInfo; //導入依賴的package包/類
public IdParameterWrapperExt( @JsonProperty( "node" ) @JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class,
        property = "customId" ) ValueParameterNodeExt node ) {
    this.test = node;
}
 
開發者ID:nmorel,項目名稱:gwt-jackson,代碼行數:5,代碼來源:ObjectIdDeserializationTester.java


注:本文中的com.fasterxml.jackson.annotation.JsonIdentityInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。