gpt4 book ai didi

com.reprezen.rapidml.ZenModel.getResourceAPIs()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 02:04:49 28 4
gpt4 key购买 nike

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

ZenModel.getResourceAPIs介绍

[英]Returns the value of the 'Resource AP Is' containment reference list. The list contents are of type com.reprezen.rapidml.ResourceAPI.

If the meaning of the 'Resource AP Is' containment reference list isn't clear, there really should be more of a description here...
[中]返回“资源AP Is”包含引用列表的值。列表内容为com类型。雷普雷岑。rapidml。ResourceAPI。
如果“Resource AP Is”包含参考列表的含义不清楚,那么这里真的应该有更多的描述。。。

代码示例

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml.model

public void generateAutoRealizations(ZenModel model) {
  for (ResourceAPI resourceAPI : model.getResourceAPIs()) {
    new RealizationProcessor(resourceAPI).generateAutoRealizations();
  }
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml

protected Collection<Enumeration> _getUsedEnums(final ZenModel model) {
 final Function1<ResourceAPI, Collection<Enumeration>> _function = (ResourceAPI it) -> {
  return this.getUsedEnums(it);
 };
 return IterableExtensions.<Enumeration>toSet(Iterables.<Enumeration>concat(ListExtensions.<ResourceAPI, Collection<Enumeration>>map(model.getResourceAPIs(), _function)));
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml

@Check
public void checkRESTfulInterfaceNameUniqueness(ZenModel model) {
  Set<String> names = Sets.newHashSet();
  for (ResourceAPI resourceAPI : model.getResourceAPIs()) {
    if (names.contains(resourceAPI.getName())) {
      error(String.format("Duplicate name of resource API '%s'", resourceAPI.getName()), resourceAPI,
          RapidmlPackage.Literals.RESOURCE_API__NAME);
    }
    names.add(resourceAPI.getName());
  }
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml

protected Collection<UserDefinedType> _getUsedUserDefinedTypes(final ZenModel model) {
 final Function1<ResourceAPI, Collection<UserDefinedType>> _function = (ResourceAPI it) -> {
  return this.getUsedUserDefinedTypes(it);
 };
 return IterableExtensions.<UserDefinedType>toSet(Iterables.<UserDefinedType>concat(ListExtensions.<ResourceAPI, Collection<UserDefinedType>>map(model.getResourceAPIs(), _function)));
}

代码示例来源:origin: com.reprezen.genflow/rapidml-swagger

public boolean addDefaultResourceAPI(final ZenModel model) {
 boolean _xblockexpression = false;
 {
  final ResourceAPI resourceAPI = RapidmlFactory.eINSTANCE.createResourceAPI();
  resourceAPI.setBaseURI("http://localhost");
  resourceAPI.setName(model.getName());
  _xblockexpression = model.getResourceAPIs().add(resourceAPI);
 }
 return _xblockexpression;
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml.model

/**
 * @param importDeclaration
 *            import declaration
 * @return list of namespaces that available from imported model
 */
public static List<String> getImportedNamespaces(ImportDeclaration importDeclaration) {
  ZenModel zenModel = importDeclaration.getImportedModel();
  List<String> result = new ArrayList<>();
  if (zenModel != null) {
    String namespace = ((zenModel.getNamespace() != null) ? zenModel.getNamespace() + "." : "")//
        + zenModel.getName();
 
    result.addAll(zenModel.getResourceAPIs().stream()//
        .map(rapi -> namespace + "." + rapi.getName()).collect(Collectors.toList()));
    result.addAll(zenModel.getDataModels().stream()//
        .map(dm -> namespace + "." + dm.getName()).collect(Collectors.toList()));
    Optional.ofNullable(zenModel.getSecuritySchemesLibrary())//
        .filter(it -> !it.getSecuritySchemes().isEmpty())//
        .ifPresent(it -> result.add(namespace + "." + it.getName()));
  }
  return Collections.unmodifiableList(result);
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml

public void checkAutoRealizationNameCollisions(ZenModel model) {
  for (ResourceAPI resourceAPI : model.getResourceAPIs()) {
    RealizationProcessor processor = new RealizationProcessor(resourceAPI);
    try {
      processor.generateAutoRealizations();
    } catch (RealizationModelParseException e) {
      // ignore
      return;
    }
    IRealizationProcessor realizationProcessor = processor.getRealizationProcessor();
    if (realizationProcessor instanceof AutoRealizationProcessor) {
      ((AutoRealizationProcessor) realizationProcessor) //
          .getRegistry() //
          .getNameCollisions() //
          .ifPresent(collisions -> {
            String message = collisions.keySet() //
                .stream() //
                .map(key -> key + " for realizations " + collisions.get(key)) //
                .collect(Collectors.joining(" and "));
            error("Name collisions detected, " + message, model,
                RapidmlPackage.Literals.ZEN_MODEL__RESOURCE_AP_IS);
          });
    }
  }
}

代码示例来源:origin: com.reprezen.genflow/rapidml-doc

public CharSequence generateInterfaces(final ZenModel zenModel) {
 StringConcatenation _builder = new StringConcatenation();
 {
  EList<ResourceAPI> _resourceAPIs = zenModel.getResourceAPIs();
  for(final ResourceAPI iface : _resourceAPIs) {
   CharSequence _generateInterface = this.generateInterface(iface, zenModel);
   _builder.append(_generateInterface);
   _builder.newLineIfNotEmpty();
  }
 }
 return _builder;
}

代码示例来源:origin: com.reprezen.genflow/rapidml-wadl

public TraceHelper(final IGenTemplateContext context, final ZenModel model) {
 try {
  this.context = context;
  ZenModelLocator _zenModelLocator = new ZenModelLocator(model);
  this.locator = _zenModelLocator;
  this.xsdTrace = context.getPrerequisiteTrace("xsdGenerator");
  List<GenTemplateTraceItem> _traceItemsOfType = GenTemplateTraceUtils.getTraceItemsOfType(this.xsdTrace, "namesInSchema");
  for (final GenTemplateTraceItem item : _traceItemsOfType) {
   this.namesItems.put(item.getLocator(), item);
  }
  EList<ResourceAPI> _resourceAPIs = model.getResourceAPIs();
  for (final ResourceAPI api : _resourceAPIs) {
   this.apiItems.put(api, GenTemplateTraceUtils.getTraceItem(this.xsdTrace, "resourceAPI", "sourceData", this.locator.<ResourceAPI>locate(api)));
  }
 } catch (Throwable _e) {
  throw Exceptions.sneakyThrow(_e);
 }
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml.model

/**
 * @param model
 *            model
 * @return list of resource definitions that imported using import RESTfulInterfaces
 */
static List<ResourceDefinition> getImportedResources(ZenModel model) {
  ArrayList<ResourceDefinition> result = new ArrayList<>();
  for (ImportDeclaration importDecl : model.getImports()) {
    String uri = importDecl.getImportURI();
    if (!Strings.isNullOrEmpty(uri)) {
      Resource modelResource = importDecl.eResource();
      Resource resource = getResource(modelResource, uri);
      if (resource != null && resource.getErrors().isEmpty() && !resource.getContents().isEmpty()) {
        ZenModel zenModel = (ZenModel) resource.getContents().get(0);
        String namespace = Strings.isNullOrEmpty(zenModel.getNamespace()) ? zenModel.getName() : zenModel
            .getNamespace() + "." + zenModel.getName(); //$NON-NLS-1$
        for (ResourceAPI resourceAPI : zenModel.getResourceAPIs()) {
          String ifaceFQN = namespace + "." + resourceAPI.getName(); //$NON-NLS-1$
          if (ifaceFQN.equals(importDecl.getImportedNamespace())) {
            result.addAll(resourceAPI.getOwnedResourceDefinitions());
          }
        }
      }
    }
  }
  return result;
}

代码示例来源:origin: com.reprezen.genflow/rapidml-csharp

public void generate() {
 EList<ResourceAPI> _resourceAPIs = this.model.getResourceAPIs();
 for (final ResourceAPI api : _resourceAPIs) {
  EList<ResourceDefinition> _ownedResourceDefinitions = api.getOwnedResourceDefinitions();
  for (final ResourceDefinition resource : _ownedResourceDefinitions) {
   {
    this.generateInterface(resource);
    boolean _isGenerateDelegateController = this.config.isGenerateDelegateController();
    if (_isGenerateDelegateController) {
     this.generateDelegateController(resource);
     this.generateAbstractDelegateHandler(resource);
    }
   }
  }
 }
}

代码示例来源:origin: com.reprezen.genflow/rapidml-wadl

private CharSequence generateInclude(final ZenModel zenModel) {
 StringConcatenation _builder = new StringConcatenation();
 {
  EList<ResourceAPI> _resourceAPIs = zenModel.getResourceAPIs();
  for(final ResourceAPI resourceAPI : _resourceAPIs) {
   _builder.append("<include href=\"");
   String _xsdFilePath = this.traceHelper.getXsdFilePath(resourceAPI);
   _builder.append(_xsdFilePath);
   _builder.append("\"/>");
   _builder.newLineIfNotEmpty();
  }
 }
 return _builder;
}

代码示例来源:origin: com.reprezen.genflow/rapidml-nodejs

@Override
public void generate(ZenModel model) throws GenerationException {
  String metadataFile = String.format("%s_metadata.yaml", model.getName());
  generateFile(metadataFile, new MetadataGenerator(model));
  if (context.getGenTargetParameters().get("genMetadataSkeleton") == Boolean.TRUE) {
    String skeletonFile = String.format("%s_metadata-skel.yaml", model.getName());
    Object structSkel = context.getGenTargetParameters().get("structMetadataSkeleton");
    Object primSkel = context.getGenTargetParameters().get("primFieldMetadataSkeleton");
    Object refSkel = context.getGenTargetParameters().get("refFieldMetadataSkeleton");
    if (!(context.getGenTargetParameters().get("omitFieldsWithoutSkeletons") == Boolean.TRUE)) {
      primSkel = primSkel == null ? emptyObject : primSkel;
      refSkel = primSkel == null ? emptyObject : refSkel;
    }
    generateFile(skeletonFile, new MetadataSkeletonGenerator(model, structSkel, primSkel, refSkel));
  }
  for (ResourceAPI api : model.getResourceAPIs()) {
    for (ResourceDefinition resource : api.getOwnedResourceDefinitions()) {
      if (resource instanceof ServiceDataResource) {
        String resourcePath = String.format("handlers/%s/%s/%s.js", model.getName(), api.getName(),
            resource.getName());
        generateFile(resourcePath, new ResourceStubGenerator((ServiceDataResource) resource));
        String customPath = String.format("custom/%s/%s/%sImpl.js", model.getName(), api.getName(),
            resource.getName());
        generateFile(customPath, new CustomCodeGenerator((ServiceDataResource) resource), false);
      }
    }
  }
  generateFile("app.js", new AppGenerator(metadataFile, context));
}

代码示例来源:origin: com.reprezen.genflow/rapidml-swagger

boolean _isEmpty_1 = model.getResourceAPIs().isEmpty();
if (_isEmpty_1) {
 this.addDefaultResourceAPI(model);
final ResourceAPI resourceAPI = model.getResourceAPIs().get(0);
String _elvis = null;
String _baseURI = resourceAPI.getBaseURI();
 swagger.path(pathUri, this.createSwaggerPath(it));
};
Iterables.<ResourceDefinition>concat(ListExtensions.<ResourceAPI, EList<ResourceDefinition>>map(model.getResourceAPIs(), _function_3)).forEach(_function_4);
Map<String, Path> _paths = swagger.getPaths();
boolean _tripleEquals = (_paths == null);

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml.model

public void normalize(ZenModel model) {
  if (TagUtils.getTagWithName(model, TagUtils.NORMALIZED).isPresent()) {
    return;
  }
  new InheritedPropertiesProcessor().addInheritedProperties(model);
  for (ResourceAPI resourceAPI : model.getResourceAPIs()) {
    for (ResourceDefinition resource : resourceAPI.getOwnedResourceDefinitions()) {
      new SecuredByProcessor().process(resource);
      for (Method method : resource.getMethods()) {
        processMethod(method);
      }
    }
  }
  DocumentationSpaceProcessor documentationSpaceProcessor = new DocumentationSpaceProcessor();
  for (Documentation doc : EcoreUtil2.getAllContentsOfType(model, Documentation.class)) {
    documentationSpaceProcessor.process(doc);
  }
  try {
    generateAutoRealizations(model);
  } catch (Exception e) {
    e.printStackTrace();
  }
  TagUtils.addTag(model, TagUtils.NORMALIZED);
}

代码示例来源:origin: com.reprezen.genflow/rapidml-wadl

private CharSequence generateXsdNamespaceDeclarations(final ZenModel zenModel) {
 StringConcatenation _builder = new StringConcatenation();
 {
  EList<DataModel> _dataModels = zenModel.getDataModels();
  for(final DataModel interfaceDataModel : _dataModels) {
   Object _generateNamespaceDeclaration = this.generateNamespaceDeclaration(interfaceDataModel);
   _builder.append(_generateNamespaceDeclaration);
   _builder.newLineIfNotEmpty();
  }
 }
 {
  EList<ResourceAPI> _resourceAPIs = zenModel.getResourceAPIs();
  for(final ResourceAPI resourceAPI : _resourceAPIs) {
   CharSequence _generateNamespaceDeclaration_1 = this.generateNamespaceDeclaration(resourceAPI);
   _builder.append(_generateNamespaceDeclaration_1);
   _builder.newLineIfNotEmpty();
  }
 }
 return _builder;
}

代码示例来源:origin: com.reprezen.genflow/rapidml-diagram

_builder.newLine();
 EList<ResourceAPI> _resourceAPIs = model.getResourceAPIs();
 for(final ResourceAPI resourceAPI : _resourceAPIs) {
  _builder.append("\"ResourceAPI\": {");

代码示例来源:origin: com.reprezen.genflow/rapidml-doc

_builder.newLine();
 EList<ResourceAPI> _resourceAPIs = model.getResourceAPIs();
 for(final ResourceAPI resourceAPI : _resourceAPIs) {
  _builder.append("        ");

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com