Fields Summary |
---|
private static final com.android.dx.rop.cst.CstType | ANNOTATION_DEFAULT_TYPEnon-null; type for AnnotationDefault annotations |
private static final com.android.dx.rop.cst.CstType | ENCLOSING_CLASS_TYPEnon-null; type for EnclosingClass annotations |
private static final com.android.dx.rop.cst.CstType | ENCLOSING_METHOD_TYPEnon-null; type for EnclosingMethod annotations |
private static final com.android.dx.rop.cst.CstType | INNER_CLASS_TYPEnon-null; type for InnerClass annotations |
private static final com.android.dx.rop.cst.CstType | MEMBER_CLASSES_TYPEnon-null; type for MemberClasses annotations |
private static final com.android.dx.rop.cst.CstType | SIGNATURE_TYPEnon-null; type for Signature annotations |
private static final com.android.dx.rop.cst.CstType | THROWS_TYPEnon-null; type for Throws annotations |
private static final com.android.dx.rop.cst.CstUtf8 | ACCESS_FLAGS_UTFnon-null; the UTF-8 constant "accessFlags" |
private static final com.android.dx.rop.cst.CstUtf8 | NAME_UTFnon-null; the UTF-8 constant "name" |
private static final com.android.dx.rop.cst.CstUtf8 | VALUE_UTFnon-null; the UTF-8 constant "value" |
Methods Summary |
---|
public static com.android.dx.rop.annotation.Annotation | makeAnnotationDefault(com.android.dx.rop.annotation.Annotation defaults)Constructs a standard AnnotationDefault annotation.
Annotation result = new Annotation(ANNOTATION_DEFAULT_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_UTF, new CstAnnotation(defaults)));
result.setImmutable();
return result;
|
private static com.android.dx.rop.cst.CstArray | makeCstArray(com.android.dx.rop.type.TypeList types)Converts a {@link TypeList} to a {@link CstArray}.
int size = types.size();
CstArray.List list = new CstArray.List(size);
for (int i = 0; i < size; i++) {
list.set(i, CstType.intern(types.getType(i)));
}
list.setImmutable();
return new CstArray(list);
|
public static com.android.dx.rop.annotation.Annotation | makeEnclosingClass(com.android.dx.rop.cst.CstType clazz)Constructs a standard EnclosingClass annotation.
Annotation result = new Annotation(ENCLOSING_CLASS_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_UTF, clazz));
result.setImmutable();
return result;
|
public static com.android.dx.rop.annotation.Annotation | makeEnclosingMethod(com.android.dx.rop.cst.CstMethodRef method)Constructs a standard EnclosingMethod annotation.
Annotation result = new Annotation(ENCLOSING_METHOD_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_UTF, method));
result.setImmutable();
return result;
|
public static com.android.dx.rop.annotation.Annotation | makeInnerClass(com.android.dx.rop.cst.CstUtf8 name, int accessFlags)Constructs a standard InnerClass annotation.
Annotation result = new Annotation(INNER_CLASS_TYPE, SYSTEM);
Constant nameCst =
(name != null) ? new CstString(name) : CstKnownNull.THE_ONE;
result.put(new NameValuePair(NAME_UTF, nameCst));
result.put(new NameValuePair(ACCESS_FLAGS_UTF,
CstInteger.make(accessFlags)));
result.setImmutable();
return result;
|
public static com.android.dx.rop.annotation.Annotation | makeMemberClasses(com.android.dx.rop.type.TypeList types)Constructs a standard MemberClasses annotation.
CstArray array = makeCstArray(types);
Annotation result = new Annotation(MEMBER_CLASSES_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_UTF, array));
result.setImmutable();
return result;
|
public static com.android.dx.rop.annotation.Annotation | makeSignature(com.android.dx.rop.cst.CstUtf8 signature)Constructs a standard Signature annotation.
Annotation result = new Annotation(SIGNATURE_TYPE, SYSTEM);
/*
* Split the string into pieces that are likely to be common
* across many signatures and the rest of the file.
*/
String raw = signature.getString();
int rawLength = raw.length();
ArrayList<String> pieces = new ArrayList<String>(20);
for (int at = 0; at < rawLength; /*at*/) {
char c = raw.charAt(at);
int endAt = at + 1;
if (c == 'L") {
// Scan to ';' or '<'. Consume ';' but not '<'.
while (endAt < rawLength) {
c = raw.charAt(endAt);
if (c == ';") {
endAt++;
break;
} else if (c == '<") {
break;
}
endAt++;
}
} else {
// Scan to 'L' without consuming it.
while (endAt < rawLength) {
c = raw.charAt(endAt);
if (c == 'L") {
break;
}
endAt++;
}
}
pieces.add(raw.substring(at, endAt));
at = endAt;
}
int size = pieces.size();
CstArray.List list = new CstArray.List(size);
for (int i = 0; i < size; i++) {
list.set(i, new CstString(pieces.get(i)));
}
list.setImmutable();
result.put(new NameValuePair(VALUE_UTF, new CstArray(list)));
result.setImmutable();
return result;
|
public static com.android.dx.rop.annotation.Annotation | makeThrows(com.android.dx.rop.type.TypeList types)Constructs a standard Throws annotation.
CstArray array = makeCstArray(types);
Annotation result = new Annotation(THROWS_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_UTF, array));
result.setImmutable();
return result;
|