1 19 20 package org.netbeans.modules.web.jsf.impl.facesmodel; 21 22 import java.util.Collections ; 23 import java.util.HashSet ; 24 import java.util.Set ; 25 import javax.xml.namespace.QName ; 26 import org.netbeans.modules.web.jsf.api.facesmodel.JSFVersion; 27 28 32 public enum JSFConfigQNames { 33 34 FACES_CONFIG("faces-config"), 35 DESCRIPTION("description"), 37 DISPLAY_NAME("display-name"), 38 ICON("icon"), 39 MANAGED_BEAN("managed-bean"), 41 MANAGED_BEAN_NAME("managed-bean-name"), 42 MANAGED_BEAN_CLASS("managed-bean-class"), 43 MANAGED_BEAN_SCOPE("managed-bean-scope"), 44 NAVIGATION_RULE("navigation-rule"), 46 FROM_VIEW_ID("from-view-id"), 47 NAVIGATION_CASE("navigation-case"), 49 FROM_OUTCOME("from-outcome"), 50 FROM_ACTION("from-action"), 51 TO_VIEW_ID("to-view-id"), 52 REDIRECT("redirect"), 53 CONVERTER("converter"), 55 CONVERTER_ID("converter-id"), 56 CONVERTER_FOR_CLASS("converter-for-class"), 57 CONVERTER_CLASS("converter-class"); 58 59 60 66 private QName qname_1_1; 67 private QName qname_1_2; 68 69 70 public static final String JSF_1_2_NS = "http://java.sun.com/xml/ns/javaee"; 71 public static final String JSF_1_1_NS = javax.xml.XMLConstants.NULL_NS_URI; 72 public static final String JSFCONFIG_PREFIX = javax.xml.XMLConstants.DEFAULT_NS_PREFIX; 73 74 75 JSFConfigQNames(String localName) { 76 qname_1_1 = new QName (JSF_1_1_NS, localName, JSFCONFIG_PREFIX); 77 qname_1_2 = new QName (JSF_1_2_NS, localName, JSFCONFIG_PREFIX); 78 } 79 80 public QName getQName(JSFVersion version) { 81 QName value = qname_1_1; 82 if (version.equals(JSFVersion.JSF_1_2)) 83 value = qname_1_2; 84 return value; 85 } 86 87 public String getLocalName() { 88 return qname_1_2.getLocalPart(); 89 } 90 91 public String getQualifiedName(JSFVersion version) { 92 String value = qname_1_1.getPrefix() + ":" + qname_1_1.getLocalPart(); 93 if (version.equals(JSFVersion.JSF_1_2)) 94 value = qname_1_2.getPrefix() + ":" + qname_1_2.getLocalPart(); 95 return value; 96 } 97 98 102 } 103 | Popular Tags |