1 16 17 package org.apache.taglibs.xtags.xpath; 18 19 20 import javax.servlet.jsp.JspException ; 21 22 import org.dom4j.Node; 23 import org.dom4j.rule.Action; 24 25 30 public class BodyAction implements Action { 31 32 33 private StylesheetTag stylesheetTag; 34 35 private String match; 36 37 private Node contextNode; 38 39 public BodyAction() { 40 } 41 42 public BodyAction(StylesheetTag stylesheetTag, String match) { 43 this.stylesheetTag = stylesheetTag; 44 this.match = match; 45 } 46 47 public String getMatch() { 48 return this.match; 49 } 50 51 public Node getContextNode() { 52 return this.contextNode; 53 } 54 55 56 public void run( Node node ) throws Exception { 59 if ( this.stylesheetTag == null ) { 60 throw new JspException ( "No StylesheetTag. Cannot execute Action"); 61 } 62 else { 63 TemplateExecution te = new TemplateExecution(node, this.match); 64 stylesheetTag.addTemplateExecution(te); 65 } 66 } 67 } 68 | Popular Tags |