1 16 package org.apache.commons.jelly.tags.define; 17 18 import org.apache.commons.jelly.JellyTagException; 19 import org.apache.commons.jelly.TagSupport; 20 import org.apache.commons.jelly.XMLOutput; 21 import org.apache.commons.jelly.impl.DynamicTagLibrary; 22 23 36 public class TaglibTag extends TagSupport { 37 38 39 private String uri; 40 41 private DynamicTagLibrary tagLibrary; 42 43 private boolean inherit = true; 44 45 public TaglibTag() { 46 } 47 48 public TaglibTag(String uri) { 49 this.uri = uri; 50 } 51 52 public void doTag(XMLOutput output) throws JellyTagException { 55 String uri = getUri(); 56 tagLibrary = new DynamicTagLibrary( uri ); 57 58 if ( isInherit() ) { 60 tagLibrary.setParent( context.getTagLibrary( uri ) ); 61 } 62 context.registerTagLibrary( uri, tagLibrary ); 63 64 invokeBody(output); 65 66 tagLibrary = null; 67 } 68 69 public String getUri() { 72 return uri; 73 } 74 75 78 public void setUri(String uri) { 79 this.uri = uri; 80 } 81 82 public DynamicTagLibrary getTagLibrary() { 83 return tagLibrary; 84 } 85 86 90 public boolean isInherit() { 91 return inherit; 92 } 93 94 104 public void setInherit(boolean inherit) { 105 this.inherit = inherit; 106 } 107 108 } 109 | Popular Tags |