本文整理汇总了Java中org.codehaus.jackson.util.DefaultPrettyPrinter类的典型用法代码示例。如果您正苦于以下问题:Java DefaultPrettyPrinter类的具体用法?Java DefaultPrettyPrinter怎么用?Java DefaultPrettyPrinter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultPrettyPrinter类属于org.codehaus.jackson.util包,在下文中一共展示了DefaultPrettyPrinter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BaseLensCommand
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
/**
* Instantiates a new base lens command.
*/
public BaseLensCommand() {
mapper = new ObjectMapper();
mapper.setSerializationInclusion(Inclusion.NON_NULL);
mapper.setSerializationInclusion(Inclusion.NON_DEFAULT);
pp = new DefaultPrettyPrinter();
pp.indentObjectsWith(new Indenter() {
@Override
public void writeIndentation(JsonGenerator jg, int level) throws IOException {
jg.writeRaw("\n");
for (int i = 0; i < level; i++) {
jg.writeRaw(" ");
}
}
@Override
public boolean isInline() {
return false;
}
});
}
开发者ID:apache,项目名称:lens,代码行数:24,代码来源:BaseLensCommand.java
示例2: JsonTransformer
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
private JsonTransformer(JsonGenerator json, ISSTableScanner currentScanner, boolean rawTime, CFMetaData metadata)
{
this.json = json;
this.metadata = metadata;
this.currentScanner = currentScanner;
this.rawTime = rawTime;
DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter();
prettyPrinter.indentObjectsWith(objectIndenter);
prettyPrinter.indentArraysWith(arrayIndenter);
json.setPrettyPrinter(prettyPrinter);
}
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:13,代码来源:JsonTransformer.java
示例3: init
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
private ByteArrayOutputStream init() throws IOException {
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
m_generator = createJsonGenerator(bytesOut);
DefaultPrettyPrinter p = new DefaultPrettyPrinter();
p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
m_generator.setPrettyPrinter(p);
return bytesOut;
}
开发者ID:telefonicaid,项目名称:fiware-cosmos-ambari,代码行数:11,代码来源:JsonSerializer.java
示例4: createJsonGenerator
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
private JsonGenerator createJsonGenerator(ByteArrayOutputStream baos) throws IOException {
JsonGenerator generator = m_factory.createJsonGenerator(new OutputStreamWriter(baos,
Charset.forName("UTF-8").newEncoder()));
DefaultPrettyPrinter p = new DefaultPrettyPrinter();
p.indentArraysWith(new DefaultPrettyPrinter.Lf2SpacesIndenter());
generator.setPrettyPrinter(p);
return generator;
}
开发者ID:telefonicaid,项目名称:fiware-cosmos-ambari,代码行数:11,代码来源:JsonSerializer.java
示例5: toJson
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public String toJson()
{
try
{
return new ObjectMapper().writer( new DefaultPrettyPrinter() ).writeValueAsString( this );
}
catch ( Exception e )
{
throw new RuntimeException( "Error serializing to JSON string", e );
}
}
开发者ID:ldbc,项目名称:ldbc_snb_driver,代码行数:12,代码来源:ResultsLogValidationSummary.java
示例6: DbValidationResult
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
DbValidationResult( Db db )
{
this.db = db;
this.missingHandlersForOperationTypes = new HashSet<>();
this.unableToExecuteOperations = new ArrayList<>();
this.incorrectResultsForOperations = new ArrayList<>();
this.successfullyExecutedOperationsPerOperationType = new HashMap<>();
this.totalOperationsPerOperationType = new HashMap<>();
this.objectMapper = new ObjectMapper();
this.defaultPrettyPrinter = new DefaultPrettyPrinter();
this.defaultPrettyPrinter.indentArraysWith( new DefaultPrettyPrinter.Lf2SpacesIndenter() );
}
开发者ID:ldbc,项目名称:ldbc_snb_driver,代码行数:13,代码来源:DbValidationResult.java
示例7: toJson
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public String toJson()
{
try
{
return new ObjectMapper().writer( new DefaultPrettyPrinter() ).writeValueAsString( this );
}
catch ( Exception e )
{
System.out.println( ConcurrentErrorReporter.stackTraceToString( e ) );
throw new RuntimeException( "Unable to generate parameter values string", e );
}
}
开发者ID:ldbc,项目名称:ldbc_snb_driver,代码行数:13,代码来源:WorkloadResultsSnapshot.java
示例8: JSONArrayMeasurementsExporter
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public JSONArrayMeasurementsExporter(OutputStream os) throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
g = factory.createJsonGenerator(bw);
g.setPrettyPrinter(new DefaultPrettyPrinter());
g.writeStartArray();
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:JSONArrayMeasurementsExporter.java
示例9: JSONMeasurementsExporter
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public JSONMeasurementsExporter(OutputStream os) throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
g = factory.createJsonGenerator(bw);
g.setPrettyPrinter(new DefaultPrettyPrinter());
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:7,代码来源:JSONMeasurementsExporter.java
示例10: _defaultPrettyPrinter
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
protected PrettyPrinter _defaultPrettyPrinter()
{
return new DefaultPrettyPrinter();
}
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:5,代码来源:ObjectMapper.java
示例11: withDefaultPrettyPrinter
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public ObjectWriter withDefaultPrettyPrinter()
{
return withPrettyPrinter(new DefaultPrettyPrinter());
}
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:5,代码来源:ObjectWriter.java
示例12: useDefaultPrettyPrinter
import org.codehaus.jackson.util.DefaultPrettyPrinter; //导入依赖的package包/类
public JsonGenerator useDefaultPrettyPrinter()
{
return setPrettyPrinter(new DefaultPrettyPrinter());
}
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:5,代码来源:JsonGeneratorBase.java
注:本文中的org.codehaus.jackson.util.DefaultPrettyPrinter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论