KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > dbschema > DBMemberElement


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.dbschema;
21
22 import java.io.*;
23
24 /** Superclass for containable database metadata members
25  * (columns, indexes, and foreign keys). Provides support
26  * for associating this element with a declaring table.
27  */

28 public abstract class DBMemberElement extends DBElement implements Cloneable JavaDoc {
29     /** the table to which this element belongs */
30     private TableElement declaringTable;
31
32     /** Default constructor
33      */

34     protected DBMemberElement() {
35     }
36
37     /** Creates a member element.
38      * @param impl the pluggable implementation
39      * @param declaringTable the table to which this element belongs, or
40      * <code>null</code> if unattached
41      */

42     protected DBMemberElement(Impl impl, TableElement declaringTable) {
43         super(impl);
44         this.declaringTable = declaringTable;
45     }
46
47     /** Returns the implementation of the element.
48      * @return the current implementation.
49      */

50     final Impl getMemberImpl() {
51         return (Impl) getElementImpl();
52     }
53
54     /* This should be automatically synchronized
55     * when a DBMemberElement is added to the table. */

56     
57     /** Gets the declaring table.
58      * @return the table that owns this member element, or <code>null</code>
59      * if the element is not attached to any table
60      */

61     public TableElement getDeclaringTable() {
62         return declaringTable;
63     }
64
65     /** Sets the declaring table.
66      * @param te the table that owns this member element
67      */

68     public void setDeclaringTable(TableElement te) {
69         if (declaringTable == null)
70             declaringTable = te;
71     }
72
73     /** Pluggable implementation of member elements.
74      * @see DBMemberElement
75      */

76     public interface Impl extends DBElement.Impl {
77     }
78
79     /** Default implementation of the Impl interface.
80      * It just holds the property values.
81      */

82     static abstract class Memory extends DBElement.Memory implements DBMemberElement.Impl {
83         /** Default */
84         public Memory() {
85             super();
86         }
87
88         /** Copy */
89         public Memory(DBMemberElement el) {
90             super(el);
91         }
92     }
93 }
94
Popular Tags