Package org.eclipse.emf.ecore.xmi.impl

Examples of org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl


    super();
  }

  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    result.setEncoding("UTF-8");

    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);

    result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
    result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);

    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());
    result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());

    result.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());
    result.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());

    return result;
  }
View Full Code Here


     * @param out
     * @throws IOException
     */
    public void save(final OutputStream out) throws IOException
    {
        final Resource res = new XMLResourceImpl()
        {
            @Override
            protected XMLHelper createXMLHelper()
            {
                return new XMLHelperImpl()
                {
                    public String getHREF(EObject obj)
                    {
                        return ComponentMappingPackage.eNS_URI;
                    }

                    @Override
                    public EPackage getNoNamespacePackage()
                    {
                        return MetadataPackage.eINSTANCE;
                    }
                };
            }
        };// _resourceSet.createResource(URI.createURI("foo.xml"));
        res.getContents().add(_root);
        // res.setURI(uri);
        // resourceSet.getResources().add(res);
        // setLoadOptions(res);
        Map options = new HashMap();
        options.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
        options.put(XMLResource.OPTION_EXTENDED_META_DATA, _extendedMetadata);
        // options.put(XMLResource.OPTION_RESOURCE_HANDLER, res);
        options.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);
        options.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.FALSE);// turning
        // this
        // off
        // so
        // that
        // res.getErrors()
        // has
        // values
        // to
        // check!
        // bizarre
        // that
        // I
        // should
        // need
        // to
        // do
        // this.
        res.save(out, options);
    }
View Full Code Here

    super();
  }
 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
    //result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
    //result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    return result;
View Full Code Here

    super();
  }
 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
    //result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
    //result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    return result;
View Full Code Here

    super();
  }
 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
    //result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
    //result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));

    return result;
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl

Copyright © 2018 www.massapicom. 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.