Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EClassifier


  protected EClassifier computeEClassifier(XSDTypeDefinition xsdTypeDefinition) {
    if (xsdTypeDefinition == null) return super.computeEClassifier(xsdTypeDefinition);
    EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(xsdTypeDefinition.getTargetNamespace());
    if (ePackage != null && TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
      EClassifier eclassifier = ePackage.getEClassifier(xsdTypeDefinition.getName());
      if (eclassifier != null) return eclassifier;
    }
    EClassifier eclassifier = super.computeEClassifier(xsdTypeDefinition);
    EClassifier etype = (EClassifier) typeToTypeObjectMap.get(eclassifier);
    String aliasNames = getEcoreAttribute(xsdTypeDefinition.getElement(), "aliasName");
    if (aliasNames != null) {
      SDOExtendedMetaData.INSTANCE.setAliasNames(eclassifier, aliasNames);
      if (etype != null) {
        SDOExtendedMetaData.INSTANCE.setAliasNames(etype, aliasNames);
View Full Code Here


  protected EDataType computeEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
    if (xsdSimpleTypeDefinition == null) return super.computeEDataType(xsdSimpleTypeDefinition);
    EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(xsdSimpleTypeDefinition.getTargetNamespace());
    if (ePackage != null && TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
      EClassifier eclassifier = ePackage.getEClassifier(xsdSimpleTypeDefinition.getName());
      if (eclassifier != null) return (EDataType)eclassifier;
    }
    EDataType eDataType = super.computeEDataType(xsdSimpleTypeDefinition);
    if (replaceConflictingTypes) removeDuplicateEClassifier(eDataType, xsdSimpleTypeDefinition);
    String aliasNames = getEcoreAttribute(xsdSimpleTypeDefinition.getElement(), "aliasName");
View Full Code Here

      {
        XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();
        if (xsdTerm instanceof XSDElementDeclaration)
        {
          XSDTypeDefinition elementTypeDefinition = getEffectiveTypeDefinition(xsdComponent, (XSDElementDeclaration)xsdTerm);
          EClassifier eClassifier = getEClassifier(elementTypeDefinition);
          if (elementTypeDefinition instanceof XSDSimpleTypeDefinition && eClassifier instanceof EClass)
          {
            eReference.setContainment(true);
          }
        }
View Full Code Here

  }
 
  public EClassifier demandType(String namespace, String name)
  {
    EPackage ePackage = demandPackage(namespace);
    EClassifier eClassifier = getType(ePackage, name);
    if (eClassifier != null)
    {
      return eClassifier;
    }
    else
View Full Code Here

    public Type getType(String uri, String typeName) {
        EPackage ePackage = extendedMetaData.getPackage(uri);

        if (ePackage != null) {
            EClassifier eClassifier = ePackage.getEClassifier(typeName);
            if (eClassifier == null) {
                eClassifier = extendedMetaData.getType(ePackage, typeName);
            }
            return (Type)eClassifier;
        }
View Full Code Here

    protected Type getDefinedType(org.apache.tuscany.sdo.model.Type modeledType) {
        if (modeledType instanceof Type) {
            return (Type)modeledType;
        } else {
            EClassifier eClassifier = extendedMetaData.getType(modeledType.getUri(), modeledType.getName());
            if (eClassifier != null) {
                return (Type)eClassifier;
            } else {
                return define((DataObject)modeledType);
            }
View Full Code Here

            }

            protected void handleUnknownFeature(String prefix, String name, boolean isElement, EObject peekObject, String value) {
                if (objects.size() == 1) {
                    EFactory eFactory;
                    EClassifier type;
                    String typeQName = getXSIType();
                    if (typeQName == null) {
                        type = defaultRootType(prefix, name, isElement, peekObject, value);
                        if (type == null)
                            return;
                        eFactory = type.getEPackage().getEFactoryInstance();
                    } else {// createObjectFromTypeName
                        String typeName = null;
                        String xsiPrefix = XMLConstants.DEFAULT_NS_PREFIX;
                        int index = typeQName.indexOf(":");
                        if (index > 0) {
                            xsiPrefix = typeQName.substring(0, index);
                            typeName = typeQName.substring(index + 1);
                        } else
                            typeName = typeQName;
                        eFactory = getFactoryForPrefix(xsiPrefix);
                        if (eFactory != null)
                            type = helper.getType(eFactory, typeName);
                        else if (XMLConstants.DEFAULT_NS_PREFIX.equals(xsiPrefix) && helper.getURI(xsiPrefix) == null) {
                            EPackage ePackage = handleMissingPackage(null);
                            if (ePackage == null) {
                                type = defaultRootType(prefix, name, isElement, peekObject, value);
                                if (type == null)
                                    return;
                                eFactory = type.getEPackage().getEFactoryInstance();
                            } else
                                type = helper.getType(eFactory = ePackage.getEFactoryInstance(), typeName);
                        } else {
                            type = defaultRootType(prefix, name, isElement, peekObject, value);
                            if (type == null)
                                return;
                            eFactory = type.getEPackage().getEFactoryInstance();
                        }
                    }
                    root = helper.createObject(eFactory, type);
                    if (root != null) {
                        if (disableNotify)
View Full Code Here

      String name               = eFeature.getName();
      String classname          = "";
      boolean anonymous         = false;
      List propertyClassNames   = null;
         
      EClassifier eClassifier = eFeature.getEType();
     
      if( eClassifier instanceof EClass )
      {
        // complex type
        EClass eClass = (EClass)eClassifier;
        GenClass genEClass = (GenClass)eclassGenClassMap.get(eClassifier);
        if( genEClass != null )
        {   
          classname = genEClass.getGenPackage().getInterfacePackageName()
                 + '.' + genEClass.getInterfaceName();
          anonymous = extendedMetaData.isAnonymous(eClass);
                       
          // Build list of property names
          propertyClassNames = new ArrayList();
          List properties = eClass.getEStructuralFeatures();
          for (Iterator iterProperties = properties.iterator(); iterProperties.hasNext();)
          {
            EStructuralFeature property = (EStructuralFeature)iterProperties.next();
            EClassifier propertyType = property.getEType();
            if (propertyType instanceof EClass)
            {
              GenClass propertyGenClass = (GenClass)eclassGenClassMap.get(propertyType);
              if( propertyGenClass != null )
              {   
                String propertyClassName =  propertyGenClass.getGenPackage().getInterfacePackageName() + '.'
                                            + propertyGenClass.getInterfaceName();
                propertyClassNames.add(propertyClassName);
              }       
            }
            else if (propertyType instanceof EClassifier)
            {
              String propertyClassName = propertyType.getInstanceClass().getName();
              propertyClassNames.add(propertyClassName);
            }
          }
        }
      }
View Full Code Here

    {
      Type csType = ((ModelFactoryImpl)ModelFactory.INSTANCE).getChangeSummaryType();
      for (Iterator i = genClass.getGenFeatures().iterator(); i.hasNext(); )
      {
        GenFeature genFeature = (GenFeature)i.next();
        EClassifier eClassifier = genFeature.getEcoreFeature().getEType();
        if (eClassifier instanceof Type)
        {
          Type type = (Type)eClassifier;
          //if (csType == type)// this doesn't work when generating sdoModel.xsd
          if (csType.getName().equals(type.getName()) && csType.getURI().equals(type.getURI()))
View Full Code Here

      String result = "null";
      boolean defaultFound = false;
 
      String defaultString = genFeature.getEcoreFeature()
          .getDefaultValueLiteral();
      EClassifier eType = genFeature.getEcoreFeature().getEType();
      if (eType instanceof EDataType) {
        GenPackage genPackage = ((GenFeatureImpl) genFeature)
            .findGenPackage(genFeature.getEcoreFeature().getEType().getEPackage());
        GenDataType gdt = null;
        if (genPackage != null) {
          for (Iterator iter = genPackage.getGenDataTypes().iterator(); iter
              .hasNext()
              && gdt == null;) {
            GenDataType genDataType = (GenDataType) iter.next();
            if (eType.getName().equals(genDataType.getEcoreDataType().getName())) {
              gdt = genDataType;
            }
          }
        }
        EClassifier eDataType = gdt.getEcoreDataType();
        if (eDataType.getEPackage() != EcorePackage.eINSTANCE
            && defaultString != null) {
          boolean replaced = false;
          for (Iterator i = EcorePackage.eINSTANCE.getEClassifiers().iterator(); i
              .hasNext();) {
            EClassifier eClassifier = (EClassifier) i.next();
            if (eClassifier instanceof EDataType
                && eClassifier.getInstanceClassName().equals(
                    eDataType.getInstanceClassName())
                && ((EDataType) eClassifier).isSerializable()
                && eClassifier != EcorePackage.eINSTANCE.getEDate()) {
              replaced = true;
              eDataType = eClassifier;
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EClassifier

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.