1 14 15 package com.sun.facelets.tag; 16 17 import java.lang.reflect.Method ; 18 19 import javax.faces.FacesException; 20 21 import com.sun.facelets.util.ParameterCheck; 22 23 31 public final class CompositeTagLibrary implements TagLibrary { 32 33 private final TagLibrary[] libraries; 34 35 public CompositeTagLibrary(TagLibrary[] libraries) { 36 ParameterCheck.notNull("libraries", libraries); 37 this.libraries = libraries; 38 } 39 40 45 public boolean containsNamespace(String ns) { 46 for (int i = 0; i < this.libraries.length; i++) { 47 if (this.libraries[i].containsNamespace(ns)) { 48 return true; 49 } 50 } 51 return false; 52 } 53 54 60 public boolean containsTagHandler(String ns, String localName) { 61 for (int i = 0; i < this.libraries.length; i++) { 62 if (this.libraries[i].containsTagHandler(ns, localName)) { 63 return true; 64 } 65 } 66 return false; 67 } 68 69 75 public TagHandler createTagHandler(String ns, String localName, 76 TagConfig tag) throws FacesException { 77 for (int i = 0; i < this.libraries.length; i++) { 78 if (this.libraries[i].containsTagHandler(ns, localName)) { 79 return this.libraries[i].createTagHandler(ns, localName, tag); 80 } 81 } 82 return null; 83 } 84 85 91 public boolean containsFunction(String ns, String name) { 92 for (int i = 0; i < this.libraries.length; i++) { 93 if (this.libraries[i].containsFunction(ns, name)) { 94 return true; 95 } 96 } 97 return false; 98 } 99 100 106 public Method createFunction(String ns, String name) { 107 for (int i = 0; i < this.libraries.length; i++) { 108 if (this.libraries[i].containsFunction(ns, name)) { 109 return this.libraries[i].createFunction(ns, name); 110 } 111 } 112 return null; 113 } 114 } 115 | Popular Tags |