public interface IProxyData
IndexContext
when
the PROVIDE_INDEXED_DATA_FOR_PROXIES_AND_PARENTS
option is set
during queries. This interface is used by clients who are interested in
getting attribute and reference information on returned proxies and their
parents. This interface should not be implemented by clients.
Usage:
Find referenced eObjects from closed resources: //create an index context: IndexContext context = IndexContext.createDefaultContext(new ResourceSetImpl()); context.getOptions().put(IndexContext.SEARCH_UNLOADED_RESOURCES, Boolean.TRUE); context.getOptions().put(IndexContext.RESOLVE_PROXIES, Boolean.FALSE); context.getOptions().put(IndexContext.PROVIDE_INDEXED_DATA_FOR_PROXIES_AND_PARENTS, Boolean.TRUE); BookOnTape b1 = getBookOnTape(); // The EObject try { Collection objects = IIndexSearchManager.INSTANCE.findReferencedEObjects(context, b1, EXTLibraryPackage.eINSTANCE.getBookOnTape_Author(), EXTLibraryPackage.eINSTANCE.getWriter(), monitor); // get the names of the writers Iterator iter = objects.iterator(); while ( iter.hasNext() ) { URI uri = EcoreUtil.getURI((EObject)iter.next()); String writerName = (String) context.getProxyData().getValue(uri, EXTLibraryPackage.eINSTANCE.getWriter_Name()); } } catch (IndexException ) { // Handle the exception }
Modifier and Type | Method and Description |
---|---|
org.eclipse.emf.common.util.URI |
getContainer(org.eclipse.emf.common.util.URI proxyURI)
Return the container uri for the specified uri or
null |
org.eclipse.emf.ecore.EClass |
getEClass(org.eclipse.emf.common.util.URI proxyURI)
Return the EClass for the specified uri or
null |
java.lang.Object |
getValue(org.eclipse.emf.common.util.URI proxyURI,
org.eclipse.emf.ecore.EAttribute eAttribute)
This method returns the value for the specified attribute feature
|
java.lang.Object |
getValue(org.eclipse.emf.common.util.URI proxyURI,
org.eclipse.emf.ecore.EReference eReference)
This method returns the value for the specified reference feature
|
org.eclipse.emf.ecore.EClass getEClass(org.eclipse.emf.common.util.URI proxyURI)
null
proxyURI
- the uri of the proxyorg.eclipse.emf.common.util.URI getContainer(org.eclipse.emf.common.util.URI proxyURI)
null
proxyURI
- the uri of the proxyjava.lang.Object getValue(org.eclipse.emf.common.util.URI proxyURI, org.eclipse.emf.ecore.EAttribute eAttribute)
proxyURI
- the uri of the proxyeAttribute
- the attribute featurejava.lang.Object getValue(org.eclipse.emf.common.util.URI proxyURI, org.eclipse.emf.ecore.EReference eReference)
proxyURI
- the uri of the proxyeReference
- the reference feature