@Override public URI appendSegment(String segment) { return base.appendSegment(segment); }
protected void registerPathmaps(URI uri) { URIConverter.URI_MAP.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri.appendSegment("libraries").appendSegment("")); URIConverter.URI_MAP.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri.appendSegment("metamodels").appendSegment("")); URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri.appendSegment("profiles").appendSegment("")); }
public static URI toFolderURI(URI uri) { if (uri.hasTrailingPathSeparator()) { return uri; } else { return uri.appendSegment(""); } } }
@Override public URI appendSegment(String segment) { URI result = uri.appendSegment(segment); return result == uri ? this : appendFragment(result); }
private URI getRestFileURI(Description description) { String sampleRestFilePath = getSampleRestName(description); URI modelURI = URI.createFileURI(Resources.getResource("models/dsl").getFile()); for (String nextSegment : sampleRestFilePath.split("/")) { modelURI = modelURI.appendSegment(nextSegment); } return modelURI; }
public TypeResourceDescription(final QualifiedName typeName) { this.uri = URIHelperConstants.OBJECTS_URI.appendSegment(typeName.toString(".")); TypeResourceDescription.ClassDescription _classDescription = new TypeResourceDescription.ClassDescription(typeName); this.exportedObjects = Collections.<IEObjectDescription>unmodifiableList(CollectionLiterals.<IEObjectDescription>newArrayList(_classDescription)); }
protected List<JvmType> createObjectReference(ResourceSet resourceSet) { // no upper bound found - seems to be an invalid - assume object as upper bound JvmType objectType = factory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); objectType = (JvmType) EcoreUtil.resolve(objectType, resourceSet); return Collections.singletonList(objectType); } }
private void createTerminologyProject(Project parent) throws IOException { ProjectVersion version = PropertiesFactory.eINSTANCE.createProjectVersion(); version.setName("master"); version.setParent(parent); URL url = new URL(MessageFormat.format(TERMINOLOGY_DOWNLOAD_URL, "de")); createMessageFile(url.openStream(), version.absoluteFilePath().appendSegment("messages.properties"),true); for (String language : TERMINOLOGY_LANGUAGES) { url = new URL(MessageFormat.format(TERMINOLOGY_DOWNLOAD_URL, language)); createMessageFile(url.openStream(),version.absoluteFilePath().appendSegment("messages_"+language+".properties"),false); } ScanConfiguration scanConfiguration = PreferencesUtil.getScanConfigForProject(parent); version.fullScan(scanConfiguration); }
@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); }
private PropertyFileDescriptor getModel(PageParameters pageParameters) { URI uri = URI.createURI("/"); for(int i=0;i<pageParameters.getIndexedCount();i++){ uri = uri.appendSegment(pageParameters.get(i).toString()); } return (PropertyFileDescriptor) resolver.resolve(uri); } }
private JvmTypeReference newObjectReference() { JvmType objectType = typesFactory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); JvmParameterizedTypeReference result = typesFactory.createJvmParameterizedTypeReference(); result.setType(objectType); return result; }
public String getRelativeGenModelLocation() { URI genModelURI = eResource().getURI(); String result = genModelURI.deresolve(genModelURI.trimSegments(genModelURI.segmentCount() - 2).appendSegment("")).toString(); return result; }
@Override public TypeResource createResource(URI uri) { String qualifiedName = uri.lastSegment(); if (qualifiedName.lastIndexOf('$') != -1) { String outermostClassName = new BinaryClass(qualifiedName, classLoader).getOutermostClassName(); return super.createResource(URIHelperConstants.OBJECTS_URI.appendSegment(outermostClassName)); } return super.createResource(uri); }
protected LightweightTypeReference createObjectReference(ITypeReferenceOwner owner, ResourceSet resourceSet) { // no upper bound found - seems to be an invalid - assume object as upper bound JvmType objectType = factory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); objectType = (JvmType) EcoreUtil.resolve(objectType, resourceSet); return owner.newParameterizedTypeReference(objectType); } }
public static URI computeTemplateResourceLocation(Locale locale, URI translationLocation, Locale masterLocale, ProjectVersion version) { PropertyScanner scanner = createScanner(version); URI parentPath = version.absoluteFilePath(); File path = scanner.findTemplate(new File(parentPath.path()+translationLocation.toString()), null); URI location = URI.createFileURI(path.getAbsolutePath()); URI trimmedLocation = URI.createURI(location.segment(parentPath.segmentCount())); for (int i = parentPath.segmentCount()+1; i < location.segmentCount(); i++) { //append the other segments trimmedLocation = trimmedLocation.appendSegment(location.segment(i)); } return trimmedLocation; }
@Override public URI getURI() { BinaryTypeSignature typeErasure = getArrayComponentType().getTypeErasure(); String identifier = typeErasure.toIdentifier(); URI result = URIHelperConstants.OBJECTS_URI.appendSegment(identifier).appendFragment(toIdentifier()); return result; }
public String getRelativeGenModelLocation() { URI genModelURI = eResource().getURI(); String result = genModelURI.deresolve(genModelURI.trimSegments(genModelURI.segmentCount() - 2).appendSegment("")).toString(); return result; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public URI getBase() { if(getParent()==null) return null; if(getParent().getRoot()==null) return null; return getParent().getRoot().appendSegment(getName()); }
protected void generateEditorBuildProperties(GenModel genModel, Monitor monitor) { message = CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditorBuildProperties_message"); monitor.subTask(message); generateText (genModel.getEditorProjectDirectory() + "/build.properties", getJETEmitter(getJETEmitterDescriptors(), EDITOR_BUILD_PROPERTIES_ID), null, genModel.isUpdateClasspath() && !exists(toURI(genModel.getEditorProjectDirectory()).appendSegment("plugin.xml")), PROPERTIES_ENCODING, createMonitor(monitor, 1)); }
protected void generateEditBuildProperties(GenModel genModel, Monitor monitor) { message = CodeGenEcorePlugin.INSTANCE.getString("_UI_GeneratingEditBuildProperties_message"); monitor.subTask(message); generateText (genModel.getEditProjectDirectory() + "/build.properties", getJETEmitter(getJETEmitterDescriptors(), EDIT_BUILD_PROPERTIES_ID), null, genModel.isUpdateClasspath() && !exists(toURI(genModel.getEditProjectDirectory()).appendSegment("plugin.xml")), PROPERTIES_ENCODING, createMonitor(monitor, 1)); }