Package org.web3j.abi
Class TypeDecoder
java.lang.Object
org.web3j.abi.TypeDecoder
Ethereum Contract Application Binary Interface (ABI) decoding for types. Decoding is not
documented, but is the reverse of the encoding details located here.
The public API is composed of "decode*" methods and provides backward-compatbility. See https://github.com/web3j/web3j/issues/1591 for a discussion about decoding and possible improvements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Type>
Tstatic <T extends Array>
Tdecode(String input, int offset, TypeReference<T> typeReference) static <T extends Type>
Tstatic AddressdecodeAddress(String input) static BooldecodeBool(String rawInput, int offset) static <T extends Bytes>
TdecodeBytes(String input, int offset, Class<T> type) static <T extends Bytes>
TdecodeBytes(String input, Class<T> type) static <T extends Type>
TdecodeDynamicArray(String input, int offset, TypeReference<T> typeReference) static DynamicBytesdecodeDynamicBytes(String input, int offset) static <T extends Type>
TdecodeDynamicStruct(String input, int offset, TypeReference<T> typeReference) static <T extends NumericType>
TdecodeNumeric(String input, Class<T> type) static <T extends Type>
TdecodeStaticArray(String input, int offset, TypeReference<T> typeReference, int length) Static array length cannot be passed as a type.static <T extends Type>
TdecodeStaticStruct(String input, int offset, TypeReference<T> typeReference) static Utf8StringdecodeUtf8String(String input, int offset) static TypeinstantiateType(String solidityType, Object value) static TypeinstantiateType(TypeReference ref, Object value)
-
Constructor Details
-
TypeDecoder
public TypeDecoder()
-
-
Method Details
-
instantiateType
public static Type instantiateType(String solidityType, Object value) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException, ClassNotFoundException -
instantiateType
public static Type instantiateType(TypeReference ref, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException -
decode
-
decode
-
decode
-
decodeAddress
-
decodeNumeric
-
decodeBool
-
decodeBytes
-
decodeBytes
-
decodeDynamicBytes
-
decodeUtf8String
-
decodeStaticArray
public static <T extends Type> T decodeStaticArray(String input, int offset, TypeReference<T> typeReference, int length) Static array length cannot be passed as a type. -
decodeStaticStruct
public static <T extends Type> T decodeStaticStruct(String input, int offset, TypeReference<T> typeReference) -
decodeDynamicArray
public static <T extends Type> T decodeDynamicArray(String input, int offset, TypeReference<T> typeReference) -
decodeDynamicStruct
public static <T extends Type> T decodeDynamicStruct(String input, int offset, TypeReference<T> typeReference)
-