001    package railo.runtime.tag;
002    
003    import javax.servlet.jsp.tagext.Tag;
004    
005    import railo.runtime.exp.ApplicationException;
006    import railo.runtime.exp.TagNotSupported;
007    import railo.runtime.ext.tag.TagImpl;
008    
009    public final class ReportParam extends TagImpl {
010            
011            private ReportParamBean param=new ReportParamBean();
012            
013    
014            public ReportParam() throws TagNotSupported {
015                    // TODO implement tag
016                    throw new TagNotSupported("ReportParam");
017            }
018            
019            @Override
020            public void release() {
021                    this.param=new ReportParamBean();
022                    super.release();
023            }
024            
025            /**
026             * @param name the name to set
027             */
028            public void setName(String name) {
029                    param.setName(name);
030            }
031            /**
032             * @param value the value to set
033             */
034            public void setValue(Object value) {
035                    param.setValue(value);
036            }
037            
038            public int doStartTag() throws ApplicationException {
039                    // check 
040                    
041                    // provide to parent
042                    Tag parent=this;
043                    do{
044                            parent = parent.getParent();
045                            if(parent instanceof Report) {
046                                    ((Report)parent).addReportParam(param);
047                                    break;
048                            }
049                    }
050                    while(parent!=null);
051                    
052                    return SKIP_BODY;
053            }
054    }
055