Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.file

public final Class AnnotationUtils

extends Object
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.annotation.Annotation, .NameValuePair, org.droidparts.dexmaker.dx.rop.cst.*, org.droidparts.dexmaker.dx.rop.type.Type, .TypeList, java.util.ArrayList

Utility class for dealing with annotations.

Field Summary

Modifier and TypeField and Description
private static final CstString
ACCESS_FLAGS_STRING

non-null; the UTF-8 constant "accessFlags"

private static final CstType
ANNOTATION_DEFAULT_TYPE

non-null; type for AnnotationDefault annotations

private static final CstType
ENCLOSING_CLASS_TYPE

non-null; type for EnclosingClass annotations

private static final CstType
ENCLOSING_METHOD_TYPE

non-null; type for EnclosingMethod annotations

private static final CstType
INNER_CLASS_TYPE

non-null; type for InnerClass annotations

private static final CstType
MEMBER_CLASSES_TYPE

non-null; type for MemberClasses annotations

private static final CstString
NAME_STRING

non-null; the UTF-8 constant "name"

private static final CstType
SIGNATURE_TYPE

non-null; type for Signature annotations

private static final CstType
THROWS_TYPE

non-null; type for Throws annotations

private static final CstString
VALUE_STRING

non-null; the UTF-8 constant "value"

Constructor Summary

AccessConstructor and Description
private
AnnotationUtils()

This class is uninstantiable.

Method Summary

Modifier and TypeMethod and Description
public static Annotation

Returns:

non-null; the constructed annotation
makeAnnotationDefault
(Annotation
non-null; the defaults, itself as an annotation
defaults
)

Constructs a standard AnnotationDefault annotation.

private static CstArray

Returns:

non-null; the corresponding array constant
makeCstArray
(TypeList
non-null; the type list
types
)

Converts a TypeList to a CstArray.

public static Annotation

Returns:

non-null; the annotation
makeEnclosingClass
(CstType
non-null; the enclosing class
clazz
)

Constructs a standard EnclosingClass annotation.

public static Annotation

Returns:

non-null; the annotation
makeEnclosingMethod
(CstMethodRef
non-null; the enclosing method
method
)

Constructs a standard EnclosingMethod annotation.

public static Annotation

Returns:

non-null; the annotation
makeInnerClass
(CstString
null-ok; the original name of the class, or null to represent an anonymous class
name
,
int
the original access flags
accessFlags
)

Constructs a standard InnerClass annotation.

public static Annotation

Returns:

non-null; the annotation
makeMemberClasses
(TypeList
non-null; the list of (the types of) the member classes
types
)

Constructs a standard MemberClasses annotation.

public static Annotation

Returns:

non-null; the annotation
makeSignature
(CstString
non-null; the signature string
signature
)

Constructs a standard Signature annotation.

public static Annotation

Returns:

non-null; the annotation
makeThrows
(TypeList
non-null; the list of thrown types
types
)

Constructs a standard Throws annotation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACCESS_FLAGS_STRINGback to summary
private static final CstString ACCESS_FLAGS_STRING

non-null; the UTF-8 constant "accessFlags"

ANNOTATION_DEFAULT_TYPEback to summary
private static final CstType ANNOTATION_DEFAULT_TYPE

non-null; type for AnnotationDefault annotations

ENCLOSING_CLASS_TYPEback to summary
private static final CstType ENCLOSING_CLASS_TYPE

non-null; type for EnclosingClass annotations

ENCLOSING_METHOD_TYPEback to summary
private static final CstType ENCLOSING_METHOD_TYPE

non-null; type for EnclosingMethod annotations

INNER_CLASS_TYPEback to summary
private static final CstType INNER_CLASS_TYPE

non-null; type for InnerClass annotations

MEMBER_CLASSES_TYPEback to summary
private static final CstType MEMBER_CLASSES_TYPE

non-null; type for MemberClasses annotations

NAME_STRINGback to summary
private static final CstString NAME_STRING

non-null; the UTF-8 constant "name"

SIGNATURE_TYPEback to summary
private static final CstType SIGNATURE_TYPE

non-null; type for Signature annotations

THROWS_TYPEback to summary
private static final CstType THROWS_TYPE

non-null; type for Throws annotations

VALUE_STRINGback to summary
private static final CstString VALUE_STRING

non-null; the UTF-8 constant "value"

Constructor Detail

AnnotationUtilsback to summary
private AnnotationUtils()

This class is uninstantiable.

Method Detail

makeAnnotationDefaultback to summary
public static Annotation makeAnnotationDefault(Annotation defaults)

Constructs a standard AnnotationDefault annotation.

Parameters
defaults:Annotation

non-null; the defaults, itself as an annotation

Returns:Annotation

non-null; the constructed annotation

makeCstArrayback to summary
private static CstArray makeCstArray(TypeList types)

Converts a TypeList to a CstArray.

Parameters
types:TypeList

non-null; the type list

Returns:CstArray

non-null; the corresponding array constant

makeEnclosingClassback to summary
public static Annotation makeEnclosingClass(CstType clazz)

Constructs a standard EnclosingClass annotation.

Parameters
clazz:CstType

non-null; the enclosing class

Returns:Annotation

non-null; the annotation

makeEnclosingMethodback to summary
public static Annotation makeEnclosingMethod(CstMethodRef method)

Constructs a standard EnclosingMethod annotation.

Parameters
method:CstMethodRef

non-null; the enclosing method

Returns:Annotation

non-null; the annotation

makeInnerClassback to summary
public static Annotation makeInnerClass(CstString name, int accessFlags)

Constructs a standard InnerClass annotation.

Parameters
name:CstString

null-ok; the original name of the class, or null to represent an anonymous class

accessFlags:int

the original access flags

Returns:Annotation

non-null; the annotation

makeMemberClassesback to summary
public static Annotation makeMemberClasses(TypeList types)

Constructs a standard MemberClasses annotation.

Parameters
types:TypeList

non-null; the list of (the types of) the member classes

Returns:Annotation

non-null; the annotation

makeSignatureback to summary
public static Annotation makeSignature(CstString signature)

Constructs a standard Signature annotation.

Parameters
signature:CstString

non-null; the signature string

Returns:Annotation

non-null; the annotation

makeThrowsback to summary
public static Annotation makeThrows(TypeList types)

Constructs a standard Throws annotation.

Parameters
types:TypeList

non-null; the list of thrown types

Returns:Annotation

non-null; the annotation