本文整理汇总了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));
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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.
}
示例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);
}
示例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.
}
示例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);
}