Java Code Examples for net.bytebuddy.jar.asm.Opcodes#ASM7

The following examples show how to use net.bytebuddy.jar.asm.Opcodes#ASM7 . 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 File: ReturnHandlingMethodVisitor.java    From reactor-core with Apache License 2.0 5 votes vote down vote up
ReturnHandlingMethodVisitor(
        MethodVisitor visitor,
        String returnType,
        String currentClassName,
        String currentMethod,
        String currentSource,
        AtomicBoolean changed
) {
    super(Opcodes.ASM7, visitor);
    this.changed = changed;
    this.currentClassName = currentClassName;
    this.currentMethod = currentMethod;
    this.returnType = returnType;
    this.currentSource = currentSource;
}
 
Example 2
Source File: CallSiteInfoAddingMethodVisitor.java    From reactor-core with Apache License 2.0 5 votes vote down vote up
CallSiteInfoAddingMethodVisitor(
        MethodVisitor visitor,
        String currentClassName,
        String currentMethod,
        String currentSource,
        AtomicBoolean changed
) {
    super(Opcodes.ASM7, visitor);
    this.currentMethod = currentMethod;
    this.currentClassName = currentClassName;
    this.currentSource = currentSource;
    this.changed = changed;
}
 
Example 3
Source File: InstrumentationUtils.java    From BlockHound with Apache License 2.0 4 votes vote down vote up
MakePublicClassVisitor(ClassWriter cw) {
    super(Opcodes.ASM7, cw);
}
 
Example 4
Source File: RepeatedAnnotationVisitor.java    From flow with Apache License 2.0 4 votes vote down vote up
RepeatedAnnotationVisitor() {
    super(Opcodes.ASM7);
}
 
Example 5
Source File: FrontendClassVisitor.java    From flow with Apache License 2.0 4 votes vote down vote up
public FrontendMethodVisitor() {
    super(Opcodes.ASM7);
}
 
Example 6
Source File: FrontendClassVisitor.java    From flow with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new {@link ClassVisitor} that will be used for visiting a
 * specific class.
 *
 * @param className
 *            the class to visit
 * @param endPoint
 *            the end-point object that will be updated during the visit
 * @param themeScope
 *            whether we are visiting from Theme
 */
FrontendClassVisitor(String className, EndPointData endPoint,
        boolean themeScope) { // NOSONAR
    super(Opcodes.ASM7);
    this.className = className;
    this.endPoint = endPoint;

    // Visitor for each method in the class.
    methodVisitor = new FrontendMethodVisitor();
    // Visitor for each annotation in the class.
    routeVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            if (LAYOUT.equals(name)) {
                endPoint.layout = ((Type) value).getClassName();
                children.add(endPoint.layout);
            }
            if (VALUE.equals(name)) {
                endPoint.route = value.toString();
            }
        }
    };
    // Visitor for @Theme annotations in classes annotated with @Route
    themeRouteVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            if (VALUE.equals(name)) {
                endPoint.theme.name = ((Type) value).getClassName();
                children.add(endPoint.theme.name);
            } else if (VARIANT.equals(name)) {
                endPoint.theme.variant = value.toString();
            }
        }
    };
    // Visitor for @Theme annotations in classes extending RouterLayout
    themeLayoutVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            if (VALUE.equals(name) && endPoint.theme.name == null) {
                themeRouteVisitor.visit(name, value);
            } else if (VARIANT.equals(name)
                    && endPoint.theme.variant.isEmpty()) {
                themeRouteVisitor.visit(name, value);
            }
        }
    };
    // Visitor for @JsModule annotations
    jsModuleVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            if (themeScope) {
                endPoint.themeModules.add(value.toString());
            } else {
                endPoint.modules.add(value.toString());
            }
        }
    };
    // Visitor for @JavaScript annotations
    jScriptVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            endPoint.scripts.add(value.toString());
        }
    };
    // Visitor all other annotations
    annotationVisitor = new RepeatedAnnotationVisitor() {
        @Override
        public void visit(String name, Object value) {
            if (value != null && !value.getClass().isPrimitive()
                    && !value.getClass().equals(String.class)) {
                addSignatureToClasses(children, value.toString());
            }
        }
    };
}
 
Example 7
Source File: ReactorDebugClassVisitor.java    From reactor-core with Apache License 2.0 4 votes vote down vote up
ReactorDebugClassVisitor(ClassVisitor classVisitor, AtomicBoolean changed) {
	super(Opcodes.ASM7, classVisitor);
	this.changed = changed;
}
 
Example 8
Source File: FrontendAnnotatedClassVisitor.java    From flow with Apache License 2.0 2 votes vote down vote up
/**
 * Create a new {@link ClassVisitor} that will be used for visiting a
 * specific class to get the data of an annotation.
 *
 * @param finder
 *            The class finder to use
 * 
 * @param annotationName
 *            The annotation class name to visit
 */
FrontendAnnotatedClassVisitor(ClassFinder finder, String annotationName) {
    super(Opcodes.ASM7);
    this.finder = finder;
    this.annotationName = annotationName;
}