|
Griffon 1.2.0 | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.codehaus.griffon.ast.AbstractASTTransformation
org.codehaus.griffon.ast.MessageSourceAwareASTTransformation
@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION) public class MessageSourceAwareASTTransformation extends AbstractASTTransformation
Handles generation of code for the @MessageSourceAware annotation.
| Field Summary | |
|---|---|
private static String |
ARGS
|
private static String |
DEFAULT_MESSAGE
|
private static String |
KEY
|
private static String |
LOCALE
|
private static ClassNode |
LOCALE_TYPE
|
private static Logger |
LOG
|
private static ClassNode |
MESSAGE_SOURCE_AWARE_TYPE
|
private static ClassNode |
MESSAGE_SOURCE_TYPE
|
private static String |
METHOD_GET_MESSAGE
|
private static ClassNode |
NO_SUCH_MESSAGE_EXCEPTION_TYPE
|
private static ClassNode |
OBJECT_ARRAY_TYPE
|
| Fields inherited from class AbstractASTTransformation | |
|---|---|
| APPLICATION_HOLDER_TYPE, COLLECTIONS_CLASS |
| Constructor Summary | |
MessageSourceAwareASTTransformation()
|
|
| Method Summary | |
|---|---|
static void
|
addResourceLocatorIfNeeded(SourceUnit source, ClassNode classNode)
|
static void
|
apply(ClassNode declaringClass)
Adds the necessary field and methods to support message resolution. |
static boolean
|
hasMessageSourceAwareAnnotation(AnnotatedNode node)
Convenience method to see if an annotated node is @MessageSourceAware. |
protected static boolean
|
needsMessageSource(ClassNode declaringClass, SourceUnit sourceUnit)
Snoops through the declaring class and all parents looking for methods
|
void
|
visit(ASTNode[] nodes, SourceUnit source)
Handles the bulk of the processing, mostly delegating to other methods. |
| Methods inherited from class AbstractASTTransformation | |
|---|---|
| addError, applicationInstance, checkNodesForAnnotationAndType, emptyMap, makeClassSafe, makeClassSafe, makeClassSafe, newClass |
| Field Detail |
|---|
private static final String ARGS
private static final String DEFAULT_MESSAGE
private static final String KEY
private static final String LOCALE
private static final ClassNode LOCALE_TYPE
private static final Logger LOG
private static final ClassNode MESSAGE_SOURCE_AWARE_TYPE
private static final ClassNode MESSAGE_SOURCE_TYPE
private static final String METHOD_GET_MESSAGE
private static final ClassNode NO_SUCH_MESSAGE_EXCEPTION_TYPE
private static final ClassNode OBJECT_ARRAY_TYPE
| Constructor Detail |
|---|
MessageSourceAwareASTTransformation()
| Method Detail |
|---|
public static void addResourceLocatorIfNeeded(SourceUnit source, ClassNode classNode)
public static void apply(ClassNode declaringClass)
declaringClass - the class to which we add the support field and methods
public static boolean hasMessageSourceAwareAnnotation(AnnotatedNode node)
node - the node to check
protected static boolean needsMessageSource(ClassNode declaringClass, SourceUnit sourceUnit)
public String getMessage(java.lang.String)public String getMessage(java.lang.String, java.util.Locale)public String getMessage(java.lang.String, java.lang.Object[])public String getMessage(java.lang.String, java.lang.Object[], java.util.Locale)public String getMessage(java.lang.String, java.util.List)public String getMessage(java.lang.String, java.util.List, java.util.Locale)public String getMessage(java.lang.String, java.util.Map)public String getMessage(java.lang.String, java.util.Map, java.util.Locale)public String getMessage(java.lang.String, java.lang.String)public String getMessage(java.lang.String, java.lang.String, java.util.Locale)public String getMessage(java.lang.String, java.lang.Object[], java.lang.String)public String getMessage(java.lang.String, java.lang.Object[], java.lang.String, java.util.Locale)public String getMessage(java.lang.String, java.util.List, java.lang.String)public String getMessage(java.lang.String, java.util.List, java.lang.String, java.util.Locale)public String getMessage(java.lang.String, java.util.Map, java.lang.String)public String getMessage(java.lang.String, java.util.Map, java.lang.String, java.util.Locale)declaringClass - the class to searchsourceUnit - the source unit, for error reporting. @NotNull.
public void visit(ASTNode[] nodes, SourceUnit source)
nodes - the ast nodessource - the source unit for the nodes
Groovy Documentation