blob: 508ff5cfdef62274de1d16859f9b23ede656a039 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/***************************************************************************
* Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
**************************************************************************/
package org.eclipse.emf.internal.cdo.analyzer;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.CDOFetchRule;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.model.CDOFeature;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* @author Simon McDuff
*/
public class CDOFeatureAnalyzerModelBased extends CDOAbstractFeatureRuleAnalyzer
{
CDOAnalyzerFeatureInfo featureInfos = new CDOAnalyzerFeatureInfo();
public CDOFeatureAnalyzerModelBased()
{
}
@Override
public void doPreTraverseFeature(CDOObject cdoObject, CDOFeature feature, int index)
{
}
@Override
public void doPostTraverseFeature(CDOObject cdoObject, CDOFeature feature, int index, Object value)
{
if (didFetch())
{
featureInfos.activate(cdoObject.cdoClass(), feature);
}
}
public CDOID getContext()
{
return CDOID.NULL;
}
public List<CDOFetchRule> getFetchRules(Collection<CDOID> ids)
{
fetchData();
List<CDOFetchRule> rules = new ArrayList<CDOFetchRule>();
rules.addAll(featureInfos.getRules(lastTraverseCDOObject.cdoClass(), lastTraverseFeature));
return rules;
}
}
|