001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.xslt.model;
021:
022: import java.math.BigDecimal;
023: import java.util.Collection;
024: import java.util.List;
025:
026: import org.netbeans.modules.xslt.model.enums.Annotaions;
027: import org.netbeans.modules.xslt.model.enums.DefaultValidation;
028:
029: /**
030: * <pre>
031: * <xs:element name="stylesheet" substitutionGroup="xsl:transform"/>
032: *
033: * <xs:element name="transform">
034: * <xs:complexType>
035: * <xs:complexContent>
036: * <xs:extension base="xsl:transform-element-base-type">
037: * <xs:sequence>
038: * <xs:element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/>
039: * <xs:choice minOccurs="0" maxOccurs="unbounded">
040: * <xs:element ref="xsl:declaration"/>
041: * <xs:element ref="xsl:variable"/>
042: * <xs:element ref="xsl:param"/>
043: * <xs:any namespace="##other" processContents="lax"/>
044: * </xs:choice>
045: * </xs:sequence>
046: * <xs:attribute name="id" type="xs:ID"/>
047: * <xs:attribute name="default-validation" type="xsl:validation-strip-or-preserve" default="strip"/>
048: * <xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type" default="unspecified"/>
049: * </xs:extension>
050: * </xs:complexContent>
051: * </xs:complexType>
052: * </xs:element>
053: *
054: * <xs:complexType name="generic-element-type" mixed="true">
055: * <xs:attribute name="default-collation" type="xsl:uri-list"/>
056: * <xs:attribute name="exclude-result-prefixes" type="xsl:prefix-list-or-all"/>
057: * <xs:attribute name="extension-element-prefixes" type="xsl:prefix-list"/>
058: * <xs:attribute name="use-when" type="xsl:expression"/>
059: * <xs:attribute name="xpath-default-namespace" type="xs:anyURI"/>
060: * <xs:anyAttribute namespace="##other" processContents="lax"/>
061: * </xs:complexType>
062: * </pre>
063: *
064: * In reality transform is the same as stylesheet.
065: * So stylesheet object can have different tag names:
066: * <pre>
067: * stylesheet
068: * and
069: * transform.
070: * </pre>
071: *
072: * There is no methods for accessing to Template, Include, etc. child of stylesheet
073: * because they all are Declaration. So Declaration accessor methods should be
074: * used instead.
075: *
076: * @author ads
077: *
078: */
079: public interface Stylesheet extends XslComponent {
080:
081: String STYLESHEET_TOP_LEVEL_ELEMENTS = "stylesheet_top_level_elements"; // NOI18N
082:
083: String IMPORT_PROPERTY = "import"; // NOI18N
084:
085: String ID = "id"; // NOI18N
086:
087: String VERSION = "version"; // NOI18N
088:
089: String EXTENSION_ELEMENT_PREFIXES = "extension-element-prefixes"; // NOI18N
090:
091: String EXCLUDE_RESULT_PREFIXES = "exclude-result-prefixes"; // NOI18N
092:
093: String XPATH_DEFAULT_NAMESPACE = "xpath-default-namespace"; // NOI18N
094:
095: String DEFAULT_VALIDATION = "default-validation"; // NOI18N
096:
097: String DEFAULT_COLLATION = "default-collation"; // NOI18N
098:
099: String INPUT_TYPE_ANNOTAIONS = "input-type-annotations"; // NOI18N
100:
101: /**
102: * Gets the ID of this stylesheet.
103: * @return the ID
104: */
105: String getID();
106:
107: /**
108: * Sets the ID of this stylesheet.
109: * @param id the new ID for this stylesheet
110: */
111: void setID(String id);
112:
113: /**
114: * @return "version" attribute value
115: * @throws InvalidAttributeValueException in the case when attribute value is not
116: * BigDecimal
117: */
118: BigDecimal getVersion() throws InvalidAttributeValueException;
119:
120: /**
121: * Set "version" attribute value.
122: * @param value new value
123: */
124: void setVersion(BigDecimal value);
125:
126: /**
127: * @return "default-collation" attribute value
128: */
129: List<String> getDefaultCollation();
130:
131: /**
132: * Set "default-collation" attribute value.
133: * @param list new value
134: */
135: void setDefaultCollation(List<String> list);
136:
137: /**
138: * @see constant {@link XslConstants.DEFAULT} as possible value here
139: * @return "extension-element-prefixes" attribute value
140: */
141: List<String> getExtensionElementPrefixes();
142:
143: /**
144: * Set "exclude-result-prefixes" attribute value.
145: * @param list new value
146: */
147: void setExcludeResultPrefixes(List<String> list);
148:
149: /**
150: * @see constant {@link XslConstants.DEFAULT}, {@link XslConstants.ALL} as
151: * possibles value here
152: * @return "exclude-result-prefixes" attribute value
153: */
154: List<String> getExcludeResultPrefixes();
155:
156: /**
157: * Set "extension-element-prefixes" attribute value.
158: * @param list new value
159: */
160: void setExtensionElementPrefixes(List<String> list);
161:
162: /**
163: * @return "xpath-default-namespace" attribute value
164: */
165: String getXpathDefaultNamespace();
166:
167: /**
168: * Set "xpath-default-namespace" attribute value.
169: * @param value new value
170: */
171: void setXpathDefaultNamespace(String value);
172:
173: /**
174: * @return "default-validation" attribute value
175: */
176: DefaultValidation getDefaultValidation();
177:
178: /**
179: * Set "default-validation" attribute value.
180: * @param value new value
181: */
182: void setDefaultValidation(DefaultValidation value);
183:
184: /**
185: * @return "input-type-annotations" attribute value
186: */
187: Annotaions getInputTypeAnnotations();
188:
189: /**
190: * Set "input-type-annotations" attribute value.
191: * @param value new value
192: */
193: void setInputTypeAnnotations(Annotaions value);
194:
195: /**
196: * @return imports children for this stylesheet.
197: * Note that resulting collection is unmodifiable.
198: */
199: List<Import> getImports();
200:
201: /**
202: * Add new import <code>impt</code> element at <code>position</code>.
203: * @param impt new import element.
204: * @param position position for new element.
205: */
206: void addImport(Import impt, int position);
207:
208: /**
209: * Append new import element.
210: * @param impt new import child element for appending.
211: */
212: void appendImport(Import impt);
213:
214: /**
215: * Removes existing <code>impt</code> import child element.
216: * @param impt import child element.
217: */
218: void removeImport(Import impt);
219:
220: /**
221: * @return declaration, varible or pram children for this stylesheet.
222: * Note that this collection is unmodifiable.
223: */
224: List<StylesheetChild> getStylesheetChildren();
225:
226: /**
227: * Add new <code>child</code> StylesheetChild element at <code>position</code>.
228: * @param child new StylesheetChild element.
229: * @param position position for new element.
230: */
231: void addStylesheetChild(StylesheetChild child, int position);
232:
233: /**
234: * Append new StylesheetChild element.
235: * @param child new StylesheetChild child element for appending.
236: */
237: void appendStylesheetChild(StylesheetChild child);
238:
239: /**
240: * Removes existing <code>child</code> StylesheetChild element.
241: * @param child StylesheetChild child element.
242: */
243: void removeStylesheetChild(StylesheetChild child);
244:
245: /**
246: * Return collection of all defined children in this stylesheet.
247: * It includes children in imported xslt's and included xslt's.
248: * @return collection of defined children
249: */
250: Collection<StylesheetChild> findAllDefinedChildren();
251:
252: }
|