Java Code Examples for proguard.classfile.attribute.visitor.AttributeVisitor

The following examples show how to use proguard.classfile.attribute.visitor.AttributeVisitor. These examples are extracted from open source projects. 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
protected ClassVisitor createNonTestingClassVisitor(MemberSpecification memberSpecification,
                                                    boolean             isField,
                                                    MemberVisitor       memberVisitor,
                                                    AttributeVisitor    attributeVisitor,
                                                    WildcardManager wildcardManager)
{
    if (memberSpecification instanceof MemberValueSpecification)
    {
        // We can only know the value of this member specification at this
        // point.
        MemberValueSpecification memberValueSpecification =
            (MemberValueSpecification)memberSpecification;

        Number[] values = memberValueSpecification.values;
        if (values != null)
        {
            // Convert the Number array to a Value.
            Value value = value(values);

            // We're adding a member visitor to set the value.
            memberVisitor =
                new MultiMemberVisitor(
                    memberVisitor,
                    new OptimizationInfoMemberFilter(
                    new MyMemberValueSetter(value)));
        }
    }

    return super.createNonTestingClassVisitor(memberSpecification,
                                              isField,
                                              memberVisitor,
                                              attributeVisitor,
                                              wildcardManager);
}
 
Example 2
Source Project: bazel   Source File: ProgramMethod.java    License: Apache License 2.0 5 votes vote down vote up
public void attributesAccept(ProgramClass programClass, AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(programClass, this, attributeVisitor);
    }
}
 
Example 3
Source Project: java-n-IDE-for-Android   Source File: Attribute.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given field.
 */
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    // Delegate the default invocation if the field is null anyway.
    if (field == null)
    {
        accept(clazz, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 4
Source Project: java-n-IDE-for-Android   Source File: Attribute.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given code attribute.
 */
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    // Delegate the default invocation if the code attribute is null anyway.
    if (codeAttribute == null)
    {
        accept(clazz, method, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 5
Source Project: java-n-IDE-for-Android   Source File: CodeAttribute.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Applies the given attribute visitor to all attributes.
 */
public void attributesAccept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(clazz, method, this, attributeVisitor);
    }
}
 
Example 6
Source Project: java-n-IDE-for-Android   Source File: ProgramClass.java    License: Apache License 2.0 5 votes vote down vote up
public void attributesAccept(AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(this, attributeVisitor);
    }
}
 
Example 7
Source Project: java-n-IDE-for-Android   Source File: ProgramMethod.java    License: Apache License 2.0 5 votes vote down vote up
public void attributesAccept(ProgramClass programClass, AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(programClass, this, attributeVisitor);
    }
}
 
Example 8
Source Project: java-n-IDE-for-Android   Source File: ProgramField.java    License: Apache License 2.0 5 votes vote down vote up
public void attributesAccept(ProgramClass programClass, AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(programClass, this, attributeVisitor);
    }
}
 
Example 9
Source Project: bazel   Source File: Attribute.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given field.
 */
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    // Delegate to the default invocation if the field is null anyway.
    if (field == null)
    {
        accept(clazz, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 10
Source Project: proguard   Source File: Attribute.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given field.
 */
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    // Delegate to the default invocation if the field is null anyway.
    if (field == null)
    {
        accept(clazz, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 11
Source Project: proguard   Source File: Attribute.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given method.
 */
public void accept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
{
    // Delegate to the default invocation if the method is null anyway.
    if (method == null)
    {
        accept(clazz, (Field)null, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 12
Source Project: proguard   Source File: Attribute.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accepts the given visitor in the context of the given code attribute.
 */
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    // Delegate to the default invocation if the code attribute is null
    // anyway.
    if (codeAttribute == null)
    {
        accept(clazz, method, attributeVisitor);
    }
    else
    {
        throw new UnsupportedOperationException("Method must be overridden in ["+this.getClass().getName()+"] if ever called");
    }
}
 
Example 13
Source Project: bazel   Source File: ProgramField.java    License: Apache License 2.0 5 votes vote down vote up
public void attributesAccept(ProgramClass programClass, AttributeVisitor attributeVisitor)
{
    for (int index = 0; index < u2attributesCount; index++)
    {
        attributes[index].accept(programClass, this, attributeVisitor);
    }
}
 
Example 14
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitStackMapTableAttribute(clazz, method, codeAttribute, this);
}
 
Example 15
Source Project: java-n-IDE-for-Android   Source File: LibraryClass.java    License: Apache License 2.0 4 votes vote down vote up
public void attributesAccept(AttributeVisitor attributeVisitor)
{
    throw new UnsupportedOperationException("Library class ["+thisClassName+"] doesn't store attributes");
}
 
Example 16
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitLineNumberTableAttribute(clazz, method, codeAttribute, this);
}
 
Example 17
public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitRuntimeInvisibleTypeAnnotationsAttribute(clazz, this);
}
 
Example 18
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitLocalVariableTypeTableAttribute(clazz, method, codeAttribute, this);
}
 
Example 19
Source Project: bazel   Source File: UnknownAttribute.java    License: Apache License 2.0 4 votes vote down vote up
public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitUnknownAttribute(clazz, this);
}
 
Example 20
Source Project: java-n-IDE-for-Android   Source File: SyntheticAttribute.java    License: Apache License 2.0 4 votes vote down vote up
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitSyntheticAttribute(clazz, field, this);
}
 
Example 21
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitConstantValueAttribute(clazz, field, this);
}
 
Example 22
public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitRuntimeInvisibleAnnotationsAttribute(clazz, this);
}
 
Example 23
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitRuntimeInvisibleAnnotationsAttribute(clazz, field, this);
}
 
Example 24
Source Project: bazel   Source File: DeprecatedAttribute.java    License: Apache License 2.0 4 votes vote down vote up
public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitDeprecatedAttribute(clazz, field, this);
}
 
Example 25
Source Project: proguard   Source File: ChangedCodePrinter.java    License: GNU General Public License v2.0 4 votes vote down vote up
public ChangedCodePrinter(AttributeVisitor attributeVisitor)
{
    this.attributeVisitor = attributeVisitor;
}
 
Example 26
Source Project: bazel   Source File: UnknownAttribute.java    License: Apache License 2.0 4 votes vote down vote up
public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitUnknownAttribute(clazz, this);
}
 
Example 27
public void accept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitRuntimeVisibleAnnotationsAttribute(clazz, method, this);
}
 
Example 28
public void accept(Clazz clazz, Method method, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitAnnotationDefaultAttribute(clazz, method, this);
}
 
Example 29
public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitRuntimeInvisibleAnnotationsAttribute(clazz, this);
}
 
Example 30
public void accept(Clazz clazz, AttributeVisitor attributeVisitor)
{
    attributeVisitor.visitDeprecatedAttribute(clazz, this);
}