Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.TldMetaData


            try {
                ModuleClassLoader jsf = Module.getModuleFromCallerModuleLoader(moduleFactory.getImplModId(slot)).getClassLoader();
                for (String tld : JSF_TAGLIBS) {
                    InputStream is = jsf.getResourceAsStream("META-INF/" + tld);
                    if (is != null) {
                        TldMetaData tldMetaData = parseTLD(is);
                        jsfTlds.add(tldMetaData);
                    }
                }
            } catch (ModuleLoadException e) {
                // Ignore
View Full Code Here


        try {
            ModuleClassLoader jstl = Module.getModuleFromCallerModuleLoader(ModuleIdentifier.create("javax.servlet.jstl.api")).getClassLoader();
            for (String tld : JSTL_TAGLIBS) {
                InputStream is = jstl.getResourceAsStream("META-INF/" + tld);
                if (is != null) {
                    TldMetaData tldMetaData = parseTLD(tld, is);
                    jstlTlds.add(tldMetaData);
                }
            }
        } catch (ModuleLoadException e) {
            // Ignore
View Full Code Here

                            pathNameRelativeToRoot = child.getPathNameRelativeTo(deploymentRoot);
                        } catch (IllegalArgumentException e) {
                            throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.tldFileNotContainedInRoot(child.getPathName(),
                                    deploymentRoot.getPathName()), e);
                        }
                        final TldMetaData value = parseTLD(child);
                        value.setUri(tld.getTaglibUri());
                        uniqueTlds.add(value);
                        String key = "/" + pathNameRelativeToRoot;
                        if (!tlds.containsKey(key)) {
                            tlds.put(key, value);
                        }
                        if (!tlds.containsKey(tld.getTaglibUri())) {
                            tlds.put(tld.getTaglibUri(), value);
                        }
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    //todo: internataitonalization
                    UndertowLogger.ROOT_LOGGER.errorf("Could not find tld %s", tld.getTaglibLocation());
                }

            }
        }

        // TLDs are located in WEB-INF or any subdir (except the top level "classes" and "lib")
        // and in JARs from WEB-INF/lib, in META-INF or any subdir
        List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS);
        for (ResourceRoot resourceRoot : resourceRoots) {
            if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) {
                VirtualFile webFragment = resourceRoot.getRoot().getChild(META_INF);
                if (webFragment.exists() && webFragment.isDirectory()) {
                    processTlds(deploymentRoot, webFragment.getChildren(), tlds, uniqueTlds);
                }
            }
        }
        VirtualFile webInf = deploymentRoot.getChild(WEB_INF);
        if (webInf.exists() && webInf.isDirectory()) {
            for (VirtualFile file : webInf.getChildren()) {
                if (file.isFile() && file.getName().toLowerCase(Locale.ENGLISH).endsWith(TLD)) {
                    String pathNameRelativeToRoot;
                    try {
                        pathNameRelativeToRoot = file.getPathNameRelativeTo(deploymentRoot);
                    } catch (IllegalArgumentException e) {
                        throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.tldFileNotContainedInRoot(file.getPathName(),
                                deploymentRoot.getPathName()), e);
                    }

                    final TldMetaData value = parseTLD(file);
                    uniqueTlds.add(value);
                    String key = "/" + pathNameRelativeToRoot;
                    if (!tlds.containsKey(key)) {
                        tlds.put(key, value);
                    }
View Full Code Here

                    pathNameRelativeToRoot = file.getPathNameRelativeTo(root);
                } catch (IllegalArgumentException e) {
                    throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.tldFileNotContainedInRoot(file.getPathName(),
                            root.getPathName()), e);
                }
                final TldMetaData value = parseTLD(file);
                String key = "/" + pathNameRelativeToRoot;
                uniqueTlds.add(value);
                if (!tlds.containsKey(key)) {
                    tlds.put(key, value);
                }
View Full Code Here

    private TldMetaData parseTLD(VirtualFile tld)
            throws DeploymentUnitProcessingException {
        if (IMPLICIT_TLD.equals(tld.getName())) {
            // Implicit TLDs are different from regular TLDs
            return new TldMetaData();
        }
        InputStream is = null;
        try {
            is = tld.openStream();
            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
View Full Code Here

                        continue;
                    }
                    if(resource.getURL().getProtocol().equals("vfs")) {
                        continue;
                    }
                    final TldMetaData value = parseTLD(resource);
                    if(sharedTldUris.contains(value.getUri())) {
                        //don't re-include shared TLD's
                        continue;
                    }
                    String key = "/" + resource.getName();
                    if (!tlds.containsKey(key)) {
                        tlds.put(key, value);
                    }
                    if (!tlds.containsKey(value.getUri())) {
                        tlds.put(value.getUri(), value);
                    }
                    if (value.getListeners() != null) {
                        for (ListenerMetaData l : value.getListeners()) {
                            List<ListenerMetaData> listeners = warMetaData.getMergedJBossWebMetaData().getListeners();
                            if(listeners == null) {
                                warMetaData.getMergedJBossWebMetaData().setListeners(listeners = new ArrayList<ListenerMetaData>());
                            }
                            listeners.add(l);
View Full Code Here

    private TldMetaData parseTLD(Resource tld)
            throws DeploymentUnitProcessingException {
        if (IMPLICIT_TLD.equals(tld.getName())) {
            // Implicit TLDs are different from regular TLDs
            return new TldMetaData();
        }
        InputStream is = null;
        try {
            is = tld.openStream();
            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
View Full Code Here

    private TldMetaData parseTLD(VirtualFile tld)
    throws DeploymentUnitProcessingException {
        if (IMPLICIT_TLD.equals(tld.getName())) {
            // Implicit TLDs are different from regular TLDs
            return new TldMetaData();
        }
        InputStream is = null;
        try {
            is = tld.openStream();
            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
View Full Code Here

        try {
            ModuleClassLoader jsf = Module.getModuleFromCallerModuleLoader(ModuleIdentifier.create("com.sun.jsf-impl")).getClassLoader();
            for (String tld : JSF_TAGLIBS) {
                InputStream is = jsf.getResourceAsStream("META-INF/" + tld);
                if (is != null) {
                    TldMetaData tldMetaData = parseTLD(tld, is);
                    jsfTlds.add(tldMetaData);
                }
            }
        } catch (ModuleLoadException e) {
            // Ignore
        } catch (Exception e) {
            // Ignore
        }
        try {
            ModuleClassLoader jstl = Module.getModuleFromCallerModuleLoader(ModuleIdentifier.create("javax.servlet.jstl.api")).getClassLoader();
            for (String tld : JSTL_TAGLIBS) {
                InputStream is = jstl.getResourceAsStream("META-INF/" + tld);
                if (is != null) {
                    TldMetaData tldMetaData = parseTLD(tld, is);
                    jstlTlds.add(tldMetaData);
                }
            }
        } catch (ModuleLoadException e) {
            // Ignore
View Full Code Here

    private TldMetaData parseTLD(VirtualFile tld)
    throws DeploymentUnitProcessingException {
        if (IMPLICIT_TLD.equals(tld.getName())) {
            // Implicit TLDs are different from regular TLDs
            return new TldMetaData();
        }
        InputStream is = null;
        try {
            is = tld.openStream();
            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.TldMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.