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


Java ModelImpl.setName方法代码示例

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


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

示例1: toRefModel

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private RefModel toRefModel(String modelType) {
  if (RefProperty.class.isInstance(property)) {
    return (RefModel) PropertyBuilder.toModel(property);
  }

  ModelImpl modelImpl = new ModelImpl();
  modelImpl.setType("object");
  modelImpl.setName(name);
  modelImpl.addProperty(name, property);

  operationGenerator.getSwagger().addDefinition(modelType, modelImpl);

  RefModel refModel = new RefModel();
  refModel.setReference("#/definitions/" + modelType);

  return refModel;
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:18,代码来源:PendingBodyParameter.java

示例2: getModel

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
public ModelImpl getModel(ServiceDocument template) {
    String kind = getStrippedKind(template.documentKind);
    ModelImpl model = (ModelImpl) this.byKind.get(kind);

    if (model == null) {
        model = load(template.documentDescription.propertyDescriptions.entrySet());
        model.setName(getStrippedKind(template.documentKind));
        this.byKind.put(kind, model);
    }

    return model;
}
 
开发者ID:vmware,项目名称:xenon-utils,代码行数:13,代码来源:ModelRegistry.java

示例3: refProperty

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private RefProperty refProperty(PropertyDescription pd) {
    String kind = getStrippedKind(pd.kind);
    ModelImpl model = (ModelImpl) this.byKind.get(kind);
    if (model == null) {
        model = load(pd.fieldDescriptions.entrySet());
        model.setName(kind);
        this.byKind.put(kind, model);
    }

    return new RefProperty(kind);
}
 
开发者ID:vmware,项目名称:xenon-utils,代码行数:12,代码来源:ModelRegistry.java

示例4: testCreateObjectRefProperty

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
@Test
public void testCreateObjectRefProperty() {
  ModelImpl innerModel = new ModelImpl();
  innerModel.setName("Test");

  Property property = SwaggerRefPropertyFactory.create(SwaggerRefPropertyFactory.PropertyContainerType.NONE, innerModel);
  assertTrue(property instanceof RefProperty);
  RefProperty refProperty = (RefProperty) property;
  assertEquals(innerModel.getName(), refProperty.getSimpleRef());
}
 
开发者ID:mnemonic-no,项目名称:common-services,代码行数:11,代码来源:SwaggerRefPropertyFactoryTest.java

示例5: testCreateArrayRefProperty

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
@Test
public void testCreateArrayRefProperty() {
  ModelImpl innerModel = new ModelImpl();
  innerModel.setName("Test");

  Property property = SwaggerRefPropertyFactory.create(SwaggerRefPropertyFactory.PropertyContainerType.LIST, innerModel);
  assertTrue(property instanceof ArrayProperty);
  ArrayProperty arrayProperty = (ArrayProperty) property;
  RefProperty refProperty = (RefProperty) arrayProperty.getItems();
  assertEquals(innerModel.getName(), refProperty.getSimpleRef());
}
 
开发者ID:mnemonic-no,项目名称:common-services,代码行数:12,代码来源:SwaggerRefPropertyFactoryTest.java

示例6: processListsFromProperties

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private Map<String, Model> processListsFromProperties(Collection<Property> properties, Model baseModel, Swagger swagger) {

        Map<String, Model> result = new LinkedHashMap<>();

        for (Property p : properties) {
            if (p != null && "array".equals(p.getType())) {

                ArrayProperty arrayProperty = (ArrayProperty) p;
                if ( arrayProperty.getItems() instanceof RefProperty) {
                    RefProperty ref = (RefProperty) arrayProperty.getItems();

                    String baseName = ref.getSimpleRef();

                    // Do not generate List wrappers for primitives (or strings)
                    if (!languageSpecificPrimitives.contains(baseName) && topLevelResources.contains(baseName)) {

                        String modelName = baseName + "List";

                        ModelImpl model = new ModelImpl();
                        model.setName(modelName);
                        model.setAllowEmptyValue(false);
                        model.setDescription("Collection List for " + baseName);

                        if (baseModel == null) {
                            baseModel = swagger.getDefinitions().get(baseName);
                        }

                        // only add the tags from the base model
                        if (baseModel.getVendorExtensions().containsKey("x-okta-tags")) {
                            model.setVendorExtension("x-okta-tags", baseModel.getVendorExtensions().get("x-okta-tags"));
                        }

                        model.setVendorExtension("x-isResourceList", true);
                        model.setVendorExtension("x-baseType", baseName);
                        model.setType(modelName);

                        result.put(modelName, model);
                    }
                }
            }
        }

        return result;
    }
 
开发者ID:okta,项目名称:okta-sdk-java,代码行数:45,代码来源:AbstractOktaJavaClientCodegen.java


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