KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > axi > AnyElement


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.axi;
20
21 import org.netbeans.modules.xml.axi.visitor.AXIVisitor;
22 import org.netbeans.modules.xml.schema.model.SchemaComponent;
23 import org.netbeans.modules.xml.schema.model.Any.ProcessContents;
24
25 /**
26  * Represents 'any' element in XML Schema.
27  *
28  * @author Samaresh (Samaresh.Panda@Sun.Com)
29  */

30 public class AnyElement extends AbstractElement {
31     
32     /**
33      * Creates a new instance of Element
34      */

35     public AnyElement(AXIModel model) {
36         super(model);
37     }
38     
39     /**
40      * Creates a new instance of Element
41      */

42     public AnyElement(AXIModel model, SchemaComponent schemaComponent) {
43         super(model, schemaComponent);
44     }
45     
46     /**
47      * Creates a proxy for this AXIComponent.
48      */

49     public AnyElement(AXIModel model, AXIComponent sharedComponent) {
50         super(model, sharedComponent);
51     }
52     
53     /**
54      * Allows a visitor to visit this Element.
55      */

56     public void accept(AXIVisitor visitor) {
57         visitor.visit(this);
58     }
59     
60     /**
61      * Returns the name.
62      */

63     public String JavaDoc getName() {
64         return "any"; //NOI18N
65
}
66     
67     /**
68      * Returns the processContents.
69      */

70     public ProcessContents getProcessContents() {
71         return processContents;
72     }
73     
74     /**
75      * Sets the processContents.
76      */

77     public void setProcessContents(ProcessContents value) {
78         ProcessContents oldValue = getProcessContents();
79         if( (oldValue == null && value == null) ||
80             (oldValue != null && oldValue == value) ) {
81             return;
82         }
83         this.processContents = value;
84         firePropertyChangeEvent(PROP_PROCESSCONTENTS, oldValue, value);
85     }
86     
87     /**
88      * Returns the target namespace.
89      */

90     public String JavaDoc getTargetNamespace() {
91         return namespace;
92     }
93
94     /**
95      * Sets the target namespace.
96      */

97     public void setTargetNamespace(String JavaDoc value) {
98         String JavaDoc oldValue = getTargetNamespace();
99         if( (oldValue == null && value == null) ||
100                 (oldValue != null && oldValue.equals(value)) ) {
101             return;
102         }
103         this.namespace = value;
104         firePropertyChangeEvent(PROP_NAMESPACE, oldValue, value);
105     }
106     
107     /**
108      * String representation of this Element.
109      */

110     public String JavaDoc toString() {
111         return getName();
112     }
113     
114     ////////////////////////////////////////////////////////////////////
115
////////////////////////// member variables ////////////////////////
116
////////////////////////////////////////////////////////////////////
117
private String JavaDoc namespace;
118     private ProcessContents processContents;
119     
120     ////////////////////////////////////////////////////////////////////
121
////////////////// Properties for firing events ////////////////////
122
////////////////////////////////////////////////////////////////////
123
public static final String JavaDoc PROP_NAMESPACE = "namespace"; // NOI18N
124
public static final String JavaDoc PROP_PROCESSCONTENTS = "processContents"; // NOI18N
125
}
126
Popular Tags