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


Java WritableObjectId類代碼示例

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


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

示例1: _serializeWithObjectId

import com.fasterxml.jackson.databind.ser.impl.WritableObjectId; //導入依賴的package包/類
public final void _serializeWithObjectId(Object paramObject, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, boolean paramBoolean)
{
  ObjectIdWriter localObjectIdWriter = this._objectIdWriter;
  WritableObjectId localWritableObjectId = paramSerializerProvider.findObjectId(paramObject, localObjectIdWriter.generator);
  if (localWritableObjectId.writeAsId(paramJsonGenerator, paramSerializerProvider, localObjectIdWriter))
    return;
  Object localObject = localWritableObjectId.generateId(paramObject);
  if (localObjectIdWriter.alwaysAsId)
  {
    localObjectIdWriter.serializer.serialize(localObject, paramJsonGenerator, paramSerializerProvider);
    return;
  }
  if (paramBoolean)
    paramJsonGenerator.writeStartObject();
  localWritableObjectId.writeAsField(paramJsonGenerator, paramSerializerProvider, localObjectIdWriter);
  if (this._propertyFilterId != null)
    serializeFieldsFiltered(paramObject, paramJsonGenerator, paramSerializerProvider);
  else
    serializeFields(paramObject, paramJsonGenerator, paramSerializerProvider);
  if (paramBoolean)
    paramJsonGenerator.writeEndObject();
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:23,代碼來源:BeanSerializerBase.java

示例2: serializeWithObjectId

import com.fasterxml.jackson.databind.ser.impl.WritableObjectId; //導入依賴的package包/類
private final void serializeWithObjectId(Object bean,
        JsonGenerator jgen, SerializerProvider provider)
    throws IOException, JsonGenerationException
{
    final ObjectIdWriter w = _objectIdWriter;
    WritableObjectId oid = provider.findObjectId(bean, w.generator);
    Object id = oid.id;
    
    if (id != null) { // have seen before; serialize just id
        oid.serializer.serialize(id, jgen, provider);
        return;
    }
    // if not, bit more work:
    oid.serializer = w.serializer;
    oid.id = id = oid.generator.generateId(bean);
    // possibly. Or maybe not:
    if (w.alwaysAsId) { 
        oid.serializer.serialize(id, jgen, provider);
        return;
    }
    // If not, need to inject the id:
    jgen.writeStartObject();
    SerializedString name = w.propertyName;
    if (name != null) {
        jgen.writeFieldName(name);
        w.serializer.serialize(id, jgen, provider);
    }
    if (_propertyFilterId != null) {
        serializeFieldsFiltered(bean, jgen, provider);
    } else {
        serializeFields(bean, jgen, provider);
    }
    jgen.writeEndObject();
}
 
開發者ID:joyplus,項目名稱:joyplus-tv,代碼行數:35,代碼來源:BeanSerializer.java

示例3: findObjectId

import com.fasterxml.jackson.databind.ser.impl.WritableObjectId; //導入依賴的package包/類
public WritableObjectId findObjectId(Object paramObject, ObjectIdGenerator<?> paramObjectIdGenerator)
{
  if (this._seenObjectIds == null)
  {
    this._seenObjectIds = new IdentityHashMap();
  }
  else
  {
    WritableObjectId localWritableObjectId1 = (WritableObjectId)this._seenObjectIds.get(paramObject);
    if (localWritableObjectId1 != null)
      return localWritableObjectId1;
  }
  Object localObject;
  if (this._objectIdGenerators == null)
  {
    this._objectIdGenerators = new ArrayList(8);
    localObject = null;
  }
  else
  {
    int i = 0;
    int j = this._objectIdGenerators.size();
    while (true)
    {
      localObject = null;
      if (i >= j)
        break;
      ObjectIdGenerator localObjectIdGenerator = (ObjectIdGenerator)this._objectIdGenerators.get(i);
      if (localObjectIdGenerator.canUseFor(paramObjectIdGenerator))
      {
        localObject = localObjectIdGenerator;
        break;
      }
      i++;
    }
  }
  if (localObject == null)
  {
    localObject = paramObjectIdGenerator.newForSerialization(this);
    this._objectIdGenerators.add(localObject);
  }
  WritableObjectId localWritableObjectId2 = new WritableObjectId((ObjectIdGenerator)localObject);
  this._seenObjectIds.put(paramObject, localWritableObjectId2);
  return localWritableObjectId2;
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:46,代碼來源:DefaultSerializerProvider.java

示例4: _serializeWithObjectId

import com.fasterxml.jackson.databind.ser.impl.WritableObjectId; //導入依賴的package包/類
private final void _serializeWithObjectId(Object bean,
        JsonGenerator jgen, SerializerProvider provider,
        TypeSerializer typeSer)
    throws IOException, JsonGenerationException
{
    final ObjectIdWriter w = _objectIdWriter;
    WritableObjectId oid = provider.findObjectId(bean, w.generator);
    Object id = oid.id;
    
    if (id != null) { // have seen before; serialize just id
        oid.serializer.serialize(id, jgen, provider);
        return;
    }
    // if not, bit more work:
    oid.serializer = w.serializer;
    oid.id = id = oid.generator.generateId(bean);
    
    String typeStr = (_typeId == null) ? null :_customTypeId(bean);
    if (typeStr == null) {
        typeSer.writeTypePrefixForObject(bean, jgen);
    } else {
        typeSer.writeCustomTypePrefixForObject(bean, jgen, typeStr);
    }

    // Very first thing: inject the id property
    SerializedString name = w.propertyName;
    if (name != null) {
        jgen.writeFieldName(name);
        w.serializer.serialize(id, jgen, provider);
    }

    if (_propertyFilterId != null) {
        serializeFieldsFiltered(bean, jgen, provider);
    } else {
        serializeFields(bean, jgen, provider);
    }
    if (typeStr == null) {
        typeSer.writeTypeSuffixForObject(bean, jgen);
    } else {
        typeSer.writeCustomTypeSuffixForObject(bean, jgen, typeStr);
    }
}
 
開發者ID:joyplus,項目名稱:joyplus-tv,代碼行數:43,代碼來源:BeanSerializerBase.java

示例5: findObjectId

import com.fasterxml.jackson.databind.ser.impl.WritableObjectId; //導入依賴的package包/類
public abstract WritableObjectId findObjectId(Object paramObject, ObjectIdGenerator<?> paramObjectIdGenerator); 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:2,代碼來源:SerializerProvider.java


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