001package sting.processor; 002 003import javax.annotation.Nonnull; 004import javax.annotation.Nullable; 005 006/** 007 * Compile-time scalar value from an interceptor binding annotation member. 008 */ 009public interface BindingValueModel 010{ 011 /** 012 * Return the annotation member name. 013 * 014 * @return the annotation member name. 015 */ 016 @Nonnull 017 String name(); 018 019 /** 020 * Return the value kind. 021 * 022 * @return the value kind. 023 */ 024 @Nonnull 025 BindingValueKind kind(); 026 027 /** 028 * Return the boxed scalar value for primitive and string kinds. 029 * 030 * @return the boxed scalar value, or null when this value uses kind-specific metadata. 031 */ 032 @Nullable 033 Object scalarValue(); 034 035 /** 036 * Return the fully qualified class name for class-valued members. 037 * 038 * @return the fully qualified class name, or null when the kind is not {@link BindingValueKind#CLASS}. 039 */ 040 @Nullable 041 String className(); 042 043 /** 044 * Return the fully qualified enum type name for enum-valued members. 045 * 046 * @return the fully qualified enum type name, or null when the kind is not {@link BindingValueKind#ENUM}. 047 */ 048 @Nullable 049 String enumTypeName(); 050 051 /** 052 * Return the enum constant name for enum-valued members. 053 * 054 * @return the enum constant name, or null when the kind is not {@link BindingValueKind#ENUM}. 055 */ 056 @Nullable 057 String enumConstantName(); 058 059 /** 060 * Return a Java source literal for the value. 061 * 062 * @return a Java source literal for supported values. 063 * @throws IllegalStateException if the value kind is unsupported. 064 */ 065 @Nonnull 066 String javaLiteral(); 067}