📄 libraryclass.java
字号:
classVisitor); } } // Then visit its interfaces, recursively. if (visitInterfaces) { if (interfaceClasses != null) { for (int index = 0; index < interfaceClasses.length; index++) { Clazz interfaceClass = interfaceClasses[index]; if (interfaceClass != null) { interfaceClass.hierarchyAccept(true, true, true, false, classVisitor); } } } } // Then visit its subclasses, recursively. if (visitSubclasses) { if (subClasses != null) { for (int index = 0; index < subClasses.length; index++) { subClasses[index].hierarchyAccept(true, false, false, true, classVisitor); } } } } public void constantPoolEntriesAccept(ConstantVisitor constantVisitor) { // This class doesn't keep references to its constant pool entries. } public void constantPoolEntryAccept(int index, ConstantVisitor constantVisitor) { // This class doesn't keep references to its constant pool entries. } public void fieldsAccept(MemberVisitor memberVisitor) { for (int index = 0; index < fields.length; index++) { Field field = fields[index]; if (field != null) { field.accept(this, memberVisitor); } } } public void fieldAccept(String name, String descriptor, MemberVisitor memberVisitor) { Field field = findField(name, descriptor); if (field != null) { field.accept(this, memberVisitor); } } public void methodsAccept(MemberVisitor memberVisitor) { for (int index = 0; index < methods.length; index++) { Method method = methods[index]; if (method != null) { method.accept(this, memberVisitor); } } } public void methodAccept(String name, String descriptor, MemberVisitor memberVisitor) { Method method = findMethod(name, descriptor); if (method != null) { method.accept(this, memberVisitor); } } public boolean mayHaveImplementations(Method method) { return (u2accessFlags & ClassConstants.INTERNAL_ACC_FINAL) == 0 && (method == null || ((method.getAccessFlags() & (ClassConstants.INTERNAL_ACC_PRIVATE | ClassConstants.INTERNAL_ACC_STATIC | ClassConstants.INTERNAL_ACC_FINAL)) == 0 && !method.getName(this).equals(ClassConstants.INTERNAL_METHOD_NAME_INIT))); } private boolean isSpecial(Method method) { return (method.getAccessFlags() & (ClassConstants.INTERNAL_ACC_PRIVATE | ClassConstants.INTERNAL_ACC_STATIC)) != 0 || method.getName(this).equals(ClassConstants.INTERNAL_METHOD_NAME_INIT); } public void methodImplementationsAccept(Method method, boolean visitThisMethod, MemberVisitor memberVisitor) { methodImplementationsAccept(method.getName(this), method.getDescriptor(this), method, visitThisMethod, true, true, true, memberVisitor); } public void methodImplementationsAccept(String name, String descriptor, boolean visitThisMethod, MemberVisitor memberVisitor) { methodImplementationsAccept(name, descriptor, visitThisMethod, true, true, true, memberVisitor); } public void methodImplementationsAccept(String name, String descriptor, boolean visitThisMethod, boolean visitSpecialMethods, boolean visitSuperMethods, boolean visitOverridingMethods, MemberVisitor memberVisitor) { methodImplementationsAccept(name, descriptor, findMethod(name, descriptor), visitThisMethod, visitSpecialMethods, visitSuperMethods, visitOverridingMethods, memberVisitor); } public void methodImplementationsAccept(String name, String descriptor, Method method, boolean visitThisMethod, boolean visitSpecialMethods, boolean visitSuperMethods, boolean visitOverridingMethods, MemberVisitor memberVisitor) { // Do we have the method in this class? if (method != null) { // Is it a special method? if (isSpecial(method)) { // Visit the special method in this class, if allowed. if (visitSpecialMethods) { method.accept(this, memberVisitor); // The method can't have any other implementations. return; } } else { // Visit the method in this class, if allowed. if (visitThisMethod) { method.accept(this, memberVisitor); } // We don't have to look in subclasses if there can't be // any overriding implementations. if (!mayHaveImplementations(method)) { visitOverridingMethods = false; } // We don't have to look in superclasses if we have a concrete // implementation here. if ((method.getAccessFlags() & ClassConstants.INTERNAL_ACC_ABSTRACT) == 0) { visitSuperMethods = false; } } } // Then visit the method in its subclasses, recursively. if (visitOverridingMethods) { // Go looking for implementations in all of the subclasses. if (subClasses != null) { for (int index = 0; index < subClasses.length; index++) { Clazz subClass = subClasses[index]; subClass.methodImplementationsAccept(name, descriptor, true, false, visitSuperMethods, true, memberVisitor); } } // We don't have to look in superclasses right away if we dont't // have a concrete class here. if ((u2accessFlags & (ClassConstants.INTERNAL_ACC_INTERFACE | ClassConstants.INTERNAL_ACC_ABSTRACT)) != 0) { visitSuperMethods = false; } } // Then visit the method in its superclass, recursively. if (visitSuperMethods) { Clazz superClass = getSuperClass(); if (superClass != null) { superClass.methodImplementationsAccept(name, descriptor, true, false, true, false, memberVisitor); } } } public void attributesAccept(AttributeVisitor attributeVisitor) { throw new UnsupportedOperationException("Library class ["+thisClassName+"] doesn't store attributes"); } // Implementations for VisitorAccepter. public Object getVisitorInfo() { return visitorInfo; } public void setVisitorInfo(Object visitorInfo) { this.visitorInfo = visitorInfo; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -