bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/TagLibraryInfoImpl.java
private TagFileInfo createTagFileInfo(TreeNode elem, String uri,
					  URL jarFileUrl)
	        throws JasperException {

	String name = null;
	String path = null;
        String description = null;
        String displayName = null;
        String icon = null;
        boolean checkConflict = false;

        Iterator list = elem.findChildren();
        while (list.hasNext()) {
            TreeNode child = (TreeNode) list.next();
            String tname = child.getName();
	    if ("name".equals(tname)) {
		name = child.getBody();
            } else if ("path".equals(tname)) {
		path = child.getBody();
            } else if ("description".equals(tname)) {
                checkConflict = true;
                description = child.getBody();
            } else if ("display-name".equals(tname)) {
                checkConflict = true;
                displayName = child.getBody();
            } else if ("icon".equals(tname)) {
                checkConflict = true;
                icon = child.getBody();
            } else if ("example".equals(tname)) {
                // Ignore <example> element: Bugzilla 33538
            } else if ("tag-extension".equals(tname)) {
                // Ignore <tag-extension> element: Bugzilla 33538
	    } else {
                err.jspError("jsp.error.unknown.element.in.tagfile", tname);
            }
	}

	if (path.startsWith("/META-INF/tags")) {
	    // Tag file packaged in JAR
	    // STARTJR: fix possible NPE
	    if(jarFileUrl != null) {
	        ctxt.getTagFileJarUrls().put(path, jarFileUrl);
	    }
	    // ENDJR: fix possible NPE
	} else if (!path.startsWith("/WEB-INF/tags")) {
	    err.jspError("jsp.error.tagfile.illegalPath", path);
	}

	JasperTagInfo tagInfo = (JasperTagInfo)
	    TagFileProcessor.parseTagFileDirectives(parserController, name,
						      path, this);
        if (checkConflict) {
            String tstring = tagInfo.getInfoString();
            if (tstring != null && !"".equals(tstring)) { 
                description = tstring;
            }
            tstring = tagInfo.getDisplayName();
            if (tstring != null && !"".equals(tstring)) { 
                displayName = tstring;
            }
            tstring = tagInfo.getSmallIcon();
            if (tstring != null && !"".equals(tstring)) { 
                icon = tstring;
            }
            tagInfo = new JasperTagInfo(
                              tagInfo.getTagName(),
                              tagInfo.getTagClassName(),
                              tagInfo.getBodyContent(),
                              description,
                              tagInfo.getTagLibrary(),
                              tagInfo.getTagExtraInfo(),
                              tagInfo.getAttributes(),
                              displayName,
                              icon,
                              tagInfo.getLargeIcon(),
                              tagInfo.getTagVariableInfos(),
                              tagInfo.getDynamicAttributesMapName());
        }
	return new TagFileInfo(name, path, tagInfo);
    }
private TagFileInfo createTagFileInfo(TreeNode elem, String uri,
					  URL jarFileUrl)
	        throws JasperException {

	String name = null;
	String path = null;
        String description = null;
        String displayName = null;
        String icon = null;
        boolean checkConflict = false;

        Iterator list = elem.findChildren();
        while (list.hasNext()) {
            TreeNode child = (TreeNode) list.next();
            String tname = child.getName();
	    if ("name".equals(tname)) {
		name = child.getBody();
            } else if ("path".equals(tname)) {
		path = child.getBody();
            } else if ("description".equals(tname)) {
                checkConflict = true;
                description = child.getBody();
            } else if ("display-name".equals(tname)) {
                checkConflict = true;
                displayName = child.getBody();
            } else if ("icon".equals(tname)) {
                checkConflict = true;
                icon = child.getBody();
            } else if ("example".equals(tname)) {
                // Ignore <example> element: Bugzilla 33538
            } else if ("tag-extension".equals(tname)) {
                // Ignore <tag-extension> element: Bugzilla 33538
	    } else {
                err.jspError("jsp.error.unknown.element.in.tagfile", tname);
            }
	}

	if (path.startsWith("/META-INF/tags")) {
	    // Tag file packaged in JAR
	    // STARTJR: fix possible NPE
	    if(jarFileUrl != null) {
	        ctxt.getTagFileJarUrls().put(path, jarFileUrl);
	    }
	    // ENDJR: fix possible NPE
	} else if (!path.startsWith("/WEB-INF/tags")) {
	    err.jspError("jsp.error.tagfile.illegalPath", path);
	}

	JasperTagInfo tagInfo = (JasperTagInfo)
	    TagFileProcessor.parseTagFileDirectives(parserController, name,
						      path, this);
        if (checkConflict) {
            String tstring = tagInfo.getInfoString();
            if (tstring != null && !"".equals(tstring)) { 
                description = tstring;
            }
            tstring = tagInfo.getDisplayName();
            if (tstring != null && !"".equals(tstring)) { 
                displayName = tstring;
            }
            tstring = tagInfo.getSmallIcon();
            if (tstring != null && !"".equals(tstring)) { 
                icon = tstring;
            }
            tagInfo = new JasperTagInfo(
                              tagInfo.getTagName(),
                              tagInfo.getTagClassName(),
                              tagInfo.getBodyContent(),
                              description,
                              tagInfo.getTagLibrary(),
                              tagInfo.getTagExtraInfo(),
                              tagInfo.getAttributes(),
                              displayName,
                              icon,
                              tagInfo.getLargeIcon(),
                              tagInfo.getTagVariableInfos(),
                              tagInfo.getDynamicAttributesMapName());
        }
	return new TagFileInfo(name, path, tagInfo);
    }
private TagFileInfo createTagFileInfo ( TreeNode elem , String uri , URL jarFileUrl ) throws JasperException { String name = null ; String path = null ; String description = null ; String displayName = null ; String icon = null ; boolean checkConflict = false ; Iterator list = elem . findChildren ( ) ; while ( list . hasNext ( ) ) { TreeNode child = ( TreeNode ) list . next ( ) ; String tname = child . getName ( ) ; if ( "name" . equals ( tname ) ) { name = child . getBody ( ) ; } else if ( "path" . equals ( tname ) ) { path = child . getBody ( ) ; } else if ( "description" . equals ( tname ) ) { checkConflict = true ; description = child . getBody ( ) ; } else if ( "display-name" . equals ( tname ) ) { checkConflict = true ; displayName = child . getBody ( ) ; } else if ( "icon" . equals ( tname ) ) { checkConflict = true ; icon = child . getBody ( ) ; } else if ( "example" . equals ( tname ) ) { // Ignore <example> element: Bugzilla 33538 } else if ( "tag-extension" . equals ( tname ) ) { // Ignore <tag-extension> element: Bugzilla 33538 } else { err . jspError ( "jsp.error.unknown.element.in.tagfile" , tname ) ; } } if ( path . startsWith ( "/META-INF/tags" ) ) { // Tag file packaged in JAR // STARTJR: fix possible NPE if ( jarFileUrl != null ) { ctxt . getTagFileJarUrls ( ) . put ( path , jarFileUrl ) ; } // ENDJR: fix possible NPE } else if ( ! path . startsWith ( "/WEB-INF/tags" ) ) { err . jspError ( "jsp.error.tagfile.illegalPath" , path ) ; } JasperTagInfo tagInfo = ( JasperTagInfo ) TagFileProcessor . parseTagFileDirectives ( parserController , name , path , this ) ; if ( checkConflict ) { String tstring = tagInfo . getInfoString ( ) ; if ( tstring != null && ! "" . equals ( tstring ) ) { description = tstring ; } tstring = tagInfo . getDisplayName ( ) ; if ( tstring != null && ! "" . equals ( tstring ) ) { displayName = tstring ; } tstring = tagInfo . getSmallIcon ( ) ; if ( tstring != null && ! "" . equals ( tstring ) ) { icon = tstring ; } tagInfo = new JasperTagInfo ( tagInfo . getTagName ( ) , tagInfo . getTagClassName ( ) , tagInfo . getBodyContent ( ) , description , tagInfo . getTagLibrary ( ) , tagInfo . getTagExtraInfo ( ) , tagInfo . getAttributes ( ) , displayName , icon , tagInfo . getLargeIcon ( ) , tagInfo . getTagVariableInfos ( ) , tagInfo . getDynamicAttributesMapName ( ) ) ; } return new TagFileInfo ( name , path , tagInfo ) ; }
/*
Parses the tag file directives of the given TagFile and turns them into
a TagInfo.

@param elem The <tag-file> element in the TLD
@param uri The location of the TLD, in case the tag file is specified
relative to it
@param jarFile The JAR file, in case the tag file is packaged in a JAR

@return TagInfo correspoding to tag file directives
/ * Parses the tag file directives of the given TagFile and turns them into a TagInfo .