1 15 package org.apache.tapestry.components; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 import org.apache.tapestry.AbstractComponent; 19 import org.apache.tapestry.IMarkupWriter; 20 import org.apache.tapestry.IRequestCycle; 21 22 28 29 public abstract class Any extends AbstractComponent 30 { 31 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) 32 { 33 String element = getElement(); 34 35 if (element == null) 36 throw new ApplicationRuntimeException(ComponentMessages.anyElementNotDefined(), this, 37 null, null); 38 39 boolean rewinding = cycle.isRewinding(); 40 41 if (!rewinding) 42 { 43 writer.begin(element); 44 45 renderInformalParameters(writer, cycle); 46 } 47 48 renderBody(writer, cycle); 49 50 if (!rewinding) 51 { 52 writer.end(element); 53 } 54 55 } 56 57 public abstract String getElement(); 58 } | Popular Tags |