Java Code Examples for org.apache.tomcat.util.bcel.classfile.ClassFormatException

The following examples show how to use org.apache.tomcat.util.bcel.classfile.ClassFormatException. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Tomcat8-Source-Read   Source File: ContextConfig.java    License: MIT License 5 votes vote down vote up
protected void processAnnotationsStream(InputStream is, WebXml fragment,
        boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache)
        throws ClassFormatException, IOException {

    ClassParser parser = new ClassParser(is);
    JavaClass clazz = parser.parse();
    checkHandlesTypes(clazz, javaClassCache);

    if (handlesTypesOnly) {
        return;
    }

    processClass(fragment, clazz);
}
 
Example 2
Source Project: Tomcat7.0.67   Source File: ContextConfig.java    License: Apache License 2.0 5 votes vote down vote up
protected void processAnnotationsStream(InputStream is, WebXml fragment,
        boolean handlesTypesOnly)
        throws ClassFormatException, IOException {

    ClassParser parser = new ClassParser(is);
    JavaClass clazz = parser.parse();
    checkHandlesTypes(clazz);

    if (handlesTypesOnly) {
        return;
    }

    String className = clazz.getClassName();

    AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries();
    if (annotationsEntries != null) {
        for (AnnotationEntry ae : annotationsEntries) {
            String type = ae.getAnnotationType();
            if ("Ljavax/servlet/annotation/WebServlet;".equals(type)) {
                processAnnotationWebServlet(className, ae, fragment);
            }else if ("Ljavax/servlet/annotation/WebFilter;".equals(type)) {
                processAnnotationWebFilter(className, ae, fragment);
            }else if ("Ljavax/servlet/annotation/WebListener;".equals(type)) {
                fragment.addListener(className);
            } else {
                // Unknown annotation - ignore
            }
        }
    }
}
 
Example 3
Source Project: tomee   Source File: OpenEJBContextConfig.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void processAnnotationsStream(final InputStream is, final WebXml fragment,
                                        final boolean handlesTypesOnly,
                                        final Map<String,JavaClassCacheEntry> javaClassCache)
        throws ClassFormatException, IOException {
    // no-op
}