12270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom/*
22270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * ProGuard -- shrinking, optimization, obfuscation, and preverification
32270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *             of Java bytecode.
42270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
52270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu)
62270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
72270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * This program is free software; you can redistribute it and/or modify it
82270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * under the terms of the GNU General Public License as published by the Free
92270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * Software Foundation; either version 2 of the License, or (at your option)
102270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * any later version.
112270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
122270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * This program is distributed in the hope that it will be useful, but WITHOUT
132270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
142270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
152270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * more details.
162270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
172270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * You should have received a copy of the GNU General Public License along
182270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * with this program; if not, write to the Free Software Foundation, Inc.,
192270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
202270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom */
212270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrompackage proguard.classfile.constant.visitor;
222270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
232270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstromimport proguard.classfile.Clazz;
242270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstromimport proguard.classfile.attribute.BootstrapMethodInfo;
252270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstromimport proguard.classfile.attribute.visitor.BootstrapMethodInfoVisitor;
262270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
272270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom/**
282270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * This BootstrapMethodInfoVisitor lets a given ConstantVisitor visit all
292270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * constant pool entries of the bootstrap methods it visits.
302270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
312270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom *
322270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom * @author Eric Lafortune
332270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom */
342270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrompublic class BootstrapMethodArgumentVisitor
352270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstromimplements   BootstrapMethodInfoVisitor
362270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom{
372270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    private ConstantVisitor constantVisitor;
382270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
392270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    /**
402270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom     * Creates a new BootstrapMethodArgumentVisitor that will delegate to the
412270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom     * given constant visitor.
422270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom     */
432270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    public BootstrapMethodArgumentVisitor(ConstantVisitor constantVisitor)
442270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    {
452270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom        this.constantVisitor = constantVisitor;
462270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    }
472270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
482270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
492270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    // Implementations for BootstrapMethodInfoVisitor.
502270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom
512270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo)
522270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    {
532270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom        // Check bootstrap method.
542270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom        bootstrapMethodInfo.methodArgumentsAccept(clazz, constantVisitor);
552270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom    }
562270795fbe0b277bfd49f40950ecaa78583175ccBrian Carlstrom}
57