/** * Retrieve a registered <code>TagLibrary</code> by namespace URI. * * @param uri The namespace URI of the tag-library. * * @return The matching tag-library, or <code>null</code> if none matches. */ public TagLibrary getTagLibrary( String uri ) { return super.getTagLibrary( uri ); }
@Override public TagLibrary getTagLibrary(String namespaceURI) { TagLibrary tl = super.getTagLibrary(namespaceURI); // delegate to JellyClassLoaderTearOff for taglib handling if(tl==null && jclt!=null) { tl = jclt.getTagLibrary(namespaceURI); if (tl!=null) registerTagLibrary(namespaceURI,tl); } return tl; }
@Override public TagLibrary getTagLibrary(String namespaceURI) { TagLibrary tl = super.getTagLibrary(namespaceURI); // delegate to JellyClassLoaderTearOff for taglib handling if(tl==null && jclt!=null) { tl = jclt.getTagLibrary(namespaceURI); if (tl!=null) registerTagLibrary(namespaceURI,tl); } return tl; }
answer = parent.getTagLibrary( namespaceURI );
answer = parent.getTagLibrary( namespaceURI );
answer = parent.getTagLibrary( namespaceURI );
answer = parent.getTagLibrary( namespaceURI );
/** * This implementations makes sure that only "jelly:core" * taglib is instantiated, insuring that "optional" dependencies * are not inadvertantly called. Specifically addresses a bug * in older Jelly dev versions where a nested include * would trigger instantiation of all tag libraries. * * @param namespaceURI * @return */ public TagLibrary getTagLibrary(String namespaceURI) { if (namespaceURI.equals("jelly:core")) { return super.getTagLibrary(namespaceURI); } else { throw new NoClassDefFoundError("Unexpected tag library uri: " + namespaceURI); } }
private TagScript createTagScript(JellyContext context, String uri, String name) throws JellyException { TagLibrary lib = context.getTagLibrary(uri); if (lib==null) throw new JellyException("Undefined tag library namespace URI: "+uri); TagScript tagScript = lib.createTagScript(name, null/*this parameter appears to be unused.*/); if (tagScript!=null) return tagScript; tagScript = lib.createTagScript(name.replace('_','-'), null); if (tagScript!=null) return tagScript; throw new JellyException(String.format("name '%s' not found for '%s'", name, uri)); } }
/** * Create a tag script if the given QName is a taglib invocation, or return null * to handle it like a literal static tag. */ private TagScript createTagScript(QName n, Map<?, ?> attributes) throws JellyException { TagLibrary lib = context.getTagLibrary(n.getNamespaceURI()); if(lib!=null) { String localName = n.getLocalPart(); TagScript tagScript = lib.createTagScript(localName, null/*this parameter appears to be unused.*/); if (tagScript==null) tagScript = lib.createTagScript(localName.replace('_','-'), null); if (tagScript!=null) { if (attributes != null) { for (Entry e : attributes.entrySet()) { Object v = e.getValue(); if (v!=null) tagScript.addAttribute(e.getKey().toString(), new ConstantExpression(v)); } } return tagScript; } } // otherwise treat it as a literal. return null; }
public void doTag(XMLOutput output) throws JellyTagException { String uri = getUri(); tagLibrary = new DynamicTagLibrary( uri ); // inherit tags from an existing tag library if ( isInherit() ) { tagLibrary.setParent( context.getTagLibrary( uri ) ); } context.registerTagLibrary( uri, tagLibrary ); invokeBody(output); tagLibrary = null; }
try { TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (namespaceURI != null && namespaceURI.startsWith("jelly:")) {
try { TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (namespaceURI != null && namespaceURI.startsWith("jelly:")) {
try { TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (namespaceURI != null && namespaceURI.startsWith("jelly:")) {
try { TagLibrary taglib = context.getTagLibrary(namespaceURI); if (taglib == null) { if (namespaceURI != null && namespaceURI.startsWith("jelly:")) {
/** * Attempts to find a dynamically created tag that has been created since this * script was compiled */ protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws JellyException { // lets see if there's a tag library for this URI... TagLibrary taglib = context.getTagLibrary( tag.getUri() ); if ( taglib != null ) { Tag newTag = taglib.createTag( tag.getLocalName(), getSaxAttributes() ); if ( newTag != null ) { newTag.setParent( tag.getParent() ); newTag.setBody( tag.getBody() ); return newTag; } } return tag; } }
/** * Attempts to find a dynamically created tag that has been created since this * script was compiled */ protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws JellyException { // lets see if there's a tag library for this URI... TagLibrary taglib = context.getTagLibrary( tag.getUri() ); if ( taglib != null ) { Tag newTag = taglib.createTag( tag.getLocalName(), getSaxAttributes() ); if ( newTag != null ) { newTag.setParent( tag.getParent() ); newTag.setBody( tag.getBody() ); return newTag; } } return tag; } }
/** * Attempts to find a dynamically created tag that has been created since this * script was compiled */ protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws JellyException { // lets see if there's a tag library for this URI... TagLibrary taglib = context.getTagLibrary( tag.getUri() ); if ( taglib != null ) { Tag newTag = taglib.createTag( tag.getLocalName(), getSaxAttributes() ); if ( newTag != null ) { newTag.setParent( tag.getParent() ); newTag.setBody( tag.getBody() ); return newTag; } } return tag; } }
/** * Attempts to find a dynamically created tag that has been created since this * script was compiled */ protected Tag findDynamicTag(JellyContext context, StaticTag tag) throws JellyException { // lets see if there's a tag library for this URI... TagLibrary taglib = context.getTagLibrary( tag.getUri() ); if ( taglib != null ) { Tag newTag = taglib.createTag( tag.getLocalName(), getSaxAttributes() ); if ( newTag != null ) { newTag.setParent( tag.getParent() ); newTag.setBody( tag.getBody() ); return newTag; } } return tag; } }