Java Code Examples for proguard.classfile.ClassConstants#INTERNAL_TYPE_CLASS_START

The following examples show how to use proguard.classfile.ClassConstants#INTERNAL_TYPE_CLASS_START . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InternalTypeEnumeration.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the next type from the method descriptor.
 */
public String nextType()
{
    int startIndex = index;

    skipArray();

    char c = descriptor.charAt(index++);
    switch (c)
    {
        case ClassConstants.INTERNAL_TYPE_CLASS_START:
        case ClassConstants.INTERNAL_TYPE_GENERIC_VARIABLE_START:
        {
            skipClass();
            break;
        }
        case ClassConstants.INTERNAL_TYPE_GENERIC_START:
        {
            skipGeneric();
            break;
        }
    }

    return descriptor.substring(startIndex, index);
}
 
Example 2
Source File: ReferenceValue.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public final String internalType()
{
    return
        type == null                        ? ClassConstants.INTERNAL_TYPE_JAVA_LANG_OBJECT :
        ClassUtil.isInternalArrayType(type) ? type                                          :
                                              ClassConstants.INTERNAL_TYPE_CLASS_START +
                                              type +
                                              ClassConstants.INTERNAL_TYPE_CLASS_END;
}
 
Example 3
Source File: FieldOptimizationInfo.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
private Value initialValue(String type)
{
    switch (type.charAt(0))
    {
        case ClassConstants.INTERNAL_TYPE_BOOLEAN:
        case ClassConstants.INTERNAL_TYPE_BYTE:
        case ClassConstants.INTERNAL_TYPE_CHAR:
        case ClassConstants.INTERNAL_TYPE_SHORT:
        case ClassConstants.INTERNAL_TYPE_INT:
            return VALUE_FACTORY.createIntegerValue(0);

        case ClassConstants.INTERNAL_TYPE_LONG:
            return VALUE_FACTORY.createLongValue(0L);

        case ClassConstants.INTERNAL_TYPE_FLOAT:
            return VALUE_FACTORY.createFloatValue(0.0f);

        case ClassConstants.INTERNAL_TYPE_DOUBLE:
            return VALUE_FACTORY.createDoubleValue(0.0);

        case ClassConstants.INTERNAL_TYPE_CLASS_START:
        case ClassConstants.INTERNAL_TYPE_ARRAY:
            return VALUE_FACTORY.createReferenceValueNull();

        default:
            throw new IllegalArgumentException("Invalid type ["+type+"]");
    }
}
 
Example 4
Source File: ClassNameParser.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a StringMatcher that matches any type (class or primitive type,
 * array or non-array) and then the given matcher.
 */
private VariableStringMatcher createAnyTypeMatcher(StringMatcher nextMatcher)
{
    return new VariableStringMatcher(new char[] { ClassConstants.INTERNAL_TYPE_ARRAY },
                              null,
                              0,
                              255,
    new OrMatcher(
    new VariableStringMatcher(INTERNAL_PRIMITIVE_TYPES,
                              null,
                              1,
                              1,
                              nextMatcher),
    new VariableStringMatcher(new char[] { ClassConstants.INTERNAL_TYPE_CLASS_START },
                              null,
                              1,
                              1,
    new VariableStringMatcher(null,
                              new char[] { ClassConstants.INTERNAL_TYPE_CLASS_END },
                              0,
                              Integer.MAX_VALUE,
    new VariableStringMatcher(new char[] { ClassConstants.INTERNAL_TYPE_CLASS_END },
                              null,
                              1,
                              1,
                              nextMatcher)))));
}