@BaseMessage("From line {0,number,#}, column {1,number,#} to line {2,number,#}, column {3,number,#}") ExInstWithCause<CalciteContextException> validatorContext(int a0, int a1, int a2, int a3);
/** Creates an instance of the resource object that can access properties * but not resources. */ public static <T> T create(PropertyAccessor accessor, Class<T> clazz) { return create(null, accessor, clazz); }
/** Applies all validations to all resource methods in the given * resource object. * * @param o Resource object to validate */ public static void validate(Object o) { validate(o, EnumSet.allOf(Validation.class)); }
/** Returns the preferred locale of the current thread, or * the default locale if the current thread has not called * {@link #setThreadLocale}. * * @return Locale */ protected static Locale getThreadOrDefaultLocale() { Locale locale = getThreadLocale(); if (locale == null) { return Locale.getDefault(); } else { return locale; } }
Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { args[i] = zero(parameterTypes[i]);
returnType.getConstructor(String.class, Locale.class, Method.class, Object[].class); final Locale locale = Resources.getThreadOrDefaultLocale(); return constructor.newInstance(base, locale, method, args != null ? args : new Object[0]);
/** Applies all validations to all resource methods in the given * resource object. * * @param o Resource object to validate */ public static void validate(Object o) { validate(o, EnumSet.allOf(Validation.class)); }
/** Returns the preferred locale of the current thread, or * the default locale if the current thread has not called * {@link #setThreadLocale}. * * @return Locale */ protected static Locale getThreadOrDefaultLocale() { Locale locale = getThreadLocale(); if (locale == null) { return Locale.getDefault(); } else { return locale; } }
Object[] args = new Object[parameterTypes.length]; for (int i = 0; i < parameterTypes.length; i++) { args[i] = zero(parameterTypes[i]);
returnType.getConstructor(String.class, Locale.class, Method.class, Object[].class); final Locale locale = Resources.getThreadOrDefaultLocale(); return constructor.newInstance(base, locale, method, args != null ? args : new Object[0]);
/** Same message as {@link #tableNameNotFound(String)} but a different kind * of exception, so it can be used in {@code RelBuilder}. */ @BaseMessage("Table ''{0}'' not found") ExInst<CalciteException> tableNotFound(String tableName);
@Test public void testResources() { Resources.validate(Static.RESOURCE); checkResourceMethodNames(Static.RESOURCE); }
/** Creates an instance of the resource object that can access properties * but not resources. */ public static <T> T create(PropertyAccessor accessor, Class<T> clazz) { return create(null, accessor, clazz); }
@BaseMessage("From line {0,number,#}, column {1,number,#} to line {2,number,#}, column {3,number,#}") ExInstWithCause<CalciteContextException> validatorContext(int a0, int a1, int a2, int a3);
@Test public void testResources() { Resources.validate(Static.RESOURCE); checkResourceMethodNames(Static.RESOURCE); }
/** Creates an instance of the resource object, using the class's name as * the name of the resource file. * * @see #create(String, Class) * * @param <T> Resource type * @param clazz Interface that contains a method for each resource * @return Instance of the interface that can be used to instantiate * resources */ public static <T> T create(Class<T> clazz) { return create(clazz.getCanonicalName(), clazz); }
@BaseMessage("Cannot apply {0} to the two different charsets {1} and {2}") ExInst<SqlValidatorException> incompatibleCharset(String a0, String a1, String a2);
/** Creates an instance of the resource object, using the class's name as * the name of the resource file. * * @see #create(String, Class) * * @param <T> Resource type * @param clazz Interface that contains a method for each resource * @return Instance of the interface that can be used to instantiate * resources */ public static <T> T create(Class<T> clazz) { return create(clazz.getCanonicalName(), clazz); }
@BaseMessage("Cannot apply ''{0}'' to arguments of type {1}. Supported form(s): {2}") ExInst<SqlValidatorException> canNotApplyOp2Type(String a0, String a1, String a2);
return create(base, EmptyPropertyAccessor.INSTANCE, clazz);