当前位置: 首页>>代码示例>>Java>>正文


Java FeatureMap.Entry方法代码示例

本文整理汇总了Java中org.eclipse.emf.ecore.util.FeatureMap.Entry方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureMap.Entry方法的具体用法?Java FeatureMap.Entry怎么用?Java FeatureMap.Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.emf.ecore.util.FeatureMap的用法示例。


在下文中一共展示了FeatureMap.Entry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConfigurationData

import org.eclipse.emf.ecore.util.FeatureMap; //导入方法依赖的package包/类
protected Object getConfigurationData ( final HiveConfigurationType configuration )
{
    for ( FeatureMap.Entry entry : configuration.getAny () )
    {
        if ( entry.getValue () instanceof EObject )
        {
            return entry.getValue ();
        }
        else if ( FeatureMapUtil.isText ( entry ) )
        {
            return entry.getValue ();
        }
        else if ( FeatureMapUtil.isCDATA ( entry ) )
        {
            return entry.getValue ();
        }
    }
    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:AbstractHiveFactory.java

示例2: undoTextElementToTextNode

import org.eclipse.emf.ecore.util.FeatureMap; //导入方法依赖的package包/类
private static void undoTextElementToTextNode(XMLResource saturnResourceImpl_, Map<Entry, Entry> textNodes_)
{
  DocumentRoot o = (DocumentRoot) saturnResourceImpl_.getContents().get(0);
  Saturn saturn = (Saturn) o.eContents().get(0);
  TreeIterator<EObject> ee = saturn.eAllContents();
  while (ee.hasNext())
  {
    EObject e = ee.next();
    if (e == null) continue;
    EClass ec = e.eClass();
    if (!ValuesPackage.eINSTANCE.getComplexValue().isSuperTypeOf(ec)) continue;

    ComplexValue cv = (ComplexValue) e;
    for (int i = 0; i < cv.getMixed().size(); i++)
    {
      FeatureMap.Entry entry = cv.getMixed().get(i);
      if (textNodes_.containsKey(entry))
      {
        Entry textComplexValueEntry = textNodes_.get(entry);
        cv.getMixed().set(i, textComplexValueEntry);
      }
    }
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:25,代码来源:SaturnDocLoadSaveUtil.java

示例3: textElementToTextNode

import org.eclipse.emf.ecore.util.FeatureMap; //导入方法依赖的package包/类
private static void textElementToTextNode(SaturnResourceImpl saturnResourceImpl_, Map<Entry, Entry> textNodes_)
{
  DocumentRoot o = (DocumentRoot) saturnResourceImpl_.getContents().get(0);
  Saturn saturn = (Saturn) o.eContents().get(0);
  TreeIterator<EObject> ee = saturn.eAllContents();
  while (ee.hasNext())
  {
    EObject e = ee.next();
    if (e == null) continue;
    EClass ec = e.eClass();
    if (!ValuesPackage.eINSTANCE.getComplexValue().isSuperTypeOf(ec)) continue;

    ComplexValue cv = (ComplexValue) e;

    for (int i = 0; i < cv.getMixed().size(); i++)
    {
      FeatureMap.Entry entry = cv.getMixed().get(i);
      Object value = entry.getValue();
      if (value instanceof TextComplexValue)
      {
        FeatureMap.Entry newEntry = FeatureMapUtil.createTextEntry(((TextComplexValue) value).getText());
        cv.getMixed().set(i, newEntry);
        textNodes_.put(newEntry, entry);
      }
    }
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:28,代码来源:SaturnDocLoadSaveUtil.java

示例4: textNodeToTextElement

import org.eclipse.emf.ecore.util.FeatureMap; //导入方法依赖的package包/类
private static void textNodeToTextElement(SaturnResourceImpl saturnResourceImpl_)
{
  DocumentRoot o = (DocumentRoot) saturnResourceImpl_.getContents().get(0);
  Saturn saturn = (Saturn) o.eContents().get(0);
  TreeIterator<EObject> ee = saturn.eAllContents();
  while (ee.hasNext())
  {
    EObject e = ee.next();
    if (e == null) continue;
    EClass ec = e.eClass();
    if (!ValuesPackage.eINSTANCE.getComplexValue().isSuperTypeOf(ec)) continue;

    ComplexValue cv = (ComplexValue) e;
    for (int i = 0; i < cv.getMixed().size(); i++)
    {
      FeatureMap.Entry entry = cv.getMixed().get(i);
      Object value = entry.getValue();
      if (value instanceof String)
      {
        TextComplexValue textComplexValue = ValuesPackage.eINSTANCE.getValuesFactory().createTextComplexValue();
        textComplexValue.setText((String) value);
        FeatureMap.Entry newEntry = FeatureMapUtil.createEntry(ValuesPackage.eINSTANCE.getComplexValue_Text(),
            textComplexValue);
        cv.getMixed().set(i, newEntry);
      }
    }
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:29,代码来源:SaturnDocLoadSaveUtil.java

示例5: objToStrImpl

import org.eclipse.emf.ecore.util.FeatureMap; //导入方法依赖的package包/类
private static void objToStrImpl(Object obj, String indent, Appendable buf) throws Exception {
	String innerIdent = INDENT + indent;
	if (obj instanceof EObject) {
		EObject eobj = (EObject) obj;
		buf.append(eobj.eClass().getName()).append(" {\n");
		for (EStructuralFeature f : getAllFeatures(eobj.eClass())) {
			if (!eobj.eIsSet(f))
				continue;
			buf.append(innerIdent);
			if (f instanceof EReference) {
				EReference r = (EReference) f;
				if (r.isContainment()) {
					buf.append("cref ");
					buf.append(f.getEType().getName()).append(SPACE);
					buf.append(f.getName()).append(SPACE);
					objToStrImpl(eobj.eGet(f), innerIdent, buf);
				} else {
					buf.append("ref ");
					buf.append(f.getEType().getName()).append(SPACE);
					buf.append(f.getName()).append(SPACE);
					refToStr(eobj, r, innerIdent, buf);
				}
			} else if (f instanceof EAttribute) {
				buf.append("attr ");
				buf.append(f.getEType().getName()).append(SPACE);
				buf.append(f.getName()).append(SPACE);
				// logger.debug(Msg.create("Path:").path(eobj));
				Object at = eobj.eGet(f);
				if (eobj != at)
					objToStrImpl(at, innerIdent, buf);
				else
					buf.append("<same as container object>");
			} else {
				buf.append("attr ");
				buf.append(f.getEType().getName()).append(SPACE);
				buf.append(f.getName()).append(" ??????");
			}
			buf.append('\n');
		}
		buf.append(indent).append("}");
		return;
	}
	if (obj instanceof FeatureMap.Entry) {
		FeatureMap.Entry e = (FeatureMap.Entry) obj;
		buf.append(e.getEStructuralFeature().getEContainingClass().getName());
		buf.append(".");
		buf.append(e.getEStructuralFeature().getName());
		buf.append("->");
		objToStrImpl(e.getValue(), innerIdent, buf);
		return;
	}
	if (obj instanceof Collection<?>) {
		int counter = 0;
		Collection<?> coll = (Collection<?>) obj;
		buf.append("[\n");
		for (Object o : coll) {
			buf.append(innerIdent);
			printInt(counter++, coll.size(), buf);
			buf.append(": ");
			objToStrImpl(o, innerIdent, buf);
			buf.append("\n");
		}
		buf.append(indent + "]");
		return;
	}
	if (obj != null) {
		buf.append("'").append(Strings.notNull(obj)).append("'");
		return;
	}
	buf.append("null");
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:72,代码来源:OrderedEmfFormatter.java


注:本文中的org.eclipse.emf.ecore.util.FeatureMap.Entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。