1 package com.teamkonzept.lib.templates; 2 3 import java.io.*; 4 5 import com.oroinc.text.regex.*; 6 7 import com.teamkonzept.lib.*; 8 9 14 public class TKTagDefinitionTag extends TKLabelTag { 15 public TKTemplateSyntax definitionText; 16 static final int TAG_TYPE = TKIncludeTag.TAG_TYPE+1; 17 18 27 public TKTagDefinitionTag( TKTemplateSyntax parent, String def, PatternMatcherInput matcherInput, boolean hasSubTags ) throws TKTemplateSyntaxException 28 { 29 super( parent, def, hasSubTags ); 30 try { 31 definitionText = parent.newChild( matcherInput, parent.getSource() ); 32 } 33 catch (ArrayIndexOutOfBoundsException e) { throw new TKTemplateSyntaxException(parent.getSource(),"NOEND","TAGDEF", def); 35 } 36 checkError(definitionText,"TAGDEF", def); 37 } 38 39 45 public String apply( TKTemplateData td ) throws TKTemplateSyntaxException 46 { 47 td.setLocalVariable("TAG_DEFINITION_"+getLabel (td),definitionText); 48 49 return null; 50 } 51 52 59 public void apply(TKTemplateData td, Writer writer) 60 throws TKTemplateSyntaxException, IOException 61 { 62 td.setLocalVariable("TAG_DEFINITION_"+getLabel (td),definitionText); 63 } 64 65 } 67 | Popular Tags |