1 19 package org.netbeans.modules.xslt.model.impl; 20 21 import java.util.HashSet ; 22 import java.util.Set ; 23 import java.util.concurrent.atomic.AtomicReference ; 24 25 import javax.xml.namespace.QName ; 26 27 import org.netbeans.modules.xslt.model.XslComponent; 28 29 30 40 enum XslElements { 41 42 ANALIZE_STRING( "analyze-string" ), APPLY_IMPORTS( "apply-imports" ), APPLY_TEMPLATES( "apply-templates" ), ATTRIBUTE( "attribute" ), ATTRIBUTE_SET( "attribute-set" ), CALL_TEMPLATE( "call-template" ), CHARACTER_MAP( "character-map" ), CHOOSE( "choose" ), COMMENT( "comment" ), COPY( "copy" ), COPY_OF( "copy-of" ), DECIMAL_FORMAT( "decimal-format" ), DOCUMENT( "document" ), ELEMENT( "element" ), FALLBACK( "fallback" ), FOR_EACH( "for-each" ), FOR_EACH_GROUP( "for-each-group" ), FUNCTION( "function" ), IF( "if" ), IMPORT( "imoprt" ), IMPORT_SCHEMA( "import-schema" ), INCLUDE( "include" ), KEY( "key" ), MATCHING_SUBSTRING( "matching-substring" ), MESSAGE( "message" ), NAMESPACE( "namespace" ), NAMESPACE_ALIAS( "namespace-alias" ), NEXT_MATCH( "next-match" ), NON_MATCHING_SUBSTRING( "non-matching-substring" ), NUMBER( "number" ), OTHERWISE( "otherwise" ), OUTPUT( "output" ), OUTPUT_CHARACTER( "output-character" ), PARAM( "param" ), PERFORM_SORT( "perform-sort" ), PRESERVE_SPACE( "preserve-space" ), PROCESSING_INSTRUCTION( "processing-instruction" ), RESULT_DOCUMENT( "result-document" ), SEQUENCE( "sequence" ), SORT( "sort" ), STRIP_SPACE( "strip-space" ), STYLESHEET( "stylesheet"), TRANSFORM( "transform" ), TEMPLATE( "template" ), TEXT( "text" ), VALUE_OF( "value-of" ), VARIABLE( "variable" ), WHEN( "when" ), WHITH_PARAM( "with-param" ) ; 92 93 XslElements( String str ){ 94 myName = str; 95 } 96 97 public String getName() { 98 return myName; 99 } 100 101 public QName getQName() { 102 return new QName ( XslComponent.XSL_NAMESPACE, getName() ); 103 } 104 105 public static Set <QName > allQNames() { 106 if ( myQNames.get() == null ) { 107 Set <QName > set = new HashSet <QName >( values().length ); 108 for (XslElements element : values() ) { 109 set.add( element.getQName() ); 110 } 111 myQNames.compareAndSet( null, set ); 112 } 113 return myQNames.get(); 114 } 115 116 private String myName; 117 118 private static AtomicReference <Set <QName >> myQNames = 119 new AtomicReference <Set <QName >>(); 120 } 121 122 | Popular Tags |