Examples of EMap


Examples of org.eclipse.emf.common.util.EMap

  /**
   * @return an EMap containing the schema locations or null when no map
   */
  protected EMap getSchemaLocationMap()
  {
    EMap result = null;
    if ((documentRoot != null) && (extendedMetaData != null))
    {
      EReference xsiSchemaLocationMapFeature = extendedMetaData
          .getXSISchemaLocationMapFeature(documentRoot.eClass());
      if (xsiSchemaLocationMapFeature != null)
View Full Code Here

Examples of org.eclipse.emf.common.util.EMap

    return location.toString();
  }

  public String getSchemaLocation()
  {
    EMap xsiSchemaLocationMap = getSchemaLocationMap();
    if (xsiSchemaLocationMap != null)
    {
      if (!xsiSchemaLocationMap.isEmpty())
      {
        StringBuffer xsiSchemaLocation = new StringBuffer();
        for (Iterator i = xsiSchemaLocationMap.entrySet().iterator(); i
            .hasNext();)
        {
          Map.Entry entry = (Map.Entry) i.next();
          String namespace = (String) entry.getKey();
          if (namespace != null)
View Full Code Here

Examples of org.eclipse.emf.common.util.EMap

    return null;
  }

  public void setSchemaLocation(String schemaLocation)
  {
    EMap xsiSchemaLocationMap = getSchemaLocationMap();
    if (xsiSchemaLocationMap != null)
    {
      // only remove the entries from xsiSchemaLocationMap that contain a
      // non-null key
      for (Iterator i = xsiSchemaLocationMap.entrySet().iterator(); i.hasNext();)
      {
        Map.Entry entry = (Map.Entry) i.next();
        if (entry.getKey() != null)
        {
          i.remove();
        }
      }
      if (xsiSchemaLocationMap.size() == 0)
      {
        resource.getDefaultSaveOptions().put(
            XMLResource.OPTION_SCHEMA_LOCATION, Boolean.FALSE);
      }
      if (schemaLocation != null)
      {
        String[] values = schemaLocation.split(WHITESPACE_REGEX);
        for (int i = 0; i < values.length; i++) // note: also incremented in
        // loop
        {
          String key = values[i++];
          if (i < values.length)
          {
            xsiSchemaLocationMap.put(key, resolve(values[i]));
          }
        }
        if (xsiSchemaLocationMap.size() != 0)
        {
          resource.getDefaultSaveOptions().put(
              XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
        }
      }
View Full Code Here

Examples of org.eclipse.emf.common.util.EMap

    }
  }

  public String getNoNamespaceSchemaLocation()
  {
    EMap xsiSchemaLocationMap = getSchemaLocationMap();
    if (xsiSchemaLocationMap != null)
    {
      StringBuffer xsiSchemaLocation = new StringBuffer();
      if (!xsiSchemaLocationMap.isEmpty())
      {
        Object valueObject = xsiSchemaLocationMap.get(null);
        if (valueObject != null)
        {
          String valueString = (String) valueObject;
          String[] values = valueString.split(WHITESPACE_REGEX);
          for (int i = 0; i < values.length; i++)
View Full Code Here

Examples of org.eclipse.emf.common.util.EMap

    return null;
  }

  public void setNoNamespaceSchemaLocation(String schemaLocation)
  {
    EMap xsiSchemaLocationMap = getSchemaLocationMap();
    if (xsiSchemaLocationMap != null)
    {
      // only remove the entries from xsiSchemaLocationMap that contain a null
      // key
      xsiSchemaLocationMap.removeKey(null);
      if (xsiSchemaLocationMap.size() == 0)
      {
        resource.getDefaultSaveOptions().put(
            XMLResource.OPTION_SCHEMA_LOCATION, Boolean.FALSE);
      }
      if (schemaLocation != null)
      {
        String[] values = schemaLocation.split(WHITESPACE_REGEX);
        for (int i = 0; i < values.length; i++)
        {
          xsiSchemaLocationMap.put(null, resolve(values[i]));
        }
        if (xsiSchemaLocationMap.size() != 0)
        {
          resource.getDefaultSaveOptions().put(
              XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
        }
      }
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.