View Javadoc

1   /*
2    * Copyright (c) 2001-2003 The XDoclet team
3    * All rights reserved.
4    */
5   package xjavadoc.predicates;
6   
7   import xjavadoc.*;
8   
9   /***
10   * Filter that accepts program elements that have a tag attribute equal to a
11   * certain value
12   *
13   * @created   29. juli 2002
14   */
15  public class TagAttributeEquals extends ProgramElementPredicate
16  {
17  	private String     _tagName;
18  	private String     _attributeName;
19  	private String     _attributeValue;
20  
21  	public TagAttributeEquals( String tagName, String attributeName, String attributeValue )
22  	{
23  		_tagName = tagName;
24  		_attributeName = attributeName;
25  		_attributeValue = attributeValue;
26  	}
27  
28  	public void setTagName( String tagName )
29  	{
30  		_tagName = tagName;
31  	}
32  	public void setAttributeName( String attributeName )
33  	{
34  		_attributeName = attributeName;
35  	}
36  	public void setAttributeValue( String attributeValue )
37  	{
38  		_attributeValue = attributeValue;
39  	}
40  
41  	protected boolean evaluate( XProgramElement programElement )
42  	{
43  		return _attributeValue.equals( programElement.getDoc().getTagAttributeValue( _tagName, _attributeName ) );
44  	}
45  }
46