org.apache.juneau.json.JsonSerializer.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.juneau.json.JsonSerializer.<init>()方法的一些代码示例,展示了JsonSerializer.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonSerializer.<init>()方法的具体详情如下:
包路径:org.apache.juneau.json.JsonSerializer
类名称:JsonSerializer
方法名:<init>

JsonSerializer.<init>介绍

[英]Constructor.
[中]构造器。

代码示例

代码示例来源:origin: org.apache.juneau/juneau-marshall

/**
 * Constructor.
 *
 * @param ps Initialize with the specified config property store.
 */
public JsonSchemaGenerator(PropertyStore ps) {
  super(ps.builder().set(BEANTRAVERSE_detectRecursions, true).set(BEANTRAVERSE_ignoreRecursions, true).build());
  useBeanDefs = getBooleanProperty(JSONSCHEMA_useBeanDefs, false);
  allowNestedExamples = getBooleanProperty(JSONSCHEMA_allowNestedExamples, false);
  allowNestedDescriptions = getBooleanProperty(JSONSCHEMA_allowNestedDescriptions, false);
  beanDefMapper = getInstanceProperty(JSONSCHEMA_beanDefMapper, BeanDefMapper.class, BasicBeanDefMapper.class);
  addExamplesTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addExamplesTo, null));
  addDescriptionsTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addDescriptionsTo, null));
  defaultSchemas = getMapProperty(JSONSCHEMA_defaultSchemas, ObjectMap.class);
  Set<Pattern> ignoreTypes = new LinkedHashSet<>();
  for (String s : split(ps.getProperty(JSONSCHEMA_ignoreTypes, String.class, "")))
    ignoreTypes.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
  this.ignoreTypes = ignoreTypes;
  jsonSerializer = new JsonSerializer(ps);
}

代码示例来源:origin: apache/juneau

/**
 * Constructor.
 *
 * @param ps Initialize with the specified config property store.
 */
public JsonSchemaGenerator(PropertyStore ps) {
  super(ps.builder().set(BEANTRAVERSE_detectRecursions, true).set(BEANTRAVERSE_ignoreRecursions, true).build());
  useBeanDefs = getBooleanProperty(JSONSCHEMA_useBeanDefs, false);
  allowNestedExamples = getBooleanProperty(JSONSCHEMA_allowNestedExamples, false);
  allowNestedDescriptions = getBooleanProperty(JSONSCHEMA_allowNestedDescriptions, false);
  beanDefMapper = getInstanceProperty(JSONSCHEMA_beanDefMapper, BeanDefMapper.class, BasicBeanDefMapper.class);
  addExamplesTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addExamplesTo, null));
  addDescriptionsTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addDescriptionsTo, null));
  defaultSchemas = getMapProperty(JSONSCHEMA_defaultSchemas, ObjectMap.class);
  Set<Pattern> ignoreTypes = new LinkedHashSet<>();
  for (String s : split(ps.getProperty(JSONSCHEMA_ignoreTypes, String.class, "")))
    ignoreTypes.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
  this.ignoreTypes = ignoreTypes;
  jsonSerializer = new JsonSerializer(ps);
}

代码示例来源:origin: apache/juneau

/**
 * Constructor.
 *
 * @param ps Initialize with the specified config property store.
 */
public JsonSchemaGenerator(PropertyStore ps) {
  super(ps.builder().set(BEANTRAVERSE_detectRecursions, true).set(BEANTRAVERSE_ignoreRecursions, true).build());
  useBeanDefs = getBooleanProperty(JSONSCHEMA_useBeanDefs, false);
  allowNestedExamples = getBooleanProperty(JSONSCHEMA_allowNestedExamples, false);
  allowNestedDescriptions = getBooleanProperty(JSONSCHEMA_allowNestedDescriptions, false);
  beanDefMapper = getInstanceProperty(JSONSCHEMA_beanDefMapper, BeanDefMapper.class, BasicBeanDefMapper.class);
  addExamplesTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addExamplesTo, null));
  addDescriptionsTo = TypeCategory.parse(getStringProperty(JSONSCHEMA_addDescriptionsTo, null));
  defaultSchemas = getMapProperty(JSONSCHEMA_defaultSchemas, ObjectMap.class);
  Set<Pattern> ignoreTypes = new LinkedHashSet<>();
  for (String s : split(ps.getProperty(JSONSCHEMA_ignoreTypes, String.class, "")))
    ignoreTypes.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
  this.ignoreTypes = ignoreTypes;
  jsonSerializer = new JsonSerializer(ps);
}

相关文章