From b6a0c2fb00f69bc665599e776dcdf582bd56cdeb Mon Sep 17 00:00:00 2001 From: yunhanw Date: Fri, 2 Feb 2024 23:27:00 -0800 Subject: [PATCH] remove dead java encode_value.zapt --- .../java/templates/partials/encode_value.zapt | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/controller/java/templates/partials/encode_value.zapt diff --git a/src/controller/java/templates/partials/encode_value.zapt b/src/controller/java/templates/partials/encode_value.zapt deleted file mode 100644 index 3f6d573662ba9f..00000000000000 --- a/src/controller/java/templates/partials/encode_value.zapt +++ /dev/null @@ -1,61 +0,0 @@ -{{#if isOptional}} - if ({{source}} != nullptr) { - jobject optionalValue_{{depth}}; - chip::JniReferences::GetInstance().GetOptionalValue({{source}}, optionalValue_{{depth}}); - if (optionalValue_{{depth}} != nullptr) { - auto & definedValue_{{depth}} = {{target}}.Emplace(); - {{>encode_value target=(concat "definedValue_" depth) source=(concat "optionalValue_" depth) cluster=cluster depth=(incrementDepth depth) isOptional=false}} - } - } -{{else if isNullable}} - if ({{source}} == nullptr) { - {{target}}.SetNull(); - } else { - auto & nonNullValue_{{depth}} = {{target}}.SetNonNull(); - {{>encode_value target=(concat "nonNullValue_" depth) source=source cluster=cluster depth=(incrementDepth depth) isNullable=false}} - } -{{else if isArray}} - { - using ListType_{{depth}} = std::remove_reference_t; - using ListMemberType_{{depth}} = ListMemberTypeGetter::Type; - jint {{source}}Size; - chip::JniReferences::GetInstance().GetListSize({{source}}, {{source}}Size); - if ({{source}}Size != 0) { - auto * listHolder_{{depth}} = new ListHolder({{source}}Size); - listFreer.add(listHolder_{{depth}}); - - for (jint i_{{depth}} = 0; i_{{depth}} < {{source}}Size; ++i_{{depth}}) { - jobject element_{{depth}}; - chip::JniReferences::GetInstance().GetListItem({{source}}, i_{{depth}}, element_{{depth}}); - {{>encode_value target=(concat "listHolder_" depth "->mList[i_" depth "]") source=(concat "element_" depth) cluster=cluster depth=(incrementDepth depth) isArray=false}} - } - {{target}} = ListType_{{depth}}(listHolder_{{depth}}->mList, {{source}}Size); - } else { - {{target}} = ListType_{{depth}}(); - } - } -{{else if (isOctetString type)}} - cleanupByteArrays.push_back(chip::Platform::MakeUnique(env, static_cast({{source}}))); - {{target}} = cleanupByteArrays.back()->byteSpan(); -{{else if (isCharString type)}} - cleanupStrings.push_back(chip::Platform::MakeUnique(env, static_cast({{source}}))); - {{target}} = cleanupStrings.back()->charSpan(); -{{else}} - {{#if_is_struct type}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - jobject {{../source}}_{{asLowerCamelCase label}}Item_{{../depth}}; - chip::JniReferences::GetInstance().GetObjectField({{../source}}, "{{asLowerCamelCase label}}", "{{asJniSignature type null (asUpperCamelCase ../cluster) true}}", {{../source}}_{{asLowerCamelCase label}}Item_{{../depth}}); - {{>encode_value target=(concat ../target "." (asLowerCamelCase label)) source=(concat ../source "_" (asLowerCamelCase label) "Item_" ../depth) cluster=../cluster depth=(incrementDepth ../depth)}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - {{else}} - {{#if_chip_enum type}} - {{target}} = static_cast>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}})); - {{else}} - {{#if_is_strongly_typed_bitmap type}} - {{target}}.SetRaw(static_cast::IntegerType>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}}))); - {{else}} - {{target}} = static_cast>(chip::JniReferences::GetInstance().{{asJavaType type null parent.parent.name forceNotList=true}}ToPrimitive({{source}})); - {{/if_is_strongly_typed_bitmap}} - {{/if_chip_enum}} - {{/if_is_struct}} -{{/if}}