| 1 package org.sapia.magnet.domain; 2 3 import org.sapia.magnet.render.AbstractRenderable; 6 import org.sapia.magnet.render.MagnetContext; 7 import org.sapia.magnet.render.RenderingException; 8 9 10 21 public class ScriptHandlerDef extends AbstractRenderable { 22 23 27 28 private String _theType; 29 30 31 private String _theClassname; 32 33 34 private String _theClasspath; 35 36 40 43 public ScriptHandlerDef() { 44 } 45 46 50 public String getType() { 51 return _theType; 52 } 53 54 public String getClassname() { 55 return _theClassname; 56 } 57 58 public String getClasspath() { 59 return _theClasspath; 60 } 61 62 66 public void setType(String aType) { 67 _theType = aType; 68 } 69 70 public void setClassname(String aClassname) { 71 _theClassname = aClassname; 72 } 73 74 public void setClasspath(String aClasspath) { 75 _theClasspath = aClasspath; 76 } 77 81 87 public void render(MagnetContext aContext) throws RenderingException { 88 _theType = resolveValue(aContext, _theType); 90 _theClassname = resolveValue(aContext, _theClassname); 91 _theClasspath = resolveValue(aContext, _theClasspath); 92 93 HandlerFactory.getInstance().addScriptHandler(_theType, _theClassname); 94 } 95 96 101 public String toString() { 102 StringBuffer aBuffer = new StringBuffer (super.toString()); 103 aBuffer.append("[type=").append(_theType). 104 append(" classname=").append(_theClassname). 105 append(" classpath=").append(_theClasspath). 106 append("]"); 107 108 return aBuffer.toString(); 109 } 110 } 111 | Popular Tags |