本文整理汇总了Java中com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey类的典型用法代码示例。如果您正苦于以下问题:Java IdKey类的具体用法?Java IdKey怎么用?Java IdKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdKey类属于com.fasterxml.jackson.annotation.ObjectIdGenerator包,在下文中一共展示了IdKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findObjectId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public ReadableObjectId findObjectId(Object paramObject, ObjectIdGenerator<?> paramObjectIdGenerator)
{
ObjectIdGenerator.IdKey localIdKey = paramObjectIdGenerator.key(paramObject);
if (this._objectIds == null)
{
this._objectIds = new LinkedHashMap();
}
else
{
ReadableObjectId localReadableObjectId1 = (ReadableObjectId)this._objectIds.get(localIdKey);
if (localReadableObjectId1 != null)
return localReadableObjectId1;
}
ReadableObjectId localReadableObjectId2 = new ReadableObjectId(paramObject);
this._objectIds.put(localIdKey, localReadableObjectId2);
return localReadableObjectId2;
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:18,代码来源:DefaultDeserializationContext.java
示例2: resolveId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
*
*/
@Override
public E resolveId(IdKey idKey) {
try {
if (idKey.key instanceof Integer) {
final Integer id = (Integer) idKey.key;
// we only "load" the entity to follow a lazy approach, i.e.
// requests to the database will only be queried if any properties
// of the entity will (later) be accessed (which may already
// the case when jackson is doing some magic)
return service.loadById(id);
} else {
throw new Exception("ID is not of type Integer.");
}
} catch (Exception e) {
LOG.error("Could not resolve object by ID: " + e.getMessage());
return null;
}
}
开发者ID:terrestris,项目名称:shogun2,代码行数:23,代码来源:PersistentObjectIdResolver.java
示例3: bindItem
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
@Override
public void bindItem(IdKey id, Object ob)
{
if (_items == null) {
_items = new HashMap<ObjectIdGenerator.IdKey,Object>();
} else if (_items.containsKey(id)) {
throw new IllegalStateException("Already had POJO for id (" + id.key.getClass().getName() + ") [" + id
+ "]");
}
_items.put(id, ob);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:SimpleObjectIdResolver.java
示例4: bindItem
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
@Override
public void bindItem(IdKey id, Object ob)
{
if (_items == null) {
_items = new HashMap<IdKey,Object>();
} else if (_items.containsKey(id)) {
throw new IllegalStateException("Already had POJO for id (" + id.key.getClass().getName() + ") [" + id
+ "]");
}
_items.put(id, ob);
}
开发者ID:vegegoku,项目名称:gwt-jackson-apt,代码行数:12,代码来源:SimpleObjectIdResolver.java
示例5: addObjectId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* <p>addObjectId</p>
*
* @param id a {@link com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey} object.
* @param instance a {@link Object} object.
*/
@Override
public void addObjectId(IdKey id, Object instance) {
if (null == idToObject) {
idToObject = new HashMap<IdKey, Object>();
}
idToObject.put(id, instance);
}
开发者ID:vegegoku,项目名称:gwt-jackson-apt,代码行数:14,代码来源:DefaultJsonDeserializationContext.java
示例6: getObjectWithId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* <p>getObjectWithId</p>
*
* @param id a {@link com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey} object.
* @return a {@link Object} object.
*/
@Override
public Object getObjectWithId(IdKey id) {
if (null != idToObject) {
return idToObject.get(id);
}
return null;
}
开发者ID:vegegoku,项目名称:gwt-jackson-apt,代码行数:14,代码来源:DefaultJsonDeserializationContext.java
示例7: getItemMap
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public Map<IdKey, Object> getItemMap() {
if(_items == null) {
return Collections.emptyMap();
} else {
return _items;
}
}
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:8,代码来源:TokensIdResolver.java
示例8: registerTokens
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public static void registerTokens(ObjectMapper mapper, List<String> tokens) {
TokenList list = new TokenList();
list.setTokens(tokens);
TokensIdGenerator generator = MapperFactory.getTokenIdGenerator(mapper);
TokensIdResolver resolver = MapperFactory.getTokenIdResolver(mapper);
Integer keyAsId = generator.generateId(list);
IdKey id = generator.key(keyAsId);
resolver.bindItem(id, list);
}
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:11,代码来源:TokenListTestUtil.java
示例9: addObjectId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* <p>addObjectId</p>
*
* @param id a {@link com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey} object.
* @param instance a {@link java.lang.Object} object.
*/
public void addObjectId( IdKey id, Object instance ) {
if ( null == idToObject ) {
idToObject = new HashMap<IdKey, Object>();
}
idToObject.put( id, instance );
}
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:13,代码来源:JsonDeserializationContext.java
示例10: resolveId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
@Override
public Object resolveId(IdKey id) {
return ImmutableByid.builder()
.id(id.key.toString())
.build();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:ByIdProperty.java
示例11: resolveId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
@Override
public Object resolveId(IdKey id) {
return (_items == null) ? null : _items.get(id);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:SimpleObjectIdResolver.java
示例12: newIdKey
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public IdKey newIdKey(Object id) {
return new IdKey(type, scope, id);
}
开发者ID:vegegoku,项目名称:gwt-jackson-apt,代码行数:8,代码来源:PropertyIdentityDeserializationInfo.java
示例13: isRegistered
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public boolean isRegistered(IdKey id) {
return getItemMap().containsKey(id);
}
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:4,代码来源:TokensIdResolver.java
示例14: getItems
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public Set<Entry<IdKey, Object>> getItems() {
return getItemMap().entrySet();
}
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:4,代码来源:TokensIdResolver.java
示例15: key
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
public ObjectIdGenerator.IdKey key(Object paramObject)
{
return new ObjectIdGenerator.IdKey(getClass(), this._scope, paramObject);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:PropertyBasedObjectIdGenerator.java
示例16: bindItem
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
*
*/
@Override
public void bindItem(IdKey id, Object ob) {
super.bindItem(id, ob);
}
开发者ID:terrestris,项目名称:shogun2,代码行数:8,代码来源:PersistentObjectIdResolver.java
示例17: newIdKey
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public IdKey newIdKey( Object id ) {
return new IdKey( type, scope, id );
}
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:6,代码来源:PropertyIdentityDeserializationInfo.java
示例18: getObjectWithId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* <p>getObjectWithId</p>
*
* @param id a {@link com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey} object.
*
* @return a {@link java.lang.Object} object.
*/
public Object getObjectWithId( IdKey id ) {
if ( null != idToObject ) {
return idToObject.get( id );
}
return null;
}
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:14,代码来源:JsonDeserializationContext.java
示例19: bindItem
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* Method called when a POJO is deserialized and has an Object Identifier.
* Method exists so that implementation can keep track of existing object in
* JSON stream that could be useful for further resolution.
*
* @param id The Object Identifer
* @param pojo The POJO associated to that Identifier
*/
void bindItem(IdKey id, Object pojo);
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ObjectIdResolver.java
示例20: resolveId
import com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey; //导入依赖的package包/类
/**
* Method called when deserialization encounters the given Object Identifier
* and requires the POJO associated with it.
*
* @param id The Object Identifier
* @return The POJO, or null if unable to resolve.
*/
Object resolveId(IdKey id);
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ObjectIdResolver.java
注:本文中的com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论