Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to find all uses of an EDataType/eClassifier
How to find all uses of an EDataType/eClassifier [message #901728] Tue, 14 August 2012 11:05 Go to next message
Rob Mising name is currently offline Rob Mising nameFriend
Messages: 118
Registered: July 2010
Senior Member
I've search around and haven't found any comments on this, so appologies if I am missing something and have asked a repeat question.

I have the case where I have an ecore with the following:

    <eClassifiers xsi:type="ecore:EDataType" name="AddressType" instanceClassName="java.lang.String">
      <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
        <details key="name" value="address_._type"/>
        <details key="baseType" value="http://www.eclipse.org/emf/2003/XMLType#string"/>
        <details key="maxLength" value="50"/>
      </eAnnotations>
    </eClassifiers>


This is used within the ePackage some-where.

What is the best/easiest way given:

1. An eClassifier/EDataType
2. An ePackage

To find all occurances/uses of the given eClassifier in the ePackage.

i.e.

      <eStructuralFeatures xsi:type="ecore:EAttribute" name="address" eType="/0/AddressType">
        <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
          <details key="kind" value="element"/>
          <details key="name" value="address"/>
        </eAnnotations>
      </eStructuralFeatures>


Any help or suggested code snippets would be greatly appreciated!

Thanks,
Rob
Re: How to find all uses of an EDataType/eClassifier [message #901734 is a reply to message #901728] Tue, 14 August 2012 12:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Rob,

EcoreUtil.UsageCrossReferencer.find(eClassifier, ePackage) should do the
trick.


On 14/08/2012 1:05 PM, Rob Mising name wrote:
> I've search around and haven't found any comments on this, so
> appologies if I am missing something and have asked a repeat question.
>
> I have the case where I have an ecore with the following:
>
>
> <eClassifiers xsi:type="ecore:EDataType" name="AddressType"
> instanceClassName="java.lang.String">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="address_._type"/>
> <details key="baseType"
> value="http://www.eclipse.org/emf/2003/XMLType#string"/>
> <details key="maxLength" value="50"/>
> </eAnnotations>
> </eClassifiers>
>
>
> This is used within the ePackage some-where.
>
> What is the best/easiest way given:
>
> 1. An eClassifier/EDataType
> 2. An ePackage
>
> To find all occurances/uses of the given eClassifier in the ePackage.
>
> i.e.
>
>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="address"
> eType="/0/AddressType">
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="address"/>
> </eAnnotations>
> </eStructuralFeatures>
>
>
> Any help or suggested code snippets would be greatly appreciated!
>
> Thanks,
> Rob
>
Re: How to find all uses of an EDataType/eClassifier [message #902166 is a reply to message #901734] Thu, 16 August 2012 08:22 Go to previous message
Rob Mising name is currently offline Rob Mising nameFriend
Messages: 118
Registered: July 2010
Senior Member
Thanks Ed - that was just what I was after!
Previous Topic:[EMF-Databinding] TableViewer databinding to add, remove and changes values from a list
Next Topic:problem converting uml file to ecore and genmodel file
Goto Forum:
  


Current Time: Sun Dec 21 06:53:08 GMT 2014

Powered by FUDForum. Page generated in 0.02976 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software