FileDocCategorySizeDatePackage
ThrowingCstInsn.javaAPI DocAndroid 5.1 API3479Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.code

ThrowingCstInsn

public final class ThrowingCstInsn extends CstInsn
Instruction which contains an explicit reference to a constant and which might throw an exception.

Fields Summary
private final com.android.dx.rop.type.TypeList
catches
{@code non-null;} list of exceptions caught
Constructors Summary
public ThrowingCstInsn(Rop opcode, SourcePosition position, RegisterSpecList sources, com.android.dx.rop.type.TypeList catches, com.android.dx.rop.cst.Constant cst)
Constructs an instance.

param
opcode {@code non-null;} the opcode
param
position {@code non-null;} source position
param
sources {@code non-null;} specs for all the sources
param
catches {@code non-null;} list of exceptions caught
param
cst {@code non-null;} the constant

        super(opcode, position, null, sources, cst);

        if (opcode.getBranchingness() != Rop.BRANCH_THROW) {
            throw new IllegalArgumentException("bogus branchingness");
        }

        if (catches == null) {
            throw new NullPointerException("catches == null");
        }

        this.catches = catches;
    
Methods Summary
public voidaccept(Visitor visitor)
{@inheritDoc}

        visitor.visitThrowingCstInsn(this);
    
public com.android.dx.rop.type.TypeListgetCatches()
{@inheritDoc}

        return catches;
    
public java.lang.StringgetInlineString()
{@inheritDoc}

        Constant cst = getConstant();
        String constantString = cst.toHuman();
        if (cst instanceof CstString) {
            constantString = ((CstString) cst).toQuoted();
        }
        return constantString + " " + ThrowingInsn.toCatchString(catches);
    
public InsnwithAddedCatch(com.android.dx.rop.type.Type type)
{@inheritDoc}

        return new ThrowingCstInsn(getOpcode(), getPosition(),
                                   getSources(), catches.withAddedType(type),
                                   getConstant());
    
public InsnwithNewRegisters(RegisterSpec result, RegisterSpecList sources)
{@inheritDoc}


        return new ThrowingCstInsn(getOpcode(), getPosition(),
                                   sources,
                                   catches,
                                   getConstant());
    
public InsnwithRegisterOffset(int delta)
{@inheritDoc}

        return new ThrowingCstInsn(getOpcode(), getPosition(),
                                   getSources().withOffset(delta),
                                   catches,
                                   getConstant());