1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef OHOS_HDI_JAVA_CODE_EMITTER_H 10 #define OHOS_HDI_JAVA_CODE_EMITTER_H 11 12 #include <cctype> 13 14 #include "ast/ast.h" 15 #include "codegen/code_emitter.h" 16 #include "util/autoptr.h" 17 #include "util/light_refcount_base.h" 18 #include "util/string_builder.h" 19 20 namespace OHOS { 21 namespace HDI { 22 class JavaCodeEmitter : public CodeEmitter { 23 public: 24 ~JavaCodeEmitter() override = default; 25 26 protected: 27 bool CreateDirectory(); 28 29 void EmitLicense(StringBuilder &sb); 30 31 void EmitPackage(StringBuilder &sb); 32 33 void EmitInterfaceMethodCommands(StringBuilder &sb, const std::string &prefix) override; 34 35 std::string MethodName(const std::string &name) const; 36 37 std::string SpecificationParam(StringBuilder ¶mSb, const std::string &prefix) const; 38 }; 39 } // namespace HDI 40 } // namespace OHOS 41 42 #endif // OHOS_HDI_JAVA_CODE_EMITTER_H