KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > Snippet


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
21 package org.netbeans.modules.j2ee.sun.share.configbean;
22
23 import org.netbeans.modules.j2ee.sun.dd.api.CommonDDBean;
24
25
26 /** This class represents holds the segments of deployment descriptor files that
27  * a DConfigBean represents to the user.
28  * @author vkraemer
29  */

30 interface Snippet {
31     
32     /** Creates a fragment of a schema2beans graph for the DConfigBean this
33      * snippet is associated with. Returns the bean representing this fragment
34      *
35      * This method is called by Base.addToGraphs().
36      * @return The element bean for the deployment descriptor branch.
37      */

38     public CommonDDBean getDDSnippet();
39     
40     public org.netbeans.modules.schema2beans.BaseBean getCmpDDSnippet();
41     
42     /** Returns true if getDDSnippet will construct and return a basebean
43      * with data in it to be saved. (Some DConfigBeans might not require
44      * saving. Those will have this method return false).
45      *
46      * @return true if getDDSnippet() will return a non-null bean, false otherwise
47      */

48     public boolean hasDDSnippet();
49
50     /** Return the name of the file that this snippet belongs in.
51      *
52      * This method is called by Base.addToGraphs().
53      * @return the name of a s1as specific deployment descriptor file.
54      */

55     public String JavaDoc getFileName();
56     
57     /** Merge this snippet into a schema2beans object. See also getPropertyName()
58      * which allows some adjustment to the default implementation of this algorithm
59      *
60      * @param parentDD This schema2beans object will be the immediate parent in
61      * the graph of the snippet created by this object.
62      * @return the schema2beans object representing the snippet created by this
63      * object.
64      */

65     public CommonDDBean mergeIntoRovingDD(CommonDDBean parentDD);
66     
67     
68     /** Merge this snippet into a schema2beans object.
69      *
70      * @param rootDD This schema2beans object is the root of the beangraph
71      * that this snippet needs to be merged into.
72      * @return the schema2beans object representing the snippet created by this
73      * object.
74      */

75     public CommonDDBean mergeIntoRootDD(CommonDDBean rootDD);
76     
77     /** This method is provided to allow some customization to the merge algorithms
78      * above.
79      *
80      * @return the schema2beans property name corresponding to the schema2beans
81      * object created that represents this snippet. E.g. the property name
82      * of an Ejb snippet would be EnterpriseBeans.EJB.
83      */

84     public String JavaDoc getPropertyName();
85     
86 }
87
Popular Tags