Aller au contenu
uencoder

Convertir Java .properties files to JSON

Java .propriétés fichiers utiliser key=value pairs avec dot-notation pour nesting. Convertir en JSON pour utiliser en JavaScript environments et structured access.

  1. 1

    Java .properties files use KEY=VALUE or KEY:VALUE pairs, with dot-notation for hierarchical keys (e.g., app.database.host=localhost). Comments start with # or !. They are common in Java applications for configuration and internationalization (i18n) messages.

  2. 2
    Convertisseur TOML →

    Analyser the .properties file and convert to JSON. Dot-notation keys are expanded into nested objects: app.database.host becomes {app: {database: {host: ...}}}. This makes the structure explicit and navigable.

  3. 3
    Formateur JSON →

    Formater the converted JSON. Verify that dot-notation keys were correctly nested. Properties files often use inconsistent key naming — formatting normalizes the output and makes structural issues visible.

  4. 4

    For i18n message bundles, the conversion produces a JSON object that JavaScript i18n libraries (i18next, FormatJS) can consume directly. Map Java message format ({0}, {1}) to ICU MessageFormat ({name}, {count, plural, ...}) during conversion if needed.

Questions fréquentes

How are special characters handled in .properties?
Backslash escapes: \n (newline), \t (tab), \= (literal =), \: (literal :), \\ (literal backslash). Unicode: \uXXXX. The conversion tool should handle these escapes and produce the correct characters in JSON.
Can I convert JSON back to .properties?
Yes, but only for flat or shallowly nested JSON. Deep nesting and arrays do not map cleanly to .properties dot-notation. If you need round-trip conversion, keep the JSON flat or use a format that supports nesting natively (YAML, TOML).

Workflows résolvant cette tâche

Comparer deux configs YAML via JSON
Convertir les configs YAML en JSON pour une comparaison diff-friendly des valeurs structurées.
PIPELINE
Coder une charge utile JSON pour transport URL
Préparer un Document JSON pour un Paramètre URL: embellir, Coder en Base64, puis encodage pourcent — le inverse exacte de le chaîne de décodage de paramètres imbriqués.
PIPELINE
HJSON en format JSON
Formater HJSON et convertir en JSON standard.
PIPELINE
Formater JSON et calculer une somme de contrôle d'intégrité
Pretty-printer un document JSON et calculer une somme CRC32 pour détecter toute modification ultérieure.
PIPELINE
Minifier et valider JSON
Formater JSON pour inspection et valider sa correction syntaxique en une passe.
PIPELINE
Formater JSON et générer une interface TypeScript
Formater un document JSON puis inférer une définition d'interface TypeScript en une chaîne.
PIPELINE
Valider, formater, puis convertir JSON en YAML
Convertir une config JSON (possiblement minifiée) en YAML, capturant les erreurs de syntaxe au premier nœud au lieu de produire un YAML subtilement erroné.
PIPELINE
JSON5 en format JSON
Formater JSON5 et convertir en JSON standard.
PIPELINE
JSONC en format JSON
Formater JSONC (JSON avec commentaires) et convertir en JSON standard.
PIPELINE
Décoder et formater une charge utile JWT
Analyser un token JWT, extraire sa charge utile et formater le JSON pour inspection.
PIPELINE
Analyser chaîne de requête et formater JSON
Analyser une chaîne de requête en paires clé-valeur puis formater en JSON.
PIPELINE
Convertir TOML en JSON
Analyser un fichier de configuration TOML en JSON pour les outils et API attendant une entree JSON.
PIPELINE
TOML en JSON puis CSV
Convertir TOML en JSON puis en CSV pour l'export de donnees.
PIPELINE
Convertir TOML en JSON puis YAML
Transformer une config TOML en YAML via JSON pour Kubernetes ou CI.
PIPELINE
Convertir TOML en YAML via JSON
Transformer un fichier de configuration TOML en format YAML, utilisant JSON comme representation intermediaire.
PIPELINE
Decoder un parametre URL imbrique (Base64 JSON)
Derouler un parametre URL transportant du JSON Base64 code URL en JSON formate lisible.
PIPELINE
Generer des interfaces TypeScript depuis YAML
Convertir un document YAML en definitions d'interface TypeScript, utilisant JSON comme format intermediaire.
PIPELINE

Outils associés