KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > ExtensibilityElement


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.xml.wsdl.model;
21
22 import java.io.IOException JavaDoc;
23 import java.util.List JavaDoc;
24 import javax.xml.namespace.QName JavaDoc;
25 import org.netbeans.modules.xml.xam.Component;
26 import org.netbeans.modules.xml.xam.dom.DocumentModel;
27 import org.netbeans.modules.xml.xam.ComponentUpdater;
28
29 /**
30  * Interface for wsdl extensibility elements
31  *
32  * @author rico
33  * @author Nam Nguyen
34  */

35 public interface ExtensibilityElement extends WSDLComponent {
36     public static final String JavaDoc CONTENT_FRAGMENT_PROPERTY = "content";
37     
38     /**
39      * Set/get attribute value.
40      */

41     public String JavaDoc getAttribute(String JavaDoc attribute);
42     public void setAttribute(String JavaDoc attribute, String JavaDoc value);
43     
44     /**
45      * Set/get attribute defined in given namespace.
46      */

47     public String JavaDoc getAnyAttribute(QName JavaDoc attr);
48     public void setAnyAttribute(QName JavaDoc attr, String JavaDoc value);
49
50     /**
51      * Set/get content as XML fragment.
52      * The XML fragment will be parsed and the resulting nodes will
53      * replace the current children of this documentation element.
54      * @param text XML fragment text.
55      * @exception IOException if the fragment text is not well-form.
56      */

57     public String JavaDoc getContentFragment();
58     public void setContentFragment(String JavaDoc fragment) throws IOException JavaDoc;
59
60     /**
61      * Adds child extensibility elements of unknown type.
62      * @param anyElement any child component to add
63      * @param index absolute index position in children list.
64      */

65     public void addAnyElement(ExtensibilityElement anyElement, int index);
66     
67     /**
68      * Removes child extensibility element of unknown type.
69      */

70     public void removeAnyElement(ExtensibilityElement any);
71     
72     /**
73      * @returns list of children extensibility elements of unknown type.
74      */

75     public List JavaDoc<ExtensibilityElement> getAnyElements();
76     
77     /**
78      * Returns QName of the backing DOM element.
79      */

80     public QName JavaDoc getQName();
81     
82     /**
83      * Interface for an extensibility element that could provide update visitor
84      * to be used during sync from source.
85      */

86     interface UpdaterProvider extends ExtensibilityElement {
87         /**
88          * @return component updater to be used in merge operations when source sync happens.
89          */

90         <T extends ExtensibilityElement> ComponentUpdater<T> getComponentUpdater();
91     }
92     
93     /**
94      * Interface for an extensibility element that is a root of an embedded model.
95      */

96     interface EmbeddedModel extends ExtensibilityElement {
97         DocumentModel getEmbeddedModel();
98     }
99
100     /**
101      * An extensibility element with ability to select parent to be added to.
102      */

103     interface ParentSelector extends ExtensibilityElement {
104         boolean canBeAddedTo(Component target);
105     }
106 }
107
Popular Tags