Skip to main content
summaryrefslogtreecommitdiffstats
blob: d579a630d636ea4f3d0a98b80ad0c84a4d462957 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
 * Copyright (c) 2007 Oracle Corporation.
 * 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:
 *    Oracle - initial API and implementation
 *    
 ********************************************************************************/
package org.eclipse.jst.jsf.common.metadata.internal;

import org.eclipse.jst.jsf.common.metadata.Entity;
import org.eclipse.jst.jsf.common.metadata.EntityGroup;
import org.eclipse.jst.jsf.common.metadata.Trait;


/**
 * Helper class interface to merge source models into a single merged model.
 * Not intended to be implemented by clients
 *
 */
public interface IMetaDataModelMergeAssistant {
	/**
	 * @return merged model
	 */
	public MetaDataModel getMergedModel();
	/**
	 * Method that will first check to see if an entity with the same id exists in the merged model. 
	 * If not, it will add it.   The entities includeGroups are then also merged.
	 * @param entity
	 * @return flag indicating whether or not the entity was new and therefore added to the merged model
	 *  
	 */
	public boolean addEntity(Entity entity);
	/**
	 * Method will add an entity if not already existing in the merged model, and then check for an existing trait by id on the merged model's entity.
	 * @param entity
	 * @param trait
	 * @return flag indicating whether or not the traits was new and therefore added to the merged model's entity
	 */
	public boolean addTrait(Entity entity, Trait trait);
	
	/**
	 * Method will add an entityGroup to the model if not already exiting in the merged model (by id).
	 * @param entityGroup
	 */
	public void addEntityGroup(EntityGroup entityGroup);
	/**
	 * Signal that the merge is complete so that any post-processing may occur.  
	 * This should be the last call made on the merge assistant and should be done before client calls for the merged model result.
	 * This should signal that entityGroups processing should begin.
	 */
	public void setMergeComplete();

	/**
	 * @param mds - {@link IMetaDataSourceModelProvider}
	 */
	public void setSourceModelProvider(IMetaDataSourceModelProvider mds);
	/**
	 * @return {@link IMetaDataSourceModelProvider} for current operation
	 */
	public IMetaDataSourceModelProvider getSourceModelProvider();

	/**
	 * @param queryRoot
	 * @param entityKey - key relative to queryRoot
	 * @return entity - will return null if not found
	 */
	public Entity getMergedEntity(Entity queryRoot, String entityKey);
	
}

Back to the top