org.eclipse.emf.common.util.URI.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(172)

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

URI.isEmpty介绍

[英]Returns true if this is a #isCurrentDocumentReference() with no fragment component; false otherwise.
[中]

代码示例

代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core

@Override
public boolean isEmpty() {
  return internalUri.isEmpty();
}

代码示例来源:origin: atlanmod/NeoEMF

@Override
public boolean isEmpty() {
  return base.isEmpty();
}

代码示例来源:origin: io.sarl.lang/io.sarl.lang

if (uri.isArchive() || uri.isEmpty() || uri.isCurrentDocumentReference()) {
  return false;

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

private static org.eclipse.emf.common.util.URI getResolvedImportUri(Resource context, org.eclipse.emf.common.util.URI uri) {
  org.eclipse.emf.common.util.URI contextURI = context.getURI();
  if (contextURI.isHierarchical() && !contextURI.isRelative() && (uri.isRelative() && !uri.isEmpty())) {
    uri = uri.resolve(contextURI);
  }
  return uri;
}

代码示例来源:origin: org.eclipse/xtext

private static URI getResolvedImportUri(Resource context, URI uri) {
  URI contextURI = context.getURI();
  if (contextURI.isHierarchical() && !contextURI.isRelative() && (uri.isRelative() && !uri.isEmpty())) {
    uri = uri.resolve(contextURI);
  }
  return uri;
}

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

private static URI getResolvedImportUri(Resource context, URI uri) {
    URI contextURI = context.getURI();
    if (contextURI.isHierarchical() && !contextURI.isRelative() && (uri.isRelative() && !uri.isEmpty())) {
      uri = uri.resolve(contextURI);
    }
    return uri;
  }
}

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

if ((relativeURI.isEmpty() || Objects.equal(relativeURI, absoluteURI))) {
 return null;

代码示例来源:origin: org.eclipse/xtext

/**
 * checks whether the given URI can be loaded given the context. I.e. there's a resource set with a corresponding
 * resource factory and the physical resource exists.
 */
public static boolean isValidUri(Resource resource, URI uri) {
  if (uri == null || uri.isEmpty()) {
    return false;
  }
  URI newURI = getResolvedImportUri(resource, uri);
  try {
    ResourceSet resourceSet = resource.getResourceSet();
    if (resourceSet.getResource(uri, false) != null)
      return true;
    URIConverter uriConverter = resourceSet.getURIConverter();
    URI normalized = uriConverter.normalize(newURI);
    if (normalized != null)
      // fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=326760
      if("platform".equals(normalized.scheme()) && !normalized.isPlatform()) 
        return false;
      return uriConverter.exists(normalized, Collections.emptyMap());
  } catch (RuntimeException e) { // thrown by org.eclipse.emf.ecore.resource.ResourceSet#getResource(URI, boolean)
    log.trace("Cannot load resource: " + newURI, e);
  }
  return false;
}

相关文章