~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to xml/xsl/api/src/org/netbeans/modules/xslt/model/impl/XslAttributes.java

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
3
 *
 
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
5
 *
 
6
 * The contents of this file are subject to the terms of either the GNU
 
7
 * General Public License Version 2 only ("GPL") or the Common
 
8
 * Development and Distribution License("CDDL") (collectively, the
 
9
 * "License"). You may not use this file except in compliance with the
 
10
 * License. You can obtain a copy of the License at
 
11
 * http://www.netbeans.org/cddl-gplv2.html
 
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
 
13
 * specific language governing permissions and limitations under the
 
14
 * License.  When distributing the software, include this License Header
 
15
 * Notice in each file and include the License file at
 
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
 
17
 * particular file as subject to the "Classpath" exception as provided
 
18
 * by Sun in the GPL Version 2 section of the License file that
 
19
 * accompanied this code. If applicable, add the following below the
 
20
 * License Header, with the fields enclosed by brackets [] replaced by
 
21
 * your own identifying information:
 
22
 * "Portions Copyrighted [year] [name of copyright owner]"
 
23
 *
 
24
 * Contributor(s):
 
25
 *
 
26
 * The Original Software is NetBeans. The Initial Developer of the Original
 
27
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
 
28
 * Microsystems, Inc. All Rights Reserved.
 
29
 *
 
30
 * If you wish your version of this file to be governed by only the CDDL
 
31
 * or only the GPL Version 2, indicate your decision by adding
 
32
 * "[Contributor] elects to include this software in this distribution
 
33
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
 
34
 * single choice of license, a recipient has the option to distribute
 
35
 * your version of this file under either the CDDL, the GPL Version 2 or
 
36
 * to extend the choice of license to its licensees as provided above.
 
37
 * However, if you add GPL Version 2 code and therefore, elected the GPL
 
38
 * Version 2 license, then the option applies only if the new code is
 
39
 * made subject to such option by the copyright holder.
 
40
 */
 
41
package org.netbeans.modules.xslt.model.impl;
 
42
 
 
43
import java.math.BigDecimal;
 
44
import java.util.List;
 
45
 
 
46
import javax.xml.namespace.QName;
 
47
 
 
48
import org.netbeans.modules.xml.xam.dom.Attribute;
 
49
import org.netbeans.modules.xslt.model.ApplyTemplates;
 
50
import org.netbeans.modules.xslt.model.AsSpec;
 
51
import org.netbeans.modules.xslt.model.AttrValueTamplateHolder;
 
52
import org.netbeans.modules.xslt.model.AttributeSet;
 
53
import org.netbeans.modules.xslt.model.AttributeValueTemplate;
 
54
import org.netbeans.modules.xslt.model.CallTemplate;
 
55
import org.netbeans.modules.xslt.model.CharacterMap;
 
56
import org.netbeans.modules.xslt.model.CollationSpec;
 
57
import org.netbeans.modules.xslt.model.CopyNamespacesSpec;
 
58
import org.netbeans.modules.xslt.model.DisableOutputExcapingSpec;
 
59
import org.netbeans.modules.xslt.model.FormatSpec;
 
60
import org.netbeans.modules.xslt.model.XslModelReference;
 
61
import org.netbeans.modules.xslt.model.InheritNamespacesSpec;
 
62
import org.netbeans.modules.xslt.model.Key;
 
63
import org.netbeans.modules.xslt.model.LangSpec;
 
64
import org.netbeans.modules.xslt.model.NamespaceSpec;
 
65
import org.netbeans.modules.xslt.model.Output;
 
66
import org.netbeans.modules.xslt.model.Param;
 
67
import org.netbeans.modules.xslt.model.QualifiedNameable;
 
68
import org.netbeans.modules.xslt.model.SelectSpec;
 
69
import org.netbeans.modules.xslt.model.Sort;
 
70
import org.netbeans.modules.xslt.model.Stylesheet;
 
71
import org.netbeans.modules.xslt.model.Template;
 
72
import org.netbeans.modules.xslt.model.TestSpec;
 
73
import org.netbeans.modules.xslt.model.TypeSpec;
 
74
import org.netbeans.modules.xslt.model.UseAttributesSetsSpec;
 
75
import org.netbeans.modules.xslt.model.UseCharacterMapsSpec;
 
76
import org.netbeans.modules.xslt.model.ValidationSpec;
 
77
import org.netbeans.modules.xslt.model.enums.Annotaions;
 
78
import org.netbeans.modules.xslt.model.enums.DefaultValidation;
 
79
import org.netbeans.modules.xslt.model.enums.Standalone;
 
80
import org.netbeans.modules.xslt.model.enums.TBoolean;
 
81
import org.netbeans.modules.xslt.model.enums.Validation;
 
82
 
 
83
 
 
84
/**
 
85
 * @author ads
 
86
 *
 
87
 */
 
88
enum XslAttributes implements Attribute {
 
89
    HREF( XslModelReference.HREF , String.class ),
 
90
    VALIDATION( ValidationSpec.VALIDATION , Validation.class ),
 
91
    COPY_NAMESPACES( CopyNamespacesSpec.COPY_NAMESPACES , TBoolean.class ), 
 
92
    TEST ( TestSpec.TEST , String.class), 
 
93
    REQUIRED( Param.REQUIRED , TBoolean.class ), 
 
94
    TUNNEL( Param.TUNNEL , TBoolean.class ), 
 
95
    ID( Stylesheet.ID , String.class ), 
 
96
    MATCH( Template.MATCH , String.class ), 
 
97
    MODE ( ApplyTemplates.MODE , String.class ),
 
98
    MODES( Template.MODE, List.class , QName.class ),  // this is mode attribute in Template class, it has different value type
 
99
    DISABLE_OUTPUT_ESCAPING( DisableOutputExcapingSpec.DISABLE_OUTPUT_ESCAPING , 
 
100
            TBoolean.class ), 
 
101
    AVT_NAME( AttrValueTamplateHolder.NAME , AttributeValueTemplate.class ), 
 
102
    NAMESPACE( NamespaceSpec.NAMESPACE , AttributeValueTemplate.class ), 
 
103
    SELECT( SelectSpec.SELECT , String.class ), 
 
104
    PRIORITY( Template.PRIORITY , Double.class ), 
 
105
    NAME( QualifiedNameable.NAME , QName.class ),
 
106
    USE_ATTRIBUTE_SETS( UseAttributesSetsSpec.USE_ATTRIBUTE_SETS , List.class , 
 
107
            AttributeSet.class ), 
 
108
    SEPARATOR( org.netbeans.modules.xslt.model.Attribute.SEPARATOR, 
 
109
            AttributeValueTemplate.class ), 
 
110
    NAME_OF_CALL_TMPL( CallTemplate.NAME , Template.class ), 
 
111
    COLLATION( CollationSpec.COLLATION , String.class ), 
 
112
    INHERIT_NAMESPACES( InheritNamespacesSpec.INHERIT_NAMESPACES, TBoolean.class ),
 
113
    ENCODING( Output.ENCODING, String.class ),
 
114
    LANG( LangSpec.LANG , AttributeValueTemplate.class ),
 
115
    FORMAT( FormatSpec.FORMAT, AttributeValueTemplate.class ),
 
116
    INDENT( Output.INDENT , TBoolean.class ),
 
117
    STANDALONE( Output.STANDALONE , Standalone.class ),
 
118
    TYPE( TypeSpec.TYPE , QName.class ),
 
119
    UNDECLARE_PREFIXES( Output.UNDECLARE_PREFIXES, TBoolean.class ),
 
120
    USE_CHARACTER_MAPS( UseCharacterMapsSpec.USE_CHARACTER_MAPS , List.class , 
 
121
            CharacterMap.class ),
 
122
    CASE_ORDER( Sort.CASE_ORDER , AttributeValueTemplate.class ),
 
123
    DATA_TYPE( Sort.DATA_TYPE , AttributeValueTemplate.class ),
 
124
    ORDER( Sort.ORDER, AttributeValueTemplate.class ),
 
125
    STABLE( Sort.STABLE , TBoolean.class ),
 
126
    USE( Key.USE , String.class ),
 
127
    AS( AsSpec.AS, String.class ),
 
128
    XPATH_DEFAULT_NAMESPACE( Stylesheet.XPATH_DEFAULT_NAMESPACE , String.class ),
 
129
    VERSION( Stylesheet.VERSION , BigDecimal.class ),
 
130
    INPUT_TYPE_ANNOTAIONS( Stylesheet.INPUT_TYPE_ANNOTAIONS, Annotaions.class ), 
 
131
    DEFAULT_VALIDATION( Stylesheet.DEFAULT_VALIDATION, DefaultValidation.class ),
 
132
    EXTENSION_ELEMENT_PREFIXES( Stylesheet.EXTENSION_ELEMENT_PREFIXES, List.class,
 
133
            String.class ),
 
134
    DEFAULT_COLLATION( Stylesheet.DEFAULT_COLLATION, List.class, 
 
135
            String.class ),
 
136
    EXCLUDE_RESULT_PREFIXES( Stylesheet.EXCLUDE_RESULT_PREFIXES, List.class,
 
137
            String.class ),
 
138
    ;
 
139
 
 
140
    XslAttributes(String name, Class type, Class memberType) {
 
141
        this.myName = name;
 
142
        this.myType = type;
 
143
        this.myMemberType = memberType;
 
144
    }
 
145
        
 
146
    XslAttributes( String name , Class type ) {
 
147
        this( name , type , null );
 
148
    }
 
149
    
 
150
    public String getName() {
 
151
        return myName;
 
152
    }
 
153
    
 
154
    public Class getType() {
 
155
        return myType;
 
156
    }
 
157
    
 
158
    public Class getMemberType() {
 
159
        return myMemberType;
 
160
    }
 
161
    
 
162
    private final String myName;
 
163
    private final Class myType;
 
164
    private final Class myMemberType;
 
165
 
 
166
}