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

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

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

URI.segmentsList介绍

[英]Returns an unmodifiable list containing the same segments as the array returned by #segments.
[中]返回一个不可修改的列表,其中包含与#segments返回的数组相同的段。

代码示例

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

@Override
public List<String> segmentsList()
{
 return uri.segmentsList();
}

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

@Override
public List<String> segmentsList() {
  return internalUri.segmentsList();
}

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

@Override
public List<String> segmentsList() {
  return base.segmentsList();
}

代码示例来源:origin: org.jabylon/properties

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
public Resolvable<?, ?> resolveChild(URI path) {
  return resolveChild(path.segmentsList());
}

代码示例来源:origin: org.jabylon/rest.ui

public static PageParameters buildPageParametersFor(URI uri)
{
  PageParameters params = new PageParameters();
  List<String> segments = new ArrayList<String>(uri.segmentsList());
  int count = 0;
  for (String string : segments) {
    params.set(count++, string);
  }
  return params;
}

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

public Collection getLoadedMofResources() {
  Collection resources = super.getLoadedMofResources();
  Collection resourcesToRemove = new ArrayList();
  Iterator iterator = resources.iterator();
  while (iterator.hasNext()) {
    Resource res = (Resource) iterator.next();
    //only remove component files that are in the settings directory
    if (res.getURI().toString().endsWith(IModuleConstants.COMPONENT_FILE_NAME) && res.getURI().segmentsList().contains(IModuleConstants.DOT_SETTINGS))
      resourcesToRemove.add(res);
  }
  if (null != resourcesToRemove) {
    resources.removeAll(resourcesToRemove);
  }
  return resources;
}

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

/**
 * Creates a {@link URL} from the given {@code uri}.
 *
 * @param uri the URI to convert
 *
 * @return a new URL
 *
 * @throws MalformedURLException if an error occurs during the {@link URL} creation
 */
@Nonnull
// TODO Add HTTPS support
private static URL uriToUrl(URI uri) throws MalformedURLException {
  final String protocol = "http";
  final String delimiter = "_";
  int port = isNull(uri.port()) ? -1 : Integer.parseInt(uri.port());
  String path = uri.segmentsList().stream()
      .map(s -> s.replaceAll("-", delimiter))
      .collect(Collectors.joining(delimiter, "/", Strings.EMPTY));
  return new URL(protocol, uri.host(), port, path);
}

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

public URI getURIForTrace(URI uri) {
  if (uri.isPlatform()) {
    // create a URI that is relative to the contained projects.
    List<String> segments = uri.segmentsList().subList(2, uri.segmentCount());
    return URI.createHierarchicalURI(segments.toArray(new String[segments.size()]), null, null);
  }
  return uri.trimFragment().trimQuery();
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.fe.ui

private String getDefaultProjectName() {
  String projectName = "";
  String selectionProject = null;
  try {
    selectionProject = selection != null && ((SQLObject) selection.get(0)).eResource() != null ? ((SQLObject) selection.get(0)).eResource()
        .getURI().segmentsList().get(1).toString() : null;
  } catch (Exception e) {
  }
  if ((selectionProject != null)
      && (!selectionProject.equals(""))
      && (ResourcesPlugin.getWorkspace().getRoot().exists(new Path(
          selectionProject)))) {
    projectName = String.valueOf(IPath.SEPARATOR) + selectionProject;
  } else {
    IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot()
        .getProjects();
    for (int index = 0; index < allProjects.length; index++) {
      if (allProjects[index].isOpen()) {
        // Remove the trailing slash.
        String path = allProjects[index].getFullPath().toString();
        projectName = path.substring(1, path.length());
        break;
      }
    }
  }
  return projectName;
}

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

return false;
final List<String> segments = new ArrayList<>(uri.segmentsList());
if (segments.isEmpty()) {
  return false;

代码示例来源:origin: korpling/ANNIS

it = nodes.get(0).getPath().segmentsList().iterator();
it = g.getPath().segmentsList().iterator();

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

List<String> segments = uri.segmentsList().subList(2, uri.segmentCount());
URI result = targetPlatformBundleLocation.appendSegments(segments.toArray(new String[segments.size()]));
return result;

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

.segmentsList().subList(2, segmentCount)
.toArray(new String[]{});

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

.segmentsList().subList(2, segmentCount)
.toArray(new String[]{});

相关文章