31 package com.google.protobuf;
33 final class ExtensionSchemas {
34 private static final ExtensionSchema<?> LITE_SCHEMA =
new ExtensionSchemaLite();
35 private static final ExtensionSchema<?> FULL_SCHEMA = loadSchemaForFullRuntime();
37 private static ExtensionSchema<?> loadSchemaForFullRuntime() {
39 Class<?> clazz = Class.forName(
"com.google.protobuf.ExtensionSchemaFull");
40 return (ExtensionSchema) clazz.getDeclaredConstructor().newInstance();
41 }
catch (Exception e) {
46 static ExtensionSchema<?> lite() {
50 static ExtensionSchema<?> full() {
51 if (FULL_SCHEMA ==
null) {
52 throw new IllegalStateException(
"Protobuf runtime is not correctly loaded.");