@Override public boolean equals( Object o1, Object o2 ) { JavaClass THIS = (JavaClass) o1; JavaClass THAT = (JavaClass) o2; return THIS.getClassName().equals(THAT.getClassName()); }
public JavaClassCacheEntry(JavaClass javaClass) { superclassName = javaClass.getSuperclassName(); interfaceNames = javaClass.getInterfaceNames(); }
protected void processClass(WebXml fragment, JavaClass clazz) { AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries(); if (annotationsEntries != null) { String className = clazz.getClassName(); 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 } } } }
return; if ((javaClass.getAccessFlags() & org.apache.tomcat.util.bcel.Constants.ACC_ANNOTATION) > 0) { String className = javaClass.getClassName(); if (entry.getKey().isAnnotation()) { AnnotationEntry[] annotationEntries = javaClass.getAnnotationEntries(); for (AnnotationEntry annotationEntry : annotationEntries) { if (entry.getKey().getName().equals(
buf.append("access flags\t\t").append(access_flags).append('\n'); buf.append("constant pool\t\t").append(constant_pool.getLength()).append(" entries\n"); buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n"); if (attributes.length > 0) { buf.append("\nAttribute(s):\n"); for (int i = 0; i < attributes.length; i++) { buf.append(indent(attributes[i])); AnnotationEntry[] annotations = getAnnotationEntries(); if (annotations!=null && annotations.length>0) { buf.append("\nAnnotation(s):\n"); for (int i=0; i<annotations.length; i++) buf.append(indent(annotations[i]));
protected void processAnnotationsStream(InputStream is) throws ClassFormatException, IOException { ClassParser parser = new ClassParser(is, null); JavaClass clazz = parser.parse(); AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries(); for (AnnotationEntry ae : annotationsEntries) { String type = ae.getAnnotationType(); if ("Ljavax/servlet/annotation/WebServlet;".equals(type)) { hasWebAnnotations=true; }else if ("Ljavax/servlet/annotation/WebFilter;".equals(type)) { hasWebAnnotations=true; }else if ("Ljavax/servlet/annotation/WebListener;".equals(type)) { hasWebAnnotations=true; }else if ("Ljavax/servlet/annotation/WebInitParam;".equals(type)) { hasWebAnnotations=true; }else if ("Ljavax/servlet/annotation/MultipartConfig;".equals(type)) { hasWebAnnotations=true; } else { // Unknown annotation - ignore } } }
return new JavaClass(class_name_index, superclass_name_index, file_name, major, minor, access_flags, constant_pool, interfaces, fields, methods, attributes);
public AnnotationEntry[] getAnnotationEntries() { if (annotationsOutOfDate) { // Find attributes that contain annotation data Attribute[] attrs = getAttributes(); List<AnnotationEntry> accumulatedAnnotations = new ArrayList<AnnotationEntry>(); for (int i = 0; i < attrs.length; i++) { Attribute attribute = attrs[i]; if (attribute instanceof Annotations) { Annotations runtimeAnnotations = (Annotations)attribute; for(int j = 0; j < runtimeAnnotations.getAnnotationEntries().length; j++) accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]); } } annotations = accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]); annotationsOutOfDate = false; } return annotations; }
protected void processAnnotationsStream(InputStream is, WebXml fragment) throws ClassFormatException, IOException { ClassParser parser = new ClassParser(is, null); JavaClass clazz = parser.parse(); checkHandlesTypes(clazz); String className = clazz.getClassName(); AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries(); 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 } } }
if ((javaClass.getAccessFlags() & org.apache.tomcat.util.bcel.Const.ACC_ANNOTATION) != 0) { String className = javaClass.getClassName(); AnnotationEntry[] annotationEntries = javaClass.getAnnotationEntries(); if (annotationEntries != null) { for (Map.Entry<Class<?>, Set<ServletContainerInitializer>> entry :
buf.append("access flags\t\t").append(access_flags).append('\n'); buf.append("constant pool\t\t").append(constant_pool.getLength()).append(" entries\n"); buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n"); if (attributes.length > 0) { buf.append("\nAttribute(s):\n"); for (int i = 0; i < attributes.length; i++) { buf.append(indent(attributes[i])); AnnotationEntry[] annotations = getAnnotationEntries(); if (annotations!=null && annotations.length>0) { buf.append("\nAnnotation(s):\n"); for (int i=0; i<annotations.length; i++) buf.append(indent(annotations[i]));
return new JavaClass(class_name_index, superclass_name_index, file_name, major, minor, access_flags, constant_pool, interfaces, fields, methods, attributes);
public AnnotationEntry[] getAnnotationEntries() { if (annotationsOutOfDate) { // Find attributes that contain annotation data Attribute[] attrs = getAttributes(); List<AnnotationEntry> accumulatedAnnotations = new ArrayList<AnnotationEntry>(); for (int i = 0; i < attrs.length; i++) { Attribute attribute = attrs[i]; if (attribute instanceof Annotations) { Annotations runtimeAnnotations = (Annotations)attribute; for(int j = 0; j < runtimeAnnotations.getAnnotationEntries().length; j++) accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]); } } annotations = accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]); annotationsOutOfDate = false; } return annotations; }
protected void processAnnotationsStream(InputStream is, WebXml fragment) throws ClassFormatException, IOException { ClassParser parser = new ClassParser(is, null); JavaClass clazz = parser.parse(); checkHandlesTypes(clazz); String className = clazz.getClassName(); AnnotationEntry[] annotationsEntries = clazz.getAnnotationEntries(); 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 } } }
if ((javaClass.getAccessFlags() & org.apache.tomcat.util.bcel.Constants.ACC_ANNOTATION) > 0) { String className = javaClass.getClassName(); if (entry.getKey().isAnnotation()) { AnnotationEntry[] annotationEntries = javaClass.getAnnotationEntries(); for (AnnotationEntry annotationEntry : annotationEntries) { if (entry.getKey().getName().equals(
/** * Return the natural ordering of two JavaClasses. * This ordering is based on the class name */ @Override public int compareTo(JavaClass obj) { return getClassName().compareTo(obj.getClassName()); }
public JavaClassCacheEntry(JavaClass javaClass) { superclassName = javaClass.getSuperclassName(); interfaceNames = javaClass.getInterfaceNames(); }
buf.append("access flags\t\t").append(access_flags).append('\n'); buf.append("constant pool\t\t").append(constant_pool.getLength()).append(" entries\n"); buf.append("ACC_SUPER flag\t\t").append(isSuper()).append("\n"); if (attributes.length > 0) { buf.append("\nAttribute(s):\n"); for (int i = 0; i < attributes.length; i++) { buf.append(indent(attributes[i])); AnnotationEntry[] annotations = getAnnotationEntries(); if (annotations!=null && annotations.length>0) { buf.append("\nAnnotation(s):\n"); for (int i=0; i<annotations.length; i++) buf.append(indent(annotations[i]));
return new JavaClass(class_name_index, superclass_name_index, file_name, major, minor, access_flags, constant_pool, interfaces, fields, methods, attributes);
public AnnotationEntry[] getAnnotationEntries() { if (annotationsOutOfDate) { // Find attributes that contain annotation data Attribute[] attrs = getAttributes(); List<AnnotationEntry> accumulatedAnnotations = new ArrayList<AnnotationEntry>(); for (int i = 0; i < attrs.length; i++) { Attribute attribute = attrs[i]; if (attribute instanceof Annotations) { Annotations runtimeAnnotations = (Annotations)attribute; for(int j = 0; j < runtimeAnnotations.getAnnotationEntries().length; j++) accumulatedAnnotations.add(runtimeAnnotations.getAnnotationEntries()[j]); } } annotations = accumulatedAnnotations.toArray(new AnnotationEntry[accumulatedAnnotations.size()]); annotationsOutOfDate = false; } return annotations; }