gpt4 book ai didi

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

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

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

ZenModel.getNamespace介绍

[英]Returns the value of the 'Namespace' attribute.

If the meaning of the 'Namespace' attribute isn't clear, there really should be more of a description here...
[中]返回“Namespace”属性的值。
如果“Namespace”属性的含义不清楚,这里真的应该有更多的描述。。。

代码示例

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

public static NameHelper forModel(final ZenModel model) {
 NameHelper _xblockexpression = null;
 {
  String _namespace = model.getNamespace();
  String _plus = (_namespace + ".");
  String _name = model.getName();
  final String qname = (_plus + _name);
  NameHelper _elvis = null;
  NameHelper _get = NameHelper.helpers.get(qname);
  if (_get != null) {
   _elvis = _get;
  } else {
   NameHelper _xblockexpression_1 = null;
   {
    final NameHelper helper = new NameHelper();
    NameHelper.helpers.put(qname, helper);
    _xblockexpression_1 = helper;
   }
   _elvis = _xblockexpression_1;
  }
  _xblockexpression = _elvis;
 }
 return _xblockexpression;
}

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

public static TypeHelper forModel(final ZenModel model) {
 TypeHelper _xblockexpression = null;
 {
  String _namespace = model.getNamespace();
  String _plus = (_namespace + ".");
  String _name = model.getName();
  final String qname = (_plus + _name);
  TypeHelper _elvis = null;
  TypeHelper _get = TypeHelper.helpers.get(qname);
  if (_get != null) {
   _elvis = _get;
  } else {
   TypeHelper _xblockexpression_1 = null;
   {
    final TypeHelper helper = new TypeHelper();
    TypeHelper.helpers.put(qname, helper);
    _xblockexpression_1 = helper;
   }
   _elvis = _xblockexpression_1;
  }
  _xblockexpression = _elvis;
 }
 return _xblockexpression;
}

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

@SuppressWarnings("unused")
  private QualifiedName qualifiedName(ZenModel model) {
    if (!Strings.isEmpty(model.getNamespace())) {
      return QualifiedName.create(model.getNamespace().split("\\.")).append(model.getName()); //$NON-NLS-1$
    }
    return QualifiedName.create(model.getName());
  }
}

代码示例来源: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.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.rapidml/com.reprezen.rapidml

@Override
protected IScope getLocalElementsScope(IScope parent, final EObject context, final EReference reference) {
  IScope local = super.getLocalElementsScope(parent, context, reference);
  Optional<QualifiedName> localElementsQN = getLocalElementsQualifiedName(context, reference);
  if (localElementsQN.isPresent()) {
    QualifiedName importedNamespace = localElementsQN.get();
    ZenModel model = context instanceof ZenModel ? (ZenModel) context : RapidmlModelUtils.getZenModel(context);
    if (!Strings.isEmpty(model.getNamespace())) {
      importedNamespace = qualifiedNameConverter.toQualifiedName(model.getNamespace())
          .append(importedNamespace);
    }
    List<ImportNormalizer> namespaceResolvers = singletonList(
        new ImportNormalizer(importedNamespace, true, isIgnoreCase(reference)));
    ImportScope importScope = new ImportScope(namespaceResolvers, local, null, reference.getEReferenceType(),
        isIgnoreCase(reference));
    return importScope;
  }
  return local;
}

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