当前位置: 首页>>代码示例>>Java>>正文


Java RefConstant类代码示例

本文整理汇总了Java中proguard.classfile.constant.RefConstant的典型用法代码示例。如果您正苦于以下问题:Java RefConstant类的具体用法?Java RefConstant怎么用?Java RefConstant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RefConstant类属于proguard.classfile.constant包,在下文中一共展示了RefConstant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitAnyMethodrefConstant

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
public void visitAnyMethodrefConstant(Clazz clazz, RefConstant methodrefConstant)
{
    String type = methodrefConstant.getType(clazz);

    // Count the number of parameters.
    int parameterCount = ClassUtil.internalMethodParameterCount(type);
    if (!isStatic)
    {
        parameterCount++;
    }

    // Pop the parameters and the class reference, in reverse order.
    for (int parameterIndex = parameterCount-1; parameterIndex >= 0; parameterIndex--)
    {
        setMethodParameterValue(clazz, methodrefConstant, parameterIndex, stack.pop());
    }

    // Push the return value, if applicable.
    String returnType = ClassUtil.internalMethodReturnType(type);
    if (returnType.charAt(0) != ClassConstants.INTERNAL_TYPE_VOID)
    {
        stack.push(getMethodReturnValue(clazz, methodrefConstant, returnType));
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:25,代码来源:BasicInvocationUnit.java

示例2: visitAnyRefConstant

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
public void visitAnyRefConstant(Clazz clazz, RefConstant refConstant)
{
    if (shouldBeMarkedAsUsed(refConstant))
    {
        markAsUsed(refConstant);

        markConstant(clazz, refConstant.u2classIndex);
        markConstant(clazz, refConstant.u2nameAndTypeIndex);

        // When compiled with "-target 1.2" or higher, the class or
        // interface actually containing the referenced class member may
        // be higher up the hierarchy. Make sure it's marked, in case it
        // isn't used elsewhere.
        refConstant.referencedClassAccept(this);

        // Mark the referenced class member itself.
        refConstant.referencedMemberAccept(this);
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:20,代码来源:UsageMarker.java

示例3: visitAnyMethodrefConstant

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
public void visitAnyMethodrefConstant(Clazz clazz, RefConstant refConstant)
{
    // Remember the referenced class. Note that we're interested in the
    // class of the method reference, not in the class in which the
    // method was actually found, unless it is an array type.
    //
    if (ClassUtil.isInternalArrayType(refConstant.getClassName(clazz)))
    {
        // For an array type, the class will be java.lang.Object.
        referencedClass = refConstant.referencedClass;
    }
    else
    {
        clazz.constantPoolEntryAccept(refConstant.u2classIndex, this);
    }

    // Remember the referenced method.
    referencedMethodClass = refConstant.referencedClass;
    referencedMethod      = refConstant.referencedMember;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:21,代码来源:MethodInvocationFixer.java

示例4: getFieldClassValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getFieldClassValue(Clazz       clazz,
                                   RefConstant refConstant,
                                   String      type)
{
    if (loadFieldValues)
    {
        // Do we know this field?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored field class value.
            ReferenceValue value = StoringInvocationUnit.getFieldClassValue((Field)referencedMember);
            if (value != null &&
                value.isParticular())
            {
                return value;
            }
        }
    }

    return super.getFieldClassValue(clazz, refConstant, type);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:23,代码来源:LoadingInvocationUnit.java

示例5: getFieldValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getFieldValue(Clazz       clazz,
                              RefConstant refConstant,
                              String      type)
{
    if (loadFieldValues)
    {
        // Do we know this field?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored field value.
            Value value = StoringInvocationUnit.getFieldValue((Field)referencedMember);
            if (value != null &&
                value.isParticular())
            {
                return value;
            }
        }
    }

    return super.getFieldValue(clazz, refConstant, type);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:23,代码来源:LoadingInvocationUnit.java

示例6: getMethodReturnValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getMethodReturnValue(Clazz       clazz,
                                     RefConstant refConstant,
                                     String      type)
{
    if (loadMethodReturnValues)
    {
        // Do we know this method?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored method return value.
            Value value = StoringInvocationUnit.getMethodReturnValue((Method)referencedMember);
            if (value != null &&
                value.isParticular())
            {
                return value;
            }
        }
    }

    return super.getMethodReturnValue(clazz,
                                      refConstant,
                                      type);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:25,代码来源:LoadingInvocationUnit.java

示例7: setMethodParameterValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected void setMethodParameterValue(Clazz       clazz,
                                       RefConstant refConstant,
                                       int         parameterIndex,
                                       Value value)
{
    if (storeMethodParameterValues)
    {
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            generalizeMethodParameterValue((Method)referencedMember,
                                           parameterIndex,
                                           value);
        }
    }
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:17,代码来源:StoringInvocationUnit.java

示例8: getFieldClassValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getFieldClassValue(Clazz       clazz,
                                   RefConstant refConstant,
                                   String      type)
{
    if (loadFieldValues)
    {
        // Do we know this field?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored field class value.
            ReferenceValue value = StoringInvocationUnit.getFieldClassValue((Field)referencedMember);
            if (value != null)
            {
                return value;
            }
        }
    }

    return super.getFieldClassValue(clazz, refConstant, type);
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:22,代码来源:LoadingInvocationUnit.java

示例9: getFieldValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getFieldValue(Clazz       clazz,
                              RefConstant refConstant,
                              String      type)
{
    if (loadFieldValues)
    {
        // Do we know this field?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored field value.
            Value value = StoringInvocationUnit.getFieldValue((Field)referencedMember);
            if (value != null)
            {
                return value;
            }
        }
    }

    return super.getFieldValue(clazz, refConstant, type);
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:22,代码来源:LoadingInvocationUnit.java

示例10: getMethodReturnValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected Value getMethodReturnValue(Clazz       clazz,
                                     RefConstant refConstant,
                                     String      type)
{
    if (loadMethodReturnValues)
    {
        // Do we know this method?
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            // Retrieve the stored method return value.
            Value value = StoringInvocationUnit.getMethodReturnValue((Method)referencedMember);
            if (value != null)
            {
                return value;
            }
        }
    }

    return super.getMethodReturnValue(clazz,
                                      refConstant,
                                      type);
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:24,代码来源:LoadingInvocationUnit.java

示例11: setMethodParameterValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
protected void setMethodParameterValue(Clazz       clazz,
                                       RefConstant refConstant,
                                       int         parameterIndex,
                                       Value       value)
{
    if (storeMethodParameterValues)
    {
        Member referencedMember = refConstant.referencedMember;
        if (referencedMember != null)
        {
            generalizeMethodParameterValue((Method)referencedMember,
                                           parameterIndex,
                                           value);
        }
    }
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:17,代码来源:StoringInvocationUnit.java

示例12: setFieldClassValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
/**
 * Sets the class through which the specified field is accessed.
 */
protected void setFieldClassValue(Clazz          clazz,
                                  RefConstant refConstant,
                                  ReferenceValue value)
{
    // We don't care about the new value.
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:10,代码来源:BasicInvocationUnit.java

示例13: getFieldClassValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
/**
 * Returns the class though which the specified field is accessed.
 */
protected Value getFieldClassValue(Clazz       clazz,
                                   RefConstant refConstant,
                                   String      type)
{
    // Try to figure out the class of the return type.
    returnTypeClass = null;
    refConstant.referencedMemberAccept(this);

    return valueFactory.createValue(type,
                                    returnTypeClass,
                                    true);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:16,代码来源:BasicInvocationUnit.java

示例14: setFieldValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
/**
 * Sets the value of the specified field.
 */
protected void setFieldValue(Clazz       clazz,
                             RefConstant refConstant,
                             Value value)
{
    // We don't care about the new field value.
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:10,代码来源:BasicInvocationUnit.java

示例15: getFieldValue

import proguard.classfile.constant.RefConstant; //导入依赖的package包/类
/**
 * Returns the value of the specified field.
 */
protected Value getFieldValue(Clazz       clazz,
                              RefConstant refConstant,
                              String      type)
{
    // Try to figure out the class of the return type.
    returnTypeClass = null;
    refConstant.referencedMemberAccept(this);

    return valueFactory.createValue(type,
                                    returnTypeClass,
                                    true);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:16,代码来源:BasicInvocationUnit.java


注:本文中的proguard.classfile.constant.RefConstant类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。