FileDocCategorySizeDatePackage
TagLibDescriptor.javaAPI DocGlassfish v2 API5164Fri May 04 22:33:24 BST 2007com.sun.enterprise.tools.verifier

TagLibDescriptor

public class TagLibDescriptor extends Object
class which defines methods required for implementing tests based out of jsp tag library files.
author
Sudipto Ghosh

Fields Summary
public static final String
TAG
public static final String
LISTENER_CLASS
public static final String
FUNCTION
private Document
doc
private String
version
private String
uri
Constructors Summary
public TagLibDescriptor(Document doc, String version, String uri)


           
        this.doc = doc;
        this.version = version;
        this.uri = uri;
    
Methods Summary
public com.sun.enterprise.tools.verifier.web.FunctionDescriptor[]getFunctionDescriptors()
for each functions in tag lib descriptor creates a function descritor and return the array of FunctionDescriptors

return
array of function descriptor.

        NodeList nl = doc.getElementsByTagName(FUNCTION);
        List<FunctionDescriptor> list = new ArrayList<FunctionDescriptor>();
        if (nl != null) {
            int size = nl.getLength();
            for (int i = 0; i < size; i++) {
                list.add(new FunctionDescriptor(nl.item(i)));
            }
        }
        return list.toArray(new FunctionDescriptor[0]);
    
public java.lang.String[]getListenerClasses()

        NodeList nl = doc.getElementsByTagName(LISTENER_CLASS);
        String[] classes = null;
        if (nl != null) {
            int size = nl.getLength();
            classes = new String[size];
            for (int i = 0; i < size; i++) {
                classes[i] = nl.item(i).getFirstChild().getNodeValue();
            }
        }
        return classes;
    
public java.lang.StringgetPublicID()

        DocumentType docType = doc.getDoctype();
        return ((docType == null) ? null : docType.getPublicId());
    
public java.lang.StringgetSpecVersion()

return
spec version of tld file

        return this.version;
    
public java.lang.StringgetSystemID()

return
system-id of the tld file.

        DocumentType docType = doc.getDoctype();
        return ((docType == null) ? null : docType.getSystemId());
    
public com.sun.enterprise.tools.verifier.web.TagDescriptor[]getTagDescriptors()
for each tag in the tag lib descriptor create a TagDescriptor and return the array of TagDescriptors present in the tag lib.

return

        NodeList nl = doc.getElementsByTagName(TAG);
        TagDescriptor[] tagdescriptor = null;
        if (nl != null) {
            int size = nl.getLength();
            tagdescriptor = new TagDescriptor[size];
            for (int i = 0; i < size; i++) {
                tagdescriptor[i] = new TagDescriptor(nl.item(i));
            }
        }
        return tagdescriptor;
    
public java.lang.StringgetUri()

return
location of the tld file

        return this.uri;