View Javadoc

    1   /*
    2    * Copyright (c) 2001-2003 The XDoclet team
    3    * All rights reserved.
    4    */
    5   package xjavadoc.predicates;
    6
    7   import org.apache.commons.collections.Predicate;
    8   import xjavadoc.XProgramElement;
    9
    10  /***
    11   * @created   6. oktober 2002
    12   */
    13  public abstract class ProgramElementPredicate implements Predicate
    14  {
    15  	public final boolean evaluate( Object o )
    16  	{
    17  		if( !( o instanceof XProgramElement ) )
    18  		{
    19  			throw new IllegalArgumentException( "o must be of type XProgramElement, but was: " + o.getClass().getName() );
    20  		}
    21
    22  		XProgramElement programElement = ( XProgramElement ) o;
    23
    24  		return evaluate( programElement );
    25  	}
    26
    27  	protected abstract boolean evaluate( XProgramElement programElement );
    28  }
    29