public final class ValueEncoder
extends java.lang.Object
encoded_values and parts
thereof.| Constructor and Description |
|---|
ValueEncoder(DexFile file,
AnnotatedOutput out)
Construct an instance.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addContents(DexFile file,
Annotation annotation)
Helper for
addContents() methods, which adds
contents for a particular Annotation, calling itself
recursively should it encounter a nested annotation. |
static void |
addContents(DexFile file,
Constant cst)
Helper for
addContents() methods, which adds
contents for a particular constant, calling itself recursively
should it encounter a CstArray and calling addContents(DexFile,Annotation) recursively should it
encounter a CstAnnotation. |
static java.lang.String |
constantToHuman(Constant cst)
Gets the colloquial type name and human form of the type of the
given constant, when used as an encoded value.
|
void |
writeAnnotation(Annotation annotation,
boolean topLevel)
Writes out the encoded form of the given annotation, that is,
as an
encoded_annotation and not including a
value_type prefix. |
void |
writeArray(CstArray array,
boolean topLevel)
Writes out the encoded form of the given array, that is, as
an
encoded_array and not including a
value_type prefix. |
void |
writeConstant(Constant cst)
Writes out the encoded form of the given constant.
|
public ValueEncoder(DexFile file, AnnotatedOutput out)
file - non-null; file being writtenout - non-null; output stream to write topublic void writeConstant(Constant cst)
cst - non-null; the constant to writepublic void writeArray(CstArray array, boolean topLevel)
encoded_array and not including a
value_type prefix. If the output stream keeps
(debugging) annotations and topLevel is
true, then this method will write (debugging)
annotations.array - non-null; array instance to writetopLevel - true iff the given annotation is the
top-level annotation or false if it is a sub-annotation
of some other annotationpublic void writeAnnotation(Annotation annotation, boolean topLevel)
encoded_annotation and not including a
value_type prefix. If the output stream keeps
(debugging) annotations and topLevel is
true, then this method will write (debugging)
annotations.annotation - non-null; annotation instance to writetopLevel - true iff the given annotation is the
top-level annotation or false if it is a sub-annotation
of some other annotationpublic static java.lang.String constantToHuman(Constant cst)
cst - non-null; the constantnon-null; its type name and human formpublic static void addContents(DexFile file, Annotation annotation)
addContents() methods, which adds
contents for a particular Annotation, calling itself
recursively should it encounter a nested annotation.file - non-null; the file to add toannotation - non-null; the annotation to add contents forpublic static void addContents(DexFile file, Constant cst)
addContents() methods, which adds
contents for a particular constant, calling itself recursively
should it encounter a CstArray and calling addContents(DexFile,Annotation) recursively should it
encounter a CstAnnotation.file - non-null; the file to add tocst - non-null; the constant to add contents forCopyright © 2020. All Rights Reserved.