/** * Returns the version string that is reported by the {@link Asset} in * the given {@link GlTF}. If it does not have an {@link Asset}, or * the version string in the asset is <code>null</code>, then * this method will return the string <code>"1.0.0"</code>. * * @param gltf The {@link GlTF} * @return The version string */ public static String getVersion(GlTF gltf) { Objects.requireNonNull(gltf, "The gltf is null"); Asset asset = gltf.getAsset(); if (asset == null) { return "1.0"; } String version = asset.getVersion(); if (version == null) { return "1.0"; } return version; }
/** * Returns the version string that is reported by the {@link Asset} in * the given {@link GlTF}. If it does not have an {@link Asset}, or * the version string in the asset is <code>null</code>, then * this method will return the string <code>"1.0.0"</code>. * * @param gltf The {@link GlTF} * @return The version string */ static String getVersion(GlTF gltf) { Objects.requireNonNull(gltf, "The gltf is null"); Asset asset = gltf.getAsset(); if (asset == null) { return "1.0.0"; } String version = asset.getVersion(); if (version == null) { return "1.0.0"; } return version; }
/** * Validate the {@link Asset}. Until now, this only prints log messages * with version information. */ private void validateAsset() { Asset asset = getGltf().getAsset(); if (asset == null) { logger.info("No <asset> information found. " + "Assuming glTF version 1.0.0"); } else { String version = asset.getVersion(); if (version == null) { logger.info("No 'version' property found in <asset>. " + "Assuming glTF version 1.0.0"); } else { logger.info("Validating glTF with version " + version); } } }