From 6d0d46479473c424712def1487dbc4e95b6110f2 Mon Sep 17 00:00:00 2001 From: leadpony Date: Tue, 26 Feb 2019 21:21:40 +0900 Subject: [PATCH] Add a message for printing the ID of referenced schema. --- .../org/leadpony/justify/cli/Message.java | 1 + .../org/leadpony/justify/cli/Validate.java | 1 + .../leadpony/justify/cli/messages.properties | 20 +++++++++---------- .../justify/cli/messages_ja.properties | 8 +++----- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/justify-cli/src/main/java/org/leadpony/justify/cli/Message.java b/justify-cli/src/main/java/org/leadpony/justify/cli/Message.java index 45148f57..60621326 100644 --- a/justify-cli/src/main/java/org/leadpony/justify/cli/Message.java +++ b/justify-cli/src/main/java/org/leadpony/justify/cli/Message.java @@ -31,6 +31,7 @@ enum Message { INSPECT_SCHEMA, READ_CATALOG, + SCHEMA_ID_FOUND, SCHEMA_ID_MISSING, SCHEMA_ID_INVALID, diff --git a/justify-cli/src/main/java/org/leadpony/justify/cli/Validate.java b/justify-cli/src/main/java/org/leadpony/justify/cli/Validate.java index c55c6046..37a39d6a 100644 --- a/justify-cli/src/main/java/org/leadpony/justify/cli/Validate.java +++ b/justify-cli/src/main/java/org/leadpony/justify/cli/Validate.java @@ -241,6 +241,7 @@ private void addReferencedSchema(Location location) { console.print(INSPECT_SCHEMA, location); URI id = identifySchema(location); if (id != null) { + console.print(SCHEMA_ID_FOUND, id); catalog.put(id, location); } } diff --git a/justify-cli/src/main/resources/org/leadpony/justify/cli/messages.properties b/justify-cli/src/main/resources/org/leadpony/justify/cli/messages.properties index 9a812189..cf7d48bd 100644 --- a/justify-cli/src/main/resources/org/leadpony/justify/cli/messages.properties +++ b/justify-cli/src/main/resources/org/leadpony/justify/cli/messages.properties @@ -17,24 +17,22 @@ VALIDATE_SCHEMA=Validating the schema "{0}"... VALIDATE_REFERENCED_SCHEMA=Validating the referenced schema "{0}"... VALIDATE_INSTANCE=Validating the instance "{0}"... - INSPECT_SCHEMA=Inspecting the referenced schema "{0}"... +READ_CATALOG=Reading the catalog "{0}"... + +SCHEMA_ID_FOUND=The schema has an ID of "{0}". SCHEMA_ID_MISSING=The referenced schema does not contain an "$id" keyword at its root. SCHEMA_ID_INVALID=The value of the "$id" keyword is not a valid URI. -READ_CATALOG=Reading the catalog "{0}"... - SCHEMA_VALID=No problem was found in the schema "{0}". SCHEMA_INVALID=At least {1} problem(s) were found in the schema "{0}". - INSTANCE_VALID=No problem was found in the instance "{0}". INSTANCE_INVALID=At least {1} problem(s) were found in the instance "{0}". - CATALOG_INVALID=At least {1} problem(s) were found in the catalog "{0}". -SCHEMA_NOT_FOUND=The schema file does not exist at "{0}". -INSTANCE_NOT_FOUND=The instance file does not exist at "{0}". -CATALOG_NOT_FOUND=The catalog file does not exist at "{0}". +SCHEMA_MALFORMED=The schema file is not formed correctly.\n{0} +INSTANCE_MALFORMED=The instance file is not formed correctly.\n{0} +CATALOG_MALFORMED=The catalog file is not formed correctly.\n{0} PATH_OR_URL=path or URL @@ -43,9 +41,9 @@ OPTION_MISSING=Required option "{0}" is not specified. OPTION_ARGUMENT_MISSING=The option "{0}" needs an argument followed. OPTION_ARGUMENT_INVALID=The argument "{1}" is invalid for the option "{0}". -SCHEMA_MALFORMED=The schema file is not formed correctly.\n{0} -INSTANCE_MALFORMED=The instance file is not formed correctly.\n{0} -CATALOG_MALFORMED=The catalog file is not formed correctly.\n{0} +SCHEMA_NOT_FOUND=The schema file does not exist at "{0}". +INSTANCE_NOT_FOUND=The instance file does not exist at "{0}". +CATALOG_NOT_FOUND=The catalog file does not exist at "{0}". SCHEMA_FAILED=Program terminated due to schema failure. CATALOG_FAILED=Program terminated due to catalog failure. diff --git a/justify-cli/src/main/resources/org/leadpony/justify/cli/messages_ja.properties b/justify-cli/src/main/resources/org/leadpony/justify/cli/messages_ja.properties index ecf7c11f..4d6ff284 100644 --- a/justify-cli/src/main/resources/org/leadpony/justify/cli/messages_ja.properties +++ b/justify-cli/src/main/resources/org/leadpony/justify/cli/messages_ja.properties @@ -17,19 +17,17 @@ VALIDATE_SCHEMA=\u30B9\u30AD\u30FC\u30DE\u3092\u691C\u8A3C\u3057\u3066\u3044\u307E\u3059...: "{0}" VALIDATE_REFERENCED_SCHEMA=\u53C2\u7167\u30B9\u30AD\u30FC\u30DE\u3092\u691C\u8A3C\u3057\u3066\u3044\u307E\u3059...: "{0}" VALIDATE_INSTANCE=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u691C\u8A3C\u3057\u3066\u3044\u307E\u3059...: "{0}" - INSPECT_SCHEMA=\u53C2\u7167\u30B9\u30AD\u30FC\u30DE\u3092\u78BA\u8A8D\u3057\u3066\u3044\u307E\u3059...: "{0}" +READ_CATALOG=\u30AB\u30BF\u30ED\u30B0\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u3067\u3059...: "{0}" + +SCHEMA_ID_FOUND=\u30B9\u30AD\u30FC\u30DE\u306EID\u306F"{0}"\u3067\u3059\u3002 SCHEMA_ID_MISSING=\u53C2\u7167\u30B9\u30AD\u30FC\u30DE\u304C\u30EB\u30FC\u30C8\u306B"$id"\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093\u3002 SCHEMA_ID_INVALID="$id"\u30AD\u30FC\u30EF\u30FC\u30C9\u306E\u5024\u304CURI\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 -READ_CATALOG=\u30AB\u30BF\u30ED\u30B0\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D\u3067\u3059...: "{0}" - SCHEMA_VALID=\u30B9\u30AD\u30FC\u30DE\u306B\u554F\u984C\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002: "{0}" SCHEMA_INVALID=\u30B9\u30AD\u30FC\u30DE\u306B\u5C11\u306A\u304F\u3068\u3082{1}\u500B\u306E\u554F\u984C\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002: "{0}" - INSTANCE_VALID=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u306B\u554F\u984C\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002: "{0}" INSTANCE_INVALID=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u306B\u5C11\u306A\u304F\u3068\u3082{1}\u500B\u306E\u554F\u984C\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002: "{0}" - CATALOG_INVALID=\u30AB\u30BF\u30ED\u30B0\u306B\u5C11\u306A\u304F\u3068\u3082{1}\u500B\u306E\u554F\u984C\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002: "{0}" SCHEMA_MALFORMED=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A1\u30A4\u30EB\u304C\u6B63\u3057\u3044JSON\u5F62\u5F0F\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n{0}