當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。