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

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

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

URI.scheme介绍

[英]If this is an absolute URI, returns the scheme component; null otherwise.
[中]如果这是一个绝对URI,则返回scheme组件;null否则。

代码示例

代码示例来源:origin: geotools/geotools

@Override
public boolean canHandle(URI uri) {
  return "http".equals(uri.scheme()) || "https".equals(uri.scheme());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common

@Override
public String scheme()
{
 return uri.scheme();
}

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

@Override
public boolean canHandle(final URI uri) {
 String _scheme = uri.scheme();
 return Objects.equal(_scheme, InMemoryURIHandler.SCHEME);
}

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

@Override
public boolean canHandle(URI uri)
{
 return "archive".equals(uri.scheme());
}

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

public static boolean isClasspathUri(URI uri) {
  if (uri == null)
    return false;
  String scheme = uri.scheme();
  return CLASSPATH_SCHEME.equals(scheme);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

@Override
public boolean canHandle(URI uri)
{
 return "archive".equals(uri.scheme());
}

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

/**
 * Does the passed URI have the form platform:/plugin/... ?
 * 
 * @param uri
 * @return <code>true</code> if uri is platform plugin protocol.
 * 
 * @since 1.0.0
 */
public static boolean isPlatformPluginResourceURI(URI uri) {
  return JEMUtilPlugin.PLATFORM_PROTOCOL.equals(uri.scheme()) && JEMUtilPlugin.PLATFORM_PLUGIN.equals(uri.segment(0));
}

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

/**
 * Does the passed URI have the form platform:/resource/... ?
 * 
 * @param uri
 * @return <code>true</code> if it is a platform resource protocol.
 * 
 * @since 1.0.0
 */
public static boolean isPlatformResourceURI(URI uri) {
  return JEMUtilPlugin.PLATFORM_PROTOCOL.equals(uri.scheme()) && JEMUtilPlugin.PLATFORM_RESOURCE.equals(uri.segment(0));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

static public String EMFtoPlatform(org.eclipse.emf.common.util.URI uri) {
  if (!PLATFORM_SCHEMA_EMF.equals(uri.scheme()))
    return null;
  // remove all segments but first two - only need bundle/fragment name
  int segments = uri.segmentCount();
  // segments: { "plugin", "org.eclipse.platform", "myDir", "model.e4xmi" }
  if (segments > 2)
    uri = uri.trimSegments(segments - 2);
  return uri.toString();
}

代码示例来源:origin: org.eclipse.emf.cdo.transfer/repository

@Override
public CDOTransferElement getElement(URI uri)
{
 if (CDOURIUtil.PROTOCOL_NAME.equals(uri.scheme()))
 {
  return getElement(uri.path());
 }
 return null;
}

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

@Override
public void close() {
  this.backend.close();
  this.backend = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createTransientBackend();
  this.store = PersistenceBackendFactoryRegistry.getFactoryProvider(uri.scheme()).createTransientStore(this, backend);
  this.isPersistent = false;
  this.isLoaded = false;
  NeoLogger.info("{0} closed: {1}", PersistentResource.class.getSimpleName(), getURI());
}

代码示例来源:origin: org.codehaus.openxma/dsl-generator

/**
 * @return the URI#scheme part from the resource of the given EObject
 */
public String getResourceUriScheme(EObject eObject) {
  return eObject.eResource()!=null ? eObject.eResource().getURI().scheme() : "";
}

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

public boolean canHandle(URI uri)
{
 if (CDO_URI_SCHEME.equals(uri.scheme()))
 {
  String uuid = view.getSession().getRepositoryInfo().getUUID();
  return uuid.equals(CDOURIUtil.extractRepositoryUUID(uri));
 }
 CDOViewProvider[] viewProviders = CDOViewProviderRegistry.INSTANCE.getViewProviders(uri);
 return viewProviders.length != 0;
}

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

@Override
public URI normalize(URI uri) {
  if (URIHelperConstants.PROTOCOL.equals(uri.scheme())) {
    String qualifiedName = uri.lastSegment();
    if (qualifiedName.lastIndexOf('$') != -1) {
      String outermostClassName = new BinaryClass(qualifiedName, classLoader).getOutermostClassName();
      return URIHelperConstants.OBJECTS_URI.appendSegment(outermostClassName);
    }
    return uri;
  }
  return existing.normalize(uri);
}

代码示例来源:origin: com.b2international.snowowl/org.eclipse.emf.cdo

public boolean canHandle(URI uri)
{
 if (CDO_URI_SCHEME.equals(uri.scheme()))
 {
  String uuid = view.getSession().getRepositoryInfo().getUUID();
  return uuid.equals(CDOURIUtil.extractRepositoryUUID(uri));
 }
 CDOViewProvider[] viewProviders = CDOViewProviderRegistry.INSTANCE.getViewProviders(uri);
 return viewProviders.length != 0;
}

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

/**
 * Constructs a new {@code DefaultPersistentResource} with the given {@code uri}.
 *
 * @param uri the URI of the resource
 */
public DefaultPersistentResource(URI uri) {
  super(uri);
  factory = BackendFactoryRegistry.getInstance().getFactoryFor(uri.scheme());
  // Creates a transient backend until a call to `save()`/`load()`
  eStore = createTransientStore();
  logState("created");
}

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

@Test
void testCreateRemoteUriWithStringAddr() {
  final URI uri = factory.createRemoteUri("192.168.0.1", 1234, "test");
  assertThat(uri.isHierarchical()).isTrue();
  assertThat(uri.scheme()).isEqualTo(SCHEME);
  assertThat(uri.host()).isEqualTo("192.168.0.1");
  assertThat(uri.port()).isEqualTo(Integer.toString(1234));
  assertThat(uri.segments()).containsExactly("test");
}

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

@Test
void testCreateLocalUriWithString() throws IOException {
  final URI uri = factory.createLocalUri(currentTempFile().getAbsolutePath());
  assertThat(uri.isFile()).isTrue();
  assertThat(uri.scheme()).isEqualTo(SCHEME);
  assertThat(new File(uri.toFileString())).isEqualTo(currentTempFile());
}

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

@Test
void testCreateLocalUriWithFile() throws IOException {
  final URI uri = factory.createLocalUri(currentTempFile());
  assertThat(uri.isFile()).isTrue();
  assertThat(uri.scheme()).isEqualTo(SCHEME);
  assertThat(new File(uri.toFileString())).isEqualTo(currentTempFile());
}

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

@Test
void testCreateLocalUriWithUri() throws IOException {
  final URI uri = factory.createLocalUri(URI.createFileURI(currentTempFile().getAbsolutePath()));
  assertThat(uri.isFile()).isTrue();
  assertThat(uri.scheme()).isEqualTo(SCHEME);
  assertThat(new File(uri.toFileString())).isEqualTo(currentTempFile());
}

相关文章

微信公众号

最新文章

更多