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


Java ExtendedMetaData类代码示例

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


ExtendedMetaData类属于org.eclipse.emf.ecore.util包,在下文中一共展示了ExtendedMetaData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInitialObjectNames

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Returns the names of the features representing global elements.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames ()
{
    if ( initialObjectNames == null )
    {
        initialObjectNames = new ArrayList<String> ();
        for ( EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements ( ExtendedMetaData.INSTANCE.getDocumentRoot ( configurationPackage ) ) )
        {
            if ( eStructuralFeature.isChangeable () )
            {
                EClassifier eClassifier = eStructuralFeature.getEType ();
                if ( eClassifier instanceof EClass )
                {
                    EClass eClass = (EClass)eClassifier;
                    if ( !eClass.isAbstract () )
                    {
                        initialObjectNames.add ( eStructuralFeature.getName () );
                    }
                }
            }
        }
        Collections.sort ( initialObjectNames, CommonPlugin.INSTANCE.getComparator () );
    }
    return initialObjectNames;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:ConfigurationModelWizard.java

示例2: getInitialObjectNames

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Returns the names of the features representing global elements.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames() {
	if (initialObjectNames == null) {
		initialObjectNames = new ArrayList<String>();
		for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(beansPackage))) {
			if (eStructuralFeature.isChangeable()) {
				EClassifier eClassifier = eStructuralFeature.getEType();
				if (eClassifier instanceof EClass) {
					EClass eClass = (EClass)eClassifier;
					if (!eClass.isAbstract()) {
						initialObjectNames.add(eStructuralFeature.getName());
					}
				}
			}
		}
		Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
	}
	return initialObjectNames;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:25,代码来源:BeansModelWizard.java

示例3: lazyMetamodelRegistration

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
private String lazyMetamodelRegistration(String metamodelPath){
	
	Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
  	
    ResourceSet rs = new ResourceSetImpl();
    // Enables extended meta-data, weird we have to do this but well...
    final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(EPackage.Registry.INSTANCE);
    rs.getLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);

    Resource r = rs.getResource(URI.createFileURI(metamodelPath), true);
    EObject eObject = r.getContents().get(0);
    // A meta-model might have multiple packages we assume the main package is the first one listed
    if (eObject instanceof EPackage) {
        EPackage p = (EPackage)eObject;
        System.out.println(p.getNsURI());
        EPackage.Registry.INSTANCE.put(p.getNsURI(), p);
        return p.getNsURI();
    }
    return null;
}
 
开发者ID:guana,项目名称:ATLauncher,代码行数:21,代码来源:ATLLauncher.java

示例4: getInitialObjectNames

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Returns the names of the features representing global elements.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames() {
	if (initialObjectNames == null) {
		initialObjectNames = new ArrayList<String>();
		for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE
				.getAllElements(ExtendedMetaData.INSTANCE
						.getDocumentRoot(bpmn2Package))) {
			if (eStructuralFeature.isChangeable()) {
				EClassifier eClassifier = eStructuralFeature.getEType();
				if (eClassifier instanceof EClass) {
					EClass eClass = (EClass) eClassifier;
					if (!eClass.isAbstract()) {
						initialObjectNames
								.add(eStructuralFeature.getName());
					}
				}
			}
		}
		Collections.sort(initialObjectNames,
				CommonPlugin.INSTANCE.getComparator());
	}
	return initialObjectNames;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:29,代码来源:Bpmn2ModelWizard.java

示例5: hasChoiceOfValues

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * This is a much faster method for simply testing to see if something has a choice of values.
 * It is implemented based on getChoiceOfValues from ItemPropertyDescriptor.
 * 
 * @param pd
 * @param object
 * @return
 */
public static boolean hasChoiceOfValues(IItemPropertyDescriptor pd, Object object) {
	if (object instanceof EObject) {
		Object feature = pd.getFeature(object);
		if (feature instanceof EReference[]) {
			return true;
		} 
		if (feature instanceof EReference) {
			return true;
		} 
		if (feature instanceof EAttribute) {
			EAttribute attribute = (EAttribute) feature;
			if (attribute.getEType() instanceof EEnum) {
				return true;
			}
			EDataType eDataType = attribute.getEAttributeType();
			List<String> enumeration = ExtendedMetaData.INSTANCE.getEnumerationFacet(eDataType);
			if (!enumeration.isEmpty()) {
				return true;
			}
		}
	}
	// must fall back on property descriptor
	Collection<?> values = getChoiceOfValues(pd, object);
	return (values != null && !values.isEmpty());
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:34,代码来源:EMFUtils.java

示例6: registerEPackageFromEcore

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Registers a EPackage in {@link Registry} according to its {@code prefix} and {@code uri}, from an Ecore file.
 * <p>
 * The targeted Ecore file must be present in {@code /resources/ecore}.
 */
protected static void registerEPackageFromEcore(String prefix, String uri) {
    File file = getResourceFile(ECORE_PATH.replaceAll("\\{name\\}", prefix));

    EPackage ePackage = null;

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(ECORE, new EcoreResourceFactoryImpl());

    ResourceSet rs = new ResourceSetImpl();

    final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(rs.getPackageRegistry());
    rs.getLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);

    Resource r = rs.getResource(URI.createFileURI(file.toString()), true);
    EObject eObject = r.getContents().get(0);
    if (eObject instanceof EPackage) {
        ePackage = (EPackage) eObject;
        rs.getPackageRegistry().put(ePackage.getNsURI(), ePackage);
    }

    assertThat(ePackage).isNotNull(); // "EPackage does not exist"

    Registry.INSTANCE.put(uri, ePackage);
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:29,代码来源:AbstractInputTest.java

示例7: getInitialObjectNames

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Returns the names of the features representing global elements.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames() {
	if (initialObjectNames == null) {
		initialObjectNames = new ArrayList<String>();
		for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(dbchangelogPackage))) {
			if (eStructuralFeature.isChangeable()) {
				EClassifier eClassifier = eStructuralFeature.getEType();
				if (eClassifier instanceof EClass) {
					EClass eClass = (EClass)eClassifier;
					if (!eClass.isAbstract()) {
						initialObjectNames.add(eStructuralFeature.getName());
					}
				}
			}
		}
		Collections.sort(initialObjectNames, java.text.Collator.getInstance());
	}
	return initialObjectNames;
}
 
开发者ID:dzonekl,项目名称:LiquibaseEditor,代码行数:25,代码来源:DbchangelogModelWizard.java

示例8: getValueLabel

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
protected void reportXMLGregorianCalendarViolation
  (EDataType eDataType, XMLGregorianCalendar value, DiagnosticChain diagnostics, Map<Object, Object> context)
{
  createDiagnostic
    (Diagnostic.ERROR,
     DIAGNOSTIC_SOURCE,
     WELL_FORMED_XML_GREGORIAN_CALENDAR,
     "_UI_BadXMLGregorianCalendar_diagnostic",
     new Object []
     {
       getValueLabel(eDataType, value, context),
       ExtendedMetaData.INSTANCE.getName(eDataType)
     },
     new Object [] { value },
     context);
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:17,代码来源:XMLTypeValidator.java

示例9: fixEStructuralFeatures

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
protected void fixEStructuralFeatures(EClass eClass)
{
  List<EStructuralFeature> features = eClass.getEStructuralFeatures();
  if (!features.isEmpty())
  {
    // The container class must be null for the open content features of the document root
    // to ensure that they are looked up in the actual eClass() 
    // rather than assumed to be a feature with a feature ID relative to the actual class.
    // Otherwise, it's good to have this optimization.
    //
    Class<?> containerClass = ExtendedMetaData.INSTANCE.getDocumentRoot(this) == eClass ? null : eClass.getInstanceClass();

    int id = eClass.getFeatureID(features.get(0));
    
    for (Iterator<EStructuralFeature> i = features.iterator(); i.hasNext(); )
    {
      EStructuralFeatureImpl eStructuralFeature = (EStructuralFeatureImpl)i.next();
      eStructuralFeature.setFeatureID(id++);
      eStructuralFeature.setContainerClass(containerClass);
    }
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:23,代码来源:EPackageImpl.java

示例10: eOpenGet

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
public Object eOpenGet(EStructuralFeature eFeature, boolean resolve)
{
  EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
  if (openFeature != null)
  {
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    {
      openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    }
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    return ((FeatureMap.Internal)featureMap).get(eFeature, resolve);
  }
  else
  {
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid feature");
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:18,代码来源:BasicEObjectImpl.java

示例11: eOpenSet

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
public void eOpenSet(EStructuralFeature eFeature, Object newValue) 
{
  EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
  if (openFeature != null)
  {
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    {
      openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    }
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    ((FeatureMap.Internal)featureMap).set(eFeature, newValue);
  }
  else
  {
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:18,代码来源:BasicEObjectImpl.java

示例12: eOpenUnset

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
public void eOpenUnset(EStructuralFeature eFeature) 
{
  EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
  if (openFeature != null)
  {
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    {
      openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    }
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    ((FeatureMap.Internal)featureMap).unset(eFeature);
  }
  else
  {
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:18,代码来源:BasicEObjectImpl.java

示例13: eOpenIsSet

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
public boolean eOpenIsSet(EStructuralFeature eFeature) 
{
  EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
  if (openFeature != null)
  {
    if (!FeatureMapUtil.isFeatureMap(openFeature))
    {
      openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
    }
    FeatureMap featureMap = (FeatureMap)eGet(openFeature);
    return ((FeatureMap.Internal)featureMap).isSet(eFeature);
  }
  else
  {
    throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid feature");
  }
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:18,代码来源:BasicEObjectImpl.java

示例14: getFeatureMapEntryPrototype

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
public FeatureMap.Entry.Internal getFeatureMapEntryPrototype()
{
  if (prototypeFeatureMapEntry == null)
  {
    EReference eOpposite = getEOpposite();
    if (eOpposite != null)
    {
      prototypeFeatureMapEntry = new InverseUpdatingFeatureMapEntry(this, null);
    }
    else if (isContainment())
    {
      // create containment one.
      prototypeFeatureMapEntry = new ContainmentUpdatingFeatureMapEntry(this, null);
    }
    else if (ExtendedMetaData.INSTANCE.getFeatureKind(this) == ExtendedMetaData.SIMPLE_FEATURE)
    {
      prototypeFeatureMapEntry = new SimpleContentFeatureMapEntry(this);
    }
    else
    {
      prototypeFeatureMapEntry = new SimpleFeatureMapEntry(this, null);
    }
  }
  return prototypeFeatureMapEntry;
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:26,代码来源:EStructuralFeatureImpl.java

示例15: getInitialObjectNames

import org.eclipse.emf.ecore.util.ExtendedMetaData; //导入依赖的package包/类
/**
 * Returns the names of the features representing global elements.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<String> getInitialObjectNames() {
	if (initialObjectNames == null) {
		initialObjectNames = new ArrayList<String>();
		for (EStructuralFeature eStructuralFeature : ExtendedMetaData.INSTANCE.getAllElements(ExtendedMetaData.INSTANCE.getDocumentRoot(xalPackage))) {
			if (eStructuralFeature.isChangeable()) {
				EClassifier eClassifier = eStructuralFeature.getEType();
				if (eClassifier instanceof EClass) {
					EClass eClass = (EClass)eClassifier;
					if (!eClass.isAbstract()) {
						initialObjectNames.add(eStructuralFeature.getName());
					}
				}
			}
		}
		Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
	}
	return initialObjectNames;
}
 
开发者ID:markus1978,项目名称:citygml4emf,代码行数:25,代码来源:XALModelWizard.java


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