FileDocCategorySizeDatePackage
BaseAnnotations.javaAPI DocAndroid 5.1 API2333Thu Mar 12 22:18:30 GMT 2015com.android.dx.cf.attrib

BaseAnnotations

public abstract class BaseAnnotations extends BaseAttribute
Base class for annotations attributes.

Fields Summary
private final com.android.dx.rop.annotation.Annotations
annotations
{@code non-null;} list of annotations
private final int
byteLength
{@code >= 0;} attribute data length in the original classfile (not including the attribute header)
Constructors Summary
public BaseAnnotations(String attributeName, com.android.dx.rop.annotation.Annotations annotations, int byteLength)
Constructs an instance.

param
attributeName {@code non-null;} the name of the attribute
param
annotations {@code non-null;} the list of annotations
param
byteLength {@code >= 0;} attribute data length in the original classfile (not including the attribute header)

        super(attributeName);

        try {
            if (annotations.isMutable()) {
                throw new MutabilityException("annotations.isMutable()");
            }
        } catch (NullPointerException ex) {
            // Translate the exception.
            throw new NullPointerException("annotations == null");
        }

        this.annotations = annotations;
        this.byteLength = byteLength;
    
Methods Summary
public final intbyteLength()
{@inheritDoc}

        // Add six for the standard attribute header.
        return byteLength + 6;
    
public final com.android.dx.rop.annotation.AnnotationsgetAnnotations()
Gets the list of annotations associated with this instance.

return
{@code non-null;} the list

        return annotations;