本文整理汇总了Java中com.fasterxml.jackson.core.JsonStreamContext.inObject方法的典型用法代码示例。如果您正苦于以下问题:Java JsonStreamContext.inObject方法的具体用法?Java JsonStreamContext.inObject怎么用?Java JsonStreamContext.inObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.core.JsonStreamContext
的用法示例。
在下文中一共展示了JsonStreamContext.inObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import com.fasterxml.jackson.core.JsonStreamContext; //导入方法依赖的package包/类
private void close() throws IOException {
if ( !shallowObjects.isEmpty() ) {
for (String o : shallowObjects) {
jg.writeFieldName(o);
jg.writeBoolean(true);
}
}
while (jg.getOutputContext().getParent() != null) {
JsonStreamContext oc = jg.getOutputContext();
if (oc.inObject()) {
jg.writeEndObject();
} else if (oc.inArray()) {
jg.writeEndArray();
}
}
jg.flush();
if( options.callback()!=null ) {
output.write(")".getBytes(StandardCharsets.UTF_8));
}
jg.close();
}
示例2: matchesSafely
import com.fasterxml.jackson.core.JsonStreamContext; //导入方法依赖的package包/类
@Override
protected boolean matchesSafely(JsonStreamContext context, Description mismatch) {
if (context.inArray()) {
mismatch.appendText("was of type ARRAY");
return false;
}
if (context.inRoot()) {
mismatch.appendText("was of type ROOT");
return false;
}
if (!context.inObject()) {
mismatch.appendText("was not of type OBJECT");
return false;
}
return true;
}
示例3: matchesSafely
import com.fasterxml.jackson.core.JsonStreamContext; //导入方法依赖的package包/类
@Override
protected boolean matchesSafely(JsonStreamContext context, Description mismatch) {
if (context.inRoot()) {
mismatch.appendText("was of type ROOT");
return false;
}
if (context.inObject()) {
mismatch.appendText("was of type OBJECT");
return false;
}
if (!context.inArray()) {
mismatch.appendText("was not of type ARRAY");
return false;
}
return true;
}
示例4: matchesSafely
import com.fasterxml.jackson.core.JsonStreamContext; //导入方法依赖的package包/类
@Override
protected boolean matchesSafely(JsonStreamContext context, Description mismatch) {
if (context.inObject()) {
mismatch.appendText("was of type OBJECT");
return false;
}
if (context.inArray()) {
mismatch.appendText("was of type ARRAY");
return false;
}
if (!context.inRoot()) {
mismatch.appendText("was not of type ROOT");
return false;
}
return true;
}
示例5: writeFieldsEnd
import com.fasterxml.jackson.core.JsonStreamContext; //导入方法依赖的package包/类
@Override
public void writeFieldsEnd(FSTClazzInfo serializationInfo) {
try {
JsonStreamContext outputContext = gen.getOutputContext();
if ( outputContext.inObject() ) {
gen.writeEndObject();
} else {
gen.writeEndArray();
}
if ( outputContext.inObject() )
gen.writeEndObject();
} catch (IOException e) {
FSTUtil.<RuntimeException>rethrow(e);
try {
gen.flush();
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println( new String(out.buf,0,out.pos) );
}
}