1 5 package com.teamkonzept.web.templates; 6 7 import java.util.*; 8 import com.oroinc.text.regex.*; 9 10 import com.teamkonzept.lib.*; 11 import com.teamkonzept.lib.templates.*; 12 import com.teamkonzept.web.*; 13 14 17 public class TKHTMLTemplateSyntax extends TKTemplateSyntax { 18 19 static protected final String patCheckMarker = "CHK"; 20 static protected final String patSelectMarker = "SEL"; 21 static protected final String patOptionMarker = "OPT"; 22 23 public static final String currYear = Integer.toString( (new java.util.Date ()).getYear()+1900 ); 24 25 public TKTemplate getNewTemplate() 26 { 27 return new TKHTMLTemplate( this ); 28 } 29 30 public TKTemplateData getNewTemplateData() 31 { 32 return new TKHTMLTemplateData(); 33 } 34 35 public String getDefaultEncoding() 36 { 37 return TKHtmlConverter.CONV_ID; 38 } 39 40 42 public TKHTMLTemplateSyntax() 43 { 44 } 45 46 public TKHTMLTemplateSyntax(Pattern patTKTag) 47 { 48 super (patTKTag); 49 } 50 51 58 public TKHTMLTemplateSyntax( String text, String source ) throws TKTemplateSyntaxException 59 { 60 super( text, source ); 61 } 62 63 public TKHTMLTemplateSyntax( String text, String source, Pattern patTKTag ) throws TKTemplateSyntaxException 64 { 65 super( text, source, patTKTag ); 66 } 67 68 public TKHTMLTemplateSyntax( String text, String source, boolean applyConverter) throws TKTemplateSyntaxException 69 { 70 super( text, source, applyConverter); 71 } 72 73 96 97 98 public TKHTMLTemplateSyntax( PatternMatcherInput matcherInput, String source ) throws TKTemplateSyntaxException 99 { 100 super( matcherInput, source ); 101 } 102 103 public TKTag getTag( String tagType, String tagData, PatternMatcherInput matcherInput, boolean hasSubTags ) 104 throws TKTemplateSyntaxException 105 { 106 if( tagType.equals(patCheckMarker) ) return new TKCheckTag( this, tagData, hasSubTags ); 107 if( tagType.equals(patSelectMarker) ) return new TKSelectTag( this, tagData, hasSubTags ); 108 if( tagType.equals(patOptionMarker) ) return new TKOptionTag( this, tagData, hasSubTags ); 109 return super.getTag( tagType, tagData, matcherInput, hasSubTags ); 110 } 111 } 113 | Popular Tags |