Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib In directory james.mmbase.org:/tmp/cvs-serv3449
Modified Files: InstanceOfTag.java Log Message: some details, added a 'descendants' attribute for congruity with typeconstraint See also: http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib Index: InstanceOfTag.java =================================================================== RCS file: /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/InstanceOfTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- InstanceOfTag.java 9 Dec 2008 14:29:11 -0000 1.2 +++ InstanceOfTag.java 9 Dec 2008 15:30:02 -0000 1.3 @@ -19,17 +19,18 @@ import org.mmbase.bridge.*; /** - * Lives under a nodeprovider. Can give information about the node, - * like what its nodemanager is. + * Lives under a nodeprovider, as a condition tag, reporting whether or not the node is of a certain builder. * * @author Bert Huijgen - * @version $Id: InstanceOfTag.java,v 1.2 2008/12/09 14:29:11 bert Exp $ + * @version $Id: InstanceOfTag.java,v 1.3 2008/12/09 15:30:02 michiel Exp $ + * @since MMBase-1.9.1 */ public class InstanceOfTag extends NodeReferrerTag implements Condition { private Attribute inverse = Attribute.NULL; private Attribute nodemanager = Attribute.NULL; + private Attribute descendants = Attribute.NULL; public void setInverse(String b) throws JspTagException { inverse = getAttribute(b); @@ -43,12 +44,16 @@ nodemanager = getAttribute(nm); } + public void setDescendants(String d) throws JspTagException { + descendants = getAttribute(d, true); + } + public int doStartTag() throws JspTagException{ Node node = getNode(); NodeManager nm = node.getNodeManager(); NodeManager compareTo = node.getCloud().getNodeManager(nodemanager.getString(this)); - boolean result = nm.equals(compareTo) || compareTo.getDescendants().contains(nm); + boolean result = nm.equals(compareTo) || (descendants.getBoolean(this, true) && compareTo.getDescendants().contains(nm)); if (result != getInverse()) { return EVAL_BODY; _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs