1 5 14 package com.teamkonzept.lib.templates; 15 16 import java.io.*; 17 18 import com.oroinc.text.regex.*; 19 20 import com.teamkonzept.lib.*; 21 22 27 public class TKLocalTag extends TKLabelTag { 28 public TKTemplateSyntax localText; 29 static final int TAG_TYPE = TKIgnoreTag.TAG_TYPE+1; 30 31 40 public TKLocalTag( TKTemplateSyntax parent, String def, PatternMatcherInput matcherInput, boolean hasSubTags ) throws TKTemplateSyntaxException 41 { 42 super( parent, def, hasSubTags ); 43 44 try { 45 localText = parent.newChild( matcherInput, parent.getSource() ); 46 } 47 catch (ArrayIndexOutOfBoundsException e) { throw new TKTemplateSyntaxException(parent.getSource(),"NOEND","LOCAL", def); 49 } 50 checkError(localText,"LOCAL", def); 51 } 52 53 61 public String apply( TKTemplateData td ) throws TKTemplateSyntaxException 62 { 63 getLabel(td); 66 67 TKTemplateData subTd = new TKTemplateData (td); 68 return localText.apply( subTd ); 69 } 70 71 79 public void apply(TKTemplateData td, Writer writer) 80 throws TKTemplateSyntaxException, IOException 81 { 82 getLabel(td); 85 86 TKTemplateData subTd = new TKTemplateData (td); 87 localText.apply( subTd, writer ); 88 } 89 } 90 91 | Popular Tags |