use of com.android.dx.rop.annotation.NameValuePair in project J2ME-Loader by nikita36078.
the class AnnotationUtils method makeInnerClass.
/**
* Constructs a standard {@code InnerClass} annotation.
*
* @param name {@code null-ok;} the original name of the class, or
* {@code null} to represent an anonymous class
* @param accessFlags the original access flags
* @return {@code non-null;} the annotation
*/
public static Annotation makeInnerClass(CstString name, int accessFlags) {
Annotation result = new Annotation(INNER_CLASS_TYPE, SYSTEM);
Constant nameCst = (name != null) ? name : CstKnownNull.THE_ONE;
result.put(new NameValuePair(NAME_STRING, nameCst));
result.put(new NameValuePair(ACCESS_FLAGS_STRING, CstInteger.make(accessFlags)));
result.setImmutable();
return result;
}
use of com.android.dx.rop.annotation.NameValuePair in project J2ME-Loader by nikita36078.
the class AnnotationUtils method makeAnnotationDefault.
/**
* Constructs a standard {@code AnnotationDefault} annotation.
*
* @param defaults {@code non-null;} the defaults, itself as an annotation
* @return {@code non-null;} the constructed annotation
*/
public static Annotation makeAnnotationDefault(Annotation defaults) {
Annotation result = new Annotation(ANNOTATION_DEFAULT_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, new CstAnnotation(defaults)));
result.setImmutable();
return result;
}
use of com.android.dx.rop.annotation.NameValuePair in project J2ME-Loader by nikita36078.
the class AnnotationUtils method makeSourceDebugExtension.
/**
* Constructs a standard {@code SourceDebugExtension} annotation.
*
* @param smapString {@code non-null;} the SMAP string associated with
* @return {@code non-null;} the annotation
*/
public static Annotation makeSourceDebugExtension(CstString smapString) {
Annotation result = new Annotation(SOURCE_DEBUG_EXTENSION_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, smapString));
result.setImmutable();
return result;
}
use of com.android.dx.rop.annotation.NameValuePair in project J2ME-Loader by nikita36078.
the class ValueEncoder method addContents.
/**
* Helper for {@code addContents()} methods, which adds
* contents for a particular {@link Annotation}, calling itself
* recursively should it encounter a nested annotation.
*
* @param file {@code non-null;} the file to add to
* @param annotation {@code non-null;} the annotation to add contents for
*/
public static void addContents(DexFile file, Annotation annotation) {
TypeIdsSection typeIds = file.getTypeIds();
StringIdsSection stringIds = file.getStringIds();
typeIds.intern(annotation.getType());
for (NameValuePair pair : annotation.getNameValuePairs()) {
stringIds.intern(pair.getName());
addContents(file, pair.getValue());
}
}
Aggregations