当前位置: 首页>>代码示例>>Java>>正文


Java ModelImpl.getProperties方法代码示例

本文整理汇总了Java中io.swagger.models.ModelImpl.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java ModelImpl.getProperties方法的具体用法?Java ModelImpl.getProperties怎么用?Java ModelImpl.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.swagger.models.ModelImpl的用法示例。


在下文中一共展示了ModelImpl.getProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFields

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
/**
 * Returns list of {@link com.google.protobuf.Field.Builder} created using the properties of a
 * {@link ModelImpl} object.
 */
private ImmutableList.Builder<Field> createFields(
    Service.Builder serviceBuilder, ModelImpl modelImpl) {
  ImmutableList.Builder<Field> fieldsBuilder = ImmutableList.builder();
  int count = 1;
  if (modelImpl.getProperties() != null) {
    for (String propertyName : modelImpl.getProperties().keySet()) {
      Property prop = modelImpl.getProperties().get(propertyName);
      TypeInfo typeInfo =
          ensureNamed(
              serviceBuilder,
              getTypeInfo(serviceBuilder, prop),
              NameConverter.propertyNameToMessageName(propertyName));
      fieldsBuilder.add(createField(propertyName, count++, typeInfo).build());
    }
  }
  return fieldsBuilder;
}
 
开发者ID:googleapis,项目名称:api-compiler,代码行数:22,代码来源:TypeBuilder.java

示例2: doConvert

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
@Override
public JavaType doConvert(ClassLoader classLoader, String packageName, Swagger swagger, Object model) {
  ModelImpl modelImpl = (ModelImpl) model;

  JavaType javaType = ConverterMgr.findJavaType(modelImpl.getType(), modelImpl.getFormat());
  if (javaType != null) {
    return javaType;
  }

  if (modelImpl.getReference() != null) {
    return ConverterMgr.findByRef(classLoader, packageName, swagger, modelImpl.getReference());
  }

  if (modelImpl.getAdditionalProperties() != null) {
    return MapPropertyConverter.findJavaType(classLoader,
        packageName,
        swagger,
        modelImpl.getAdditionalProperties());
  }

  if (ObjectProperty.TYPE.equals(modelImpl.getType())
      && modelImpl.getProperties() == null
      && modelImpl.getName() == null) {
    return TypeFactory.defaultInstance().constructType(Object.class);
  }

  // 根据name、property动态生成class
  if (packageName == null) {
    throw new Error("packageName should not be null");
  }
  String clsName = packageName + "." + modelImpl.getName();
  Class<?> cls =
      ClassUtils.getOrCreateClass(classLoader, packageName, swagger, modelImpl.getProperties(), clsName);
  return TypeFactory.defaultInstance().constructType(cls);
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:36,代码来源:ModelImplConverter.java

示例3: isPrimitiveTypeWrapper

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
/**
 * Returns true if the modelImpl is a wrapper of primitive type like string, Float etc; false
 * otherwise
 */
private boolean isPrimitiveTypeWrapper(ModelImpl modelImpl) {
  return (modelImpl.getProperties() == null && modelImpl.getAdditionalProperties() == null)
      && !Strings.isNullOrEmpty(modelImpl.getType())
      && !"object".equalsIgnoreCase(modelImpl.getType())
      && WellKnownTypeUtils.isPrimitiveType(modelImpl.getType());
}
 
开发者ID:googleapis,项目名称:api-compiler,代码行数:11,代码来源:TypeBuilder.java

示例4: hasProperties

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
/** Returns true if the modelImpl has properties. */
private boolean hasProperties(ModelImpl modelImpl) {
  return modelImpl.getProperties() != null;
}
 
开发者ID:googleapis,项目名称:api-compiler,代码行数:5,代码来源:TypeBuilder.java


注:本文中的io.swagger.models.ModelImpl.getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。