Package org.eclipse.emf.ecore.xmi

Examples of org.eclipse.emf.ecore.xmi.XMLOptions


      }
    }
 
    resource = (XMLResource)resourceSet.createResource(URI.createURI("http:///temp.xml"));
   
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here


 
  protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
 
  public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
  {
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here

 
  protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
 
  public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
  {
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here

 
  protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
 
  public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
  {
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here

            }
            /*
             * Loads schema if necessary
             */
            if (Boolean.TRUE.equals(options.get(SDOHelper.XMLOptions.XML_LOAD_SCHEMA))){
                XMLOptions xmlOptions = (XMLOptions) options.get(OPTION_XML_OPTIONS);
                if (xmlOptions == null) {
                    xmlOptions = new XMLOptionsImpl();
                    options.put(OPTION_XML_OPTIONS, xmlOptions);
                }
                xmlOptions.setProcessSchemaLocations(true);
                if (option == null){
                    option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
                }
                ExtendedMetaData extendedMetaData;
                final XSDHelper xsdHelper;
                if (option == null) {
                    extendedMetaData = ExtendedMetaData.INSTANCE;
                    xsdHelper = XSDHelper.INSTANCE;
                } else {
                    extendedMetaData = (ExtendedMetaData) option;
                    xsdHelper = (new HelperContextImpl(extendedMetaData, false)).getXSDHelper();
                }
                xmlOptions.setEcoreBuilder(new DefaultEcoreBuilder(extendedMetaData) {
                    public Collection generate(Map targetNamespaceToURI) throws IOException {
                        for (Iterator iterator = targetNamespaceToURI.values().iterator(); iterator.hasNext();) {
                            String uri = iterator.next().toString();
                            xsdHelper.define(uri.indexOf(":/") == -1 ? Thread.currentThread().getContextClassLoader().getResourceAsStream(uri)
                                    : new URL(uri).openStream(), uri);
View Full Code Here

 
  protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
 
  public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
  {
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here

                options.put(OPTION_EXTENDED_META_DATA, option = new SDOExtendedMetaDataImpl()); // TODO copy (BasicExtendedMetaData)option
            /*
             * Loads schema if necessary
             */
            if (Boolean.TRUE.equals(options.get(SDOUtil.XML_LOAD_SCHEMA))) {
                XMLOptions xmlOptions = (XMLOptions) options.get(OPTION_XML_OPTIONS);
                if (xmlOptions == null) {
                    xmlOptions = new XMLOptionsImpl();
                    options.put(OPTION_XML_OPTIONS, xmlOptions);
                }
                xmlOptions.setProcessSchemaLocations(true);
                if (option == null)
                    option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
                ExtendedMetaData extendedMetaData;
                final XSDHelper xsdHelper;
                if (option == null) {
                    extendedMetaData = ExtendedMetaData.INSTANCE;
                    xsdHelper = XSDHelper.INSTANCE;
                } else {
                    extendedMetaData = (ExtendedMetaData) option;
                    xsdHelper = new XSDHelperImpl(extendedMetaData, null);
                }
                xmlOptions.setEcoreBuilder(new DefaultEcoreBuilder(extendedMetaData) {
                    public Collection generate(Map targetNamespaceToURI) throws IOException {
                        for (Iterator iterator = targetNamespaceToURI.values().iterator(); iterator.hasNext();) {
                            String uri = iterator.next().toString();
                            xsdHelper.define(uri.indexOf(":/") == -1 ? Thread.currentThread().getContextClassLoader().getResourceAsStream(uri)
                                    : new URL(uri).openStream(), uri);
View Full Code Here

      setExtendedMetaDataOption(Boolean.TRUE);
    }
   
    useNewMethods = Boolean.FALSE.equals(options.get(XMLResource.OPTION_USE_DEPRECATED_METHODS))
   
    XMLOptions xmlOptions = (XMLOptions)options.get(XMLResource.OPTION_XML_OPTIONS);
    if (xmlOptions != null)
    {
      processSchemaLocations = xmlOptions.isProcessSchemaLocations();
      externalURIToLocations = xmlOptions.getExternalSchemaLocations();

      if (processSchemaLocations || externalURIToLocations != null)
      {
        if (extendedMetaData == null)
        {
          setExtendedMetaDataOption(Boolean.TRUE);
        }
        ecoreBuilder = xmlOptions.getEcoreBuilder();
        if (ecoreBuilder == null)
        {
          ecoreBuilder = createEcoreBuilder(options, extendedMetaData);
        }
        else
        {
          ecoreBuilder.setExtendedMetaData(extendedMetaData);
        }
      }
      processAnyXML = xmlOptions.isProcessAnyXML();
      if (processAnyXML && extendedMetaData == null)
      {
        setExtendedMetaDataOption(Boolean.TRUE);
      }
    }
View Full Code Here

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

    result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);

    XMLOptions xmlOptions = new XMLOptionsImpl();

    xmlOptions.setProcessAnyXML(true);

    xmlOptions.setProcessSchemaLocations(true);
   
    result.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    return result;
  }
View Full Code Here

 
  protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
 
  public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
  {
    XMLOptions xmlOptions = new XMLOptionsImpl();
    xmlOptions.setProcessAnyXML(true);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);

    resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
   
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.xmi.XMLOptions

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.