KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > dd > api > common > RootInterface


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.dd.api.common;
21
22 import org.netbeans.modules.schema2beans.BaseBean;
23 /**
24  * Interface representing the root of interfaces bean tree structure.
25  *
26  *<p><b><font color="red"><em>Important note: Do not provide an implementation of this interface unless you are a DD API provider!</em></font></b>
27  *</p>
28  *
29  * @author Milan Kuchtiak
30  */

31 public interface RootInterface extends ComponentInterface {
32     /**
33      * Used in {@link #merge} method.<br>
34      * The result of merge operation is the intersection of graphs.
35      */

36     public static final int MERGE_INTERSECT = BaseBean.MERGE_INTERSECT;
37     /**
38      * Used in {@link #merge} method.<br>
39      * The result of merge operation is the union of graphs.
40      */

41     public static final int MERGE_UNION = BaseBean.MERGE_UNION;
42     /**
43      * Used in {@link #merge} method.<br>
44      * The result of merge operation is the first graph updated with the changes in another graph.
45      */

46     public static final int MERGE_UPDATE = BaseBean.MERGE_UPDATE;
47     
48     /**
49      * Writes the deployment descriptor data from deployment descriptor bean graph to file object.<br>
50      * This is more convenient method than {@link org.netbeans.modules.j2ee.dd.api.common.CommonDDBean#write} method.<br>
51      * The locking problems are solved for the user in this method.
52      *
53      * @param fo File Object where to write the content of depl.descriptor holding in bean tree structure
54      */

55     public void write(org.openide.filesystems.FileObject fo) throws java.io.IOException JavaDoc ;
56     
57     /**
58      * Merging two bean tree structures together.<pre>
59      *
60      *There are several ways odf merging :
61      *
62      * Let's define:
63      * G1 the current graph and G2 the new graph we want to merge
64      * E1 the set of element of G1 that don't exist anymore in G2.
65      * E2 the set of new elements of G2 that don't exist in G1.
66      *
67      * Then,
68      * MERGE_UPDATE is G1 - E1 + E2 (G1 becomes G2)
69      * MERGE_UNION is G1 U G2 <=> G1 + E2
70      * MERGE_INTERSECT is G1 n G2 <=> (G1 U G2) - E1 - E2
71      *</pre>
72      * @param bean root of the bean graph that is merged with actual bean graph
73      * @param mode type of merging (INTERSECT, UNION, UPDATE)
74      */

75     public void merge(RootInterface root, int mode);
76 }
77
Popular Tags