Class SolidityContractWrapper

java.lang.Object
org.fisco.bcos.sdk.codegen.SolidityContractWrapper

public class SolidityContractWrapper
extends java.lang.Object
Generate Java Classes based on generated Solidity bin and abi files.
  • Constructor Summary

    Constructors 
    Constructor Description
    SolidityContractWrapper()  
  • Method Summary

    Modifier and Type Method Description
    protected static java.util.List<com.squareup.javapoet.ParameterSpec> buildParameterTypes​(java.util.List<ABIDefinition.NamedType> namedTypes)  
    protected static com.squareup.javapoet.TypeName buildTypeName​(java.lang.String typeDeclaration)  
    protected static java.util.List<com.squareup.javapoet.TypeName> buildTypeNames​(java.util.List<ABIDefinition.NamedType> namedTypes)  
    protected static java.lang.String createValidParamName​(java.lang.String name, int idx)
    Public Solidity arrays and maps require an unnamed input parameter - multiple if they require a struct type.
    void generateJavaFiles​(java.lang.String contractName, java.lang.String bin, java.lang.String smBin, java.lang.String abi, java.lang.String destinationDir, java.lang.String basePackageName)  
    protected static com.squareup.javapoet.TypeName getEventNativeType​(com.squareup.javapoet.TypeName typeName)  
    static java.lang.String getInputOutputFunctionName​(ABIDefinition functionDefinition, boolean isOverLoad)  
    protected static com.squareup.javapoet.TypeName getNativeType​(com.squareup.javapoet.ParameterizedTypeName parameterizedTypeName)  
    protected static com.squareup.javapoet.TypeName getNativeType​(com.squareup.javapoet.TypeName typeName)  
    java.util.List<java.lang.String> stringToArrayString​(java.lang.String binary)  
    protected void write​(java.lang.String packageName, com.squareup.javapoet.TypeSpec typeSpec, java.lang.String destinationDir)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • generateJavaFiles

      public void generateJavaFiles​(java.lang.String contractName, java.lang.String bin, java.lang.String smBin, java.lang.String abi, java.lang.String destinationDir, java.lang.String basePackageName) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.UnsupportedOperationException, CodeGenException
      Throws:
      java.io.IOException
      java.lang.ClassNotFoundException
      java.lang.UnsupportedOperationException
      CodeGenException
    • write

      protected void write​(java.lang.String packageName, com.squareup.javapoet.TypeSpec typeSpec, java.lang.String destinationDir) throws java.io.IOException
      Throws:
      java.io.IOException
    • stringToArrayString

      public java.util.List<java.lang.String> stringToArrayString​(java.lang.String binary)
    • getNativeType

      protected static com.squareup.javapoet.TypeName getNativeType​(com.squareup.javapoet.TypeName typeName)
    • getNativeType

      protected static com.squareup.javapoet.TypeName getNativeType​(com.squareup.javapoet.ParameterizedTypeName parameterizedTypeName)
    • getEventNativeType

      protected static com.squareup.javapoet.TypeName getEventNativeType​(com.squareup.javapoet.TypeName typeName)
    • buildParameterTypes

      protected static java.util.List<com.squareup.javapoet.ParameterSpec> buildParameterTypes​(java.util.List<ABIDefinition.NamedType> namedTypes)
    • createValidParamName

      protected static java.lang.String createValidParamName​(java.lang.String name, int idx)
      Public Solidity arrays and maps require an unnamed input parameter - multiple if they require a struct type.
      Parameters:
      name - parameter name
      idx - parameter index
      Returns:
      non-empty parameter name
    • buildTypeNames

      protected static java.util.List<com.squareup.javapoet.TypeName> buildTypeNames​(java.util.List<ABIDefinition.NamedType> namedTypes)
    • getInputOutputFunctionName

      public static java.lang.String getInputOutputFunctionName​(ABIDefinition functionDefinition, boolean isOverLoad)
    • buildTypeName

      protected static com.squareup.javapoet.TypeName buildTypeName​(java.lang.String typeDeclaration)