本文整理了Java中org.bson.BSON.hasDecodeHooks()
方法的一些代码示例,展示了BSON.hasDecodeHooks()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BSON.hasDecodeHooks()
方法的具体详情如下:
包路径:org.bson.BSON
类名称:BSON
方法名:hasDecodeHooks
[英]Gets whether any decoding transformers have been registered for any classes.
[中]
代码示例来源:origin: org.mongodb/mongo-java-driver
@Override
public Object objectDone() {
BSONObject o = stack.removeLast();
if (nameStack.size() > 0) {
nameStack.removeLast();
} else if (stack.size() > 0) {
throw new IllegalStateException("Illegal object end in current context.");
}
return !BSON.hasDecodeHooks() ? o : (BSONObject) BSON.applyDecodingHooks(o);
}
代码示例来源:origin: org.mongodb/mongo-java-driver
/**
* Puts a new value into the document.
*
* @param name the name of the field
* @param value the value
*/
protected void _put(final String name, final Object value) {
cur().put(name, !BSON.hasDecodeHooks() ? value : BSON.applyDecodingHooks(value));
}
代码示例来源:origin: org.mongodb/mongo-java-driver
/**
* Transforms the {@code objectToDecode} using all transformers registered for the class of this object.
*
* @param objectToDecode the BSON object to decode
* @return the transformed object
*/
public static Object applyDecodingHooks(final Object objectToDecode) {
Object transformedObject = objectToDecode;
if (!hasDecodeHooks() || objectToDecode == null || decodingHooks.size() == 0) {
return transformedObject;
}
List<Transformer> transformersForObject = decodingHooks.get(objectToDecode.getClass());
if (transformersForObject != null) {
for (final Transformer transformer : transformersForObject) {
transformedObject = transformer.transform(objectToDecode);
}
}
return transformedObject;
}
代码示例来源:origin: spring-projects/spring-data-mongodb
private Object exceptionSwallowingStackReducingObjectDone/*CauseWeJustNeedTheStructureNotTheActualValue*/() {
Object value;
try {
return super.objectDone();
} catch (PatternSyntaxException e) {
value = EMPTY_MARKER;
}
if (!isStackEmpty()) {
_put(curName(), value);
} else {
value = !BSON.hasDecodeHooks() ? value : BSON.applyDecodingHooks(value);
setRoot(value);
}
return value;
}
}
代码示例来源:origin: org.mongodb/mongo-java-driver
_put(name, o);
} else {
o = !org.bson.BSON.hasDecodeHooks() ? o : org.bson.BSON.applyDecodingHooks(o);
setRoot(o);
代码示例来源:origin: org.springframework.data/spring-data-mongodb
private Object exceptionSwallowingStackReducingObjectDone/*CauseWeJustNeedTheStructureNotTheActualValue*/() {
Object value;
try {
return super.objectDone();
} catch (PatternSyntaxException e) {
value = EMPTY_MARKER;
}
if (!isStackEmpty()) {
_put(curName(), value);
} else {
value = !BSON.hasDecodeHooks() ? value : BSON.applyDecodingHooks(value);
setRoot(value);
}
return value;
}
}
代码示例来源:origin: com.sequoiadb/sequoiadb-driver
public Object objectDone() {
final BSONObject o = _stack.removeLast();
if (_nameStack.size() > 0)
_nameStack.removeLast();
else if (_stack.size() > 0) throw new IllegalStateException("something is wrong");
return !BSON.hasDecodeHooks() ? o : (BSONObject) BSON.applyDecodingHooks(o);
}
代码示例来源:origin: com.sequoiadb/sequoiadb-driver
protected void _put(final String name, final Object o) {
cur().put(name, !BSON.hasDecodeHooks() ? o : BSON.applyDecodingHooks(o));
}
代码示例来源:origin: org.mongodb/mongodb-driver
_put(name, o);
} else {
o = !org.bson.BSON.hasDecodeHooks() ? o : org.bson.BSON.applyDecodingHooks(o);
setRoot(o);
内容来源于网络,如有侵权,请联系作者删除!