KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xslt > model > Stylesheet


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
20 package org.netbeans.modules.xslt.model;
21
22 import java.math.BigDecimal JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.List JavaDoc;
25
26 import org.netbeans.modules.xslt.model.enums.Annotaions;
27 import org.netbeans.modules.xslt.model.enums.DefaultValidation;
28
29
30 /**
31  * <pre>
32  * &lt;xs:element name="stylesheet" substitutionGroup="xsl:transform"/>
33  *
34  * &lt;xs:element name="transform">
35  * &lt;xs:complexType>
36  * &lt;xs:complexContent>
37  * &lt;xs:extension base="xsl:transform-element-base-type">
38  * &lt;xs:sequence>
39  * &lt;xs:element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/>
40  * &lt;xs:choice minOccurs="0" maxOccurs="unbounded">
41  * &lt;xs:element ref="xsl:declaration"/>
42  * &lt;xs:element ref="xsl:variable"/>
43  * &lt;xs:element ref="xsl:param"/>
44  * &lt;xs:any namespace="##other" processContents="lax"/>
45  * &lt;/xs:choice>
46  * &lt;/xs:sequence>
47  * &lt;xs:attribute name="id" type="xs:ID"/>
48  * &lt;xs:attribute name="default-validation" type="xsl:validation-strip-or-preserve" default="strip"/>
49  * &lt;xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type" default="unspecified"/>
50  * &lt;/xs:extension>
51  * &lt;/xs:complexContent>
52  * &lt;/xs:complexType>
53  * &lt;/xs:element>
54  *
55  * &lt;xs:complexType name="generic-element-type" mixed="true">
56  * &lt;xs:attribute name="default-collation" type="xsl:uri-list"/>
57  * &lt;xs:attribute name="exclude-result-prefixes" type="xsl:prefix-list-or-all"/>
58  * &lt;xs:attribute name="extension-element-prefixes" type="xsl:prefix-list"/>
59  * &lt;xs:attribute name="use-when" type="xsl:expression"/>
60  * &lt;xs:attribute name="xpath-default-namespace" type="xs:anyURI"/>
61  * &lt;xs:anyAttribute namespace="##other" processContents="lax"/>
62  * &lt;/xs:complexType>
63  * </pre>
64  *
65  * In reality transform is the same as stylesheet.
66  * So stylesheet object can have different tag names:
67  * <pre>
68  * stylesheet
69  * and
70  * transform.
71  * </pre>
72  *
73  * There is no methods for accessing to Template, Include, etc. child of stylesheet
74  * because they all are Declaration. So Declaration accessor methods should be
75  * used instead.
76  *
77  * @author ads
78  *
79  */

80 public interface Stylesheet extends XslComponent {
81     
82     String JavaDoc STYLESHEET_TOP_LEVEL_ELEMENTS = "stylesheet_top_level_elements"; // NOI18N
83

84     String JavaDoc IMPORT_PROPERTY = "import"; // NOI18N
85

86     String JavaDoc ID = "id"; // NOI18N
87

88     String JavaDoc VERSION = "version"; // NOI18N
89

90     String JavaDoc EXTENSION_ELEMENT_PREFIXES = "extension-element-prefixes"; // NOI18N
91

92     String JavaDoc EXCLUDE_RESULT_PREFIXES = "exclude-result-prefixes"; // NOI18N
93

94     String JavaDoc XPATH_DEFAULT_NAMESPACE = "xpath-default-namespace"; // NOI18N
95

96     String JavaDoc DEFAULT_VALIDATION = "default-validation"; // NOI18N
97

98     String JavaDoc DEFAULT_COLLATION = "default-collation"; // NOI18N
99

100     String JavaDoc INPUT_TYPE_ANNOTAIONS = "input-type-annotations"; // NOI18N
101

102     /**
103      * Gets the ID of this stylesheet.
104      * @return the ID
105      */

106     String JavaDoc getID();
107     
108     
109     /**
110      * Sets the ID of this stylesheet.
111      * @param id the new ID for this stylesheet
112      */

113     void setID(String JavaDoc id);
114     
115     /**
116      * @return "version" attribute value
117      * @throws InvalidAttributeValueException in the case when attribute value is not
118      * BigDecimal
119      */

120     BigDecimal JavaDoc getVersion() throws InvalidAttributeValueException;
121     
122     /**
123      * Set "version" attribute value.
124      * @param value new value
125      */

126     void setVersion( BigDecimal JavaDoc value );
127     
128     /**
129      * @return "default-collation" attribute value
130      */

131     List JavaDoc<String JavaDoc> getDefaultCollation();
132     
133     /**
134      * Set "default-collation" attribute value.
135      * @param list new value
136      */

137     void setDefaultCollation( List JavaDoc<String JavaDoc> list );
138     
139     /**
140      * @see constant {@link XslConstants.DEFAULT} as possible value here
141      * @return "extension-element-prefixes" attribute value
142      */

143     List JavaDoc<String JavaDoc> getExtensionElementPrefixes();
144     
145     /**
146      * Set "exclude-result-prefixes" attribute value.
147      * @param list new value
148      */

149     void setExcludeResultPrefixes( List JavaDoc<String JavaDoc> list );
150     
151     /**
152      * @see constant {@link XslConstants.DEFAULT}, {@link XslConstants.ALL} as
153      * possibles value here
154      * @return "exclude-result-prefixes" attribute value
155      */

156     List JavaDoc<String JavaDoc> getExcludeResultPrefixes();
157     
158     /**
159      * Set "extension-element-prefixes" attribute value.
160      * @param list new value
161      */

162     void setExtensionElementPrefixes( List JavaDoc<String JavaDoc> list );
163     
164     /**
165      * @return "xpath-default-namespace" attribute value
166      */

167     String JavaDoc getXpathDefaultNamespace();
168     
169     /**
170      * Set "xpath-default-namespace" attribute value.
171      * @param value new value
172      */

173     void setXpathDefaultNamespace(String JavaDoc value );
174     
175     /**
176      * @return "default-validation" attribute value
177      */

178     DefaultValidation getDefaultValidation();
179     
180     /**
181      * Set "default-validation" attribute value.
182      * @param value new value
183      */

184     void setDefaultValidation( DefaultValidation value ) ;
185     
186     /**
187      * @return "input-type-annotations" attribute value
188      */

189     Annotaions getInputTypeAnnotations();
190     
191     /**
192      * Set "input-type-annotations" attribute value.
193      * @param value new value
194      */

195     void setInputTypeAnnotations( Annotaions value );
196     
197     
198     /**
199      * @return imports children for this stylesheet.
200      * Note that resulting collection is unmodifiable.
201      */

202     List JavaDoc<Import> getImports();
203     
204     /**
205      * Add new import <code>impt</code> element at <code>position</code>.
206      * @param impt new import element.
207      * @param position position for new element.
208      */

209     void addImport(Import impt, int position);
210     
211     /**
212      * Append new import element.
213      * @param impt new import child element for appending.
214      */

215     void appendImport(Import impt);
216     
217     /**
218      * Removes existing <code>impt</code> import child element.
219      * @param impt import child element.
220      */

221     void removeImport(Import impt);
222     
223     /**
224      * @return declaration, varible or pram children for this stylesheet.
225      * Note that this collection is unmodifiable.
226      */

227     List JavaDoc<StylesheetChild> getStylesheetChildren();
228
229     /**
230      * Add new <code>child</code> StylesheetChild element at <code>position</code>.
231      * @param child new StylesheetChild element.
232      * @param position position for new element.
233      */

234     void addStylesheetChild(StylesheetChild child, int position);
235     
236     /**
237      * Append new StylesheetChild element.
238      * @param child new StylesheetChild child element for appending.
239      */

240     void appendStylesheetChild(StylesheetChild child);
241     
242     /**
243      * Removes existing <code>child</code> StylesheetChild element.
244      * @param child StylesheetChild child element.
245      */

246     void removeStylesheetChild(StylesheetChild child);
247     
248     /**
249      * Return collection of all defined children in this stylesheet.
250      * It includes children in imported xslt's and included xslt's.
251      * @return collection of defined children
252      */

253     Collection JavaDoc<StylesheetChild> findAllDefinedChildren();
254
255 }
256
Popular Tags