// Check to make sure that either the parent ValidatableProperty annotation has a displayName property,
// or this rule specifies a first argument to the default message, or this rule specifies its own message.
// If none of these are true, output a warning.
//
assert parentAnnotations.length > 0;
AnnotationInstance immediateParent = parentAnnotations[parentAnnotations.length - 1];
if ( CompilerUtils.getString( immediateParent, DISPLAY_NAME_ATTR, true ) == null
&& CompilerUtils.getString( immediateParent, DISPLAY_NAME_KEY_ATTR, true ) == null
&& CompilerUtils.getString( annotation, MESSAGE_KEY_ATTR, true ) == null
&& CompilerUtils.getString( annotation, MESSAGE_ATTR, true ) == null )
{
boolean useDefaultDisplayName = true;
List messageArgs =
CompilerUtils.getAnnotationArray( annotation, MESSAGE_ARGS_ATTR, true );
if ( messageArgs != null )
{
boolean firstArg = true;
for ( Iterator ii = messageArgs.iterator(); ii.hasNext(); )
{
AnnotationInstance messageArg = ( AnnotationInstance ) ii.next();
Integer position = CompilerUtils.getInteger( messageArg, POSITION_ATTR, true );
if ( ( position == null && firstArg ) || ( position != null && position.intValue() == 0 ) )
{
useDefaultDisplayName = false;