Java: added compiled metadata generation

This commit is contained in:
Vlasislav Kashin
2025-07-11 03:46:50 +03:00
parent 8a42c0ecb5
commit 10c5ee1159
18 changed files with 222 additions and 247 deletions

View File

@@ -1,3 +1,19 @@
/*
* Copyright (C) 2011 The Libphonenumber Authors
* Copyright (C) 2025 Vladislav Kashin (modified)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pub const METADATA: [u8; 201802] = [
0x0A, 0xE9, 0x01, 0x0A, 0x1D, 0x12, 0x17, 0x28, 0x3F, 0x3A, 0x5B, 0x30, 0x31,
@@ -15525,4 +15541,3 @@ pub const METADATA: [u8; 201802] = [
0xFF, 0x01, 0xE2, 0x01, 0x0B, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x01
];

View File

@@ -0,0 +1,3 @@
pub mod metadata;
pub mod test_metadata;

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,3 @@
mod helper_constants;
mod metadata;
pub(super) use helper_constants::{*};
pub(super) use metadata::METADATA;

View File

@@ -4,18 +4,17 @@ use protobuf::Message;
use strum::IntoEnumIterator;
use crate::{
interfaces::MatcherApi,
proto_gen::{
interfaces::MatcherApi, phonenumberutil::generated::metadata::METADATA, proto_gen::{
phonemetadata::{PhoneMetadata, PhoneMetadataCollection, PhoneNumberDesc},
phonenumber::PhoneNumber,
},
}
};
use super::{
PhoneNumberFormat, PhoneNumberType, ValidNumberLenType,
errors::ValidationResultErr,
helper_constants::{
METADATA, OPTIONAL_EXT_SUFFIX, PLUS_SIGN, POSSIBLE_CHARS_AFTER_EXT_LABEL,
OPTIONAL_EXT_SUFFIX, PLUS_SIGN, POSSIBLE_CHARS_AFTER_EXT_LABEL,
POSSIBLE_SEPARATORS_BETWEEN_NUMBER_AND_EXT_LABEL, RFC3966_EXTN_PREFIX, RFC3966_PREFIX,
},
};

View File

@@ -6,6 +6,7 @@ pub mod phonenumberutil;
mod phone_number_regexps_and_mappings;
pub(self) mod helper_types;
pub(self) mod comparisons;
pub(crate) mod generated;
use std::sync::LazyLock;