{
JavaMethod[] methods = findTaggedMethods(
getJavaClass(), getNS() + Tags.DELIMITER + ENTRY );
if( methods.length == 0 )
{
return new ContextDescriptor( new EntryDescriptor[0] );
}
else
{
//
// collect the @avalon.entry tags from this class and
// all supertypes methods marked with @avalon.entry
//
final ArrayList list = new ArrayList();
final Set marked = new HashSet( 10 );
for( int j = 0; j < methods.length; j++ )
{
final DocletTag[] tags =
methods[j].getTagsByName( getNS() + Tags.DELIMITER + ENTRY );
for( int i = 0; i < tags.length; i++ )
{
final String key = getNamedParameter( tags[i], KEY_PARAM );
if( !marked.contains( key ) )
{
list.add( getEntry( tags[i] ) );
marked.add( key );
}
}
}
final EntryDescriptor[] entries =
(EntryDescriptor[])list.toArray( new EntryDescriptor[ list.size() ] );
String type = null;
String strategy = null;
for( int j = 0; j < methods.length; j++ )
{
JavaMethod method = methods[j];
final DocletTag tag = method.getTagByName( getNS() + Tags.DELIMITER + KEY );
if( tag != null )
{
type =
resolveType( getNamedParameter( tag, TYPE_PARAM, CONTEXT_CLASS ) );
strategy = getNamedParameter( tag, STRATEGY_PARAM, null );
break;
}
}
Properties properties = null;
if( strategy != null )
{
properties = new Properties();
properties.setProperty(
ContextDescriptor.STRATEGY_KEY, strategy );
}
return new ContextDescriptor( type, entries, properties );
}
}