Examples of ResourceSetImpl


Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   
    monitor.beginTask("Verifying model '" + o.getName() + "'", 10);

    monitor.subTask("Loading model");
    // try and load the file directly
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource resource = resourceSet.getResource(URI.createFileURI(o
        .getLocation().toString()), true);

    // we can only do one model
    if (resource.getContents().size() != 1) {
      return new Status(
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   * @deprecated
   *     use {@link ModelLoader#load(File)} to ensure loaded paths are not relative
   */
  public static EObject load(String filename) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(filename);
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + filename + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param f the file to load
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(File f) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(f.getAbsolutePath());
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + f + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param o
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(IFile o) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(o.getLocation().toString());
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + o + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param uri
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(URI uri) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + uri + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

  }

  protected void setUp() throws Exception {
    super.setUp();

    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
        .put("library", new XMLResourceFactoryImpl());
    Resource resource = resourceSet.createResource(URI
        .createURI("test.library"));

    // create a library with three books and two writers
    fixture = LibraryFactory.eINSTANCE.createLibrary();
    fixture.setName("Test Library");
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

  }

  protected void setUp() throws Exception {
    super.setUp();

    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put("library", new ResourceFactoryImpl());
    Resource resource = resourceSet.createResource(URI.createURI("test.library"));

    // create a library with three books and two writers
    fixture = LibraryFactory.eINSTANCE.createLibrary();
    fixture.setName("Test Library");
    resource.getContents().add(fixture);
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param f the file to load
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(File f) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(f.getAbsolutePath());
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + f + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param o
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(IFile o) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    URI uri = URI.createFileURI(o.getLocation().toString());
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + o + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.impl.ResourceSetImpl

   * @param uri
   * @return
   * @throws ModelLoadException if the resource is null, or the resource contains too many elements
   */
  public static EObject load(URI uri) throws ModelLoadException {
    ResourceSet resourceSet = new ResourceSetImpl();
    Resource resource = resourceSet.getResource(uri, true);
   
    if (resource == null)
      throw new ModelLoadException(new NullPointerException("Unexpected null resource in '" + uri + "'"));
   
    if (resource.getContents().size() != 1) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.