Changeset 1347
- Timestamp:
- 07/03/09 09:08:00 (14 months ago)
- Location:
- trunk/universe/kauri-template/src
- Files:
-
- 1 removed
- 29 modified
-
main/java/org/kauriproject/template/AttributeBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/BlockStep.java (deleted)
-
main/java/org/kauriproject/template/CallMacroBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/ChooseBlock.java (modified) (1 diff)
-
main/java/org/kauriproject/template/CommentBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/CompiledTemplate.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/DefaultTemplateBuilder.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/DocumentBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/ElementBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/ForEachBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/I18nBundleSwitchBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/IfBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/ImportBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/IncludeBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/InheritBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/InheritanceBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/InitBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/InsertBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/LexicalContextSwitchBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/MacroBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/OtherwiseBlock.java (modified) (1 diff)
-
main/java/org/kauriproject/template/OutputBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/ParameterBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/PrefixMappingFilterBlock.java (modified) (3 diffs)
-
main/java/org/kauriproject/template/ProtectBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/SuperBlock.java (modified) (2 diffs)
-
main/java/org/kauriproject/template/TemplateBlock.java (modified) (1 diff)
-
main/java/org/kauriproject/template/VariableBlock.java (modified) (4 diffs)
-
main/java/org/kauriproject/template/WhenBlock.java (modified) (3 diffs)
-
test/java/org/kauriproject/template/taglib/TestBlock.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/AttributeBlock.java
r487 r1347 47 47 this.elFacade = elFacade; 48 48 this.attributes = saxElement.getAttributes(); 49 this.startStep = new StartStep( this,locator);49 this.startStep = new StartStep(locator); 50 50 } 51 51 52 public BlockStep getStartStep() {52 public Step getStartStep() { 53 53 return startStep; 54 54 } 55 55 56 public BlockStep getEndStep() {56 public Step getEndStep() { 57 57 if (endStep == null) 58 endStep = new EndStep( this,locator);58 endStep = new EndStep(locator); 59 59 60 60 return endStep; 61 61 } 62 62 63 class StartStep extends BlockStep {63 class StartStep extends Step { 64 64 65 65 // attribute stuff … … 71 71 // runtimeNext may be endStep.compiledNext 72 72 73 public StartStep( TemplateBlock templateBlock,Locator locator) {74 super( templateBlock,locator);73 public StartStep(Locator locator) { 74 super(locator); 75 75 name = attributes.getValue(NAME); 76 76 String expression = attributes.getValue(VALUE); … … 98 98 } 99 99 100 class EndStep extends BlockStep {100 class EndStep extends Step { 101 101 102 102 // compiledNext: first following instruction after block 103 103 // runtimeNext idem 104 104 105 public EndStep( TemplateBlock templateBlock,Locator locator) {106 super( templateBlock,locator);105 public EndStep(Locator locator) { 106 super(locator); 107 107 } 108 108 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/CallMacroBlock.java
r1346 r1347 34 34 public CallMacroBlock(Locator locator, SaxElement saxElement) { 35 35 super(locator, saxElement); 36 this.startStep = new StartStep( this,locator);36 this.startStep = new StartStep(locator); 37 37 } 38 38 39 public BlockStep getStartStep() {39 public Step getStartStep() { 40 40 return startStep; 41 41 } 42 42 43 public BlockStep getEndStep() {43 public Step getEndStep() { 44 44 if (endStep == null) 45 endStep = new EndStep( this,locator);45 endStep = new EndStep(locator); 46 46 47 47 return endStep; 48 48 } 49 49 50 class StartStep extends BlockStep {50 class StartStep extends Step { 51 51 52 52 // compiledNext: first following instruction 53 53 // runtimeNext idem 54 54 55 public StartStep( TemplateBlock templateBlock,Locator locator) {56 super( templateBlock,locator);55 public StartStep(Locator locator) { 56 super(locator); 57 57 } 58 58 … … 65 65 } 66 66 67 class EndStep extends BlockStep {67 class EndStep extends Step { 68 68 69 69 // compiledNext: first following instruction after block 70 70 // runtimeNext is the startstep.next of the called macro 71 71 72 public EndStep( TemplateBlock templateBlock,Locator locator) {73 super( templateBlock,locator);72 public EndStep(Locator locator) { 73 super(locator); 74 74 } 75 75 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ChooseBlock.java
r171 r1347 32 32 super(locator, saxElement); 33 33 this.attributes = saxElement.getAttributes(); 34 this.startStep = new StartStep( this,locator);34 this.startStep = new StartStep(locator); 35 35 } 36 36 37 public BlockStep getStartStep() {37 public Step getStartStep() { 38 38 return startStep; 39 39 } 40 40 41 public BlockStep getEndStep() {41 public Step getEndStep() { 42 42 if (endStep == null) 43 endStep = new EndStep( this,locator);43 endStep = new EndStep(locator); 44 44 45 45 return endStep; 46 46 } 47 47 48 class StartStep extends BlockStep {48 class StartStep extends Step { 49 49 50 50 // compiledNext: first nested instruction 51 51 // runtimeNext idem 52 52 53 public StartStep( TemplateBlock templateBlock,Locator locator) {54 super( templateBlock,locator);53 public StartStep(Locator locator) { 54 super(locator); 55 55 } 56 56 } 57 57 58 class EndStep extends BlockStep {58 class EndStep extends Step { 59 59 60 60 // compiledNext: first following instruction after block 61 61 // runtimeNext idem 62 62 63 public EndStep( TemplateBlock templateBlock,Locator locator) {64 super( templateBlock,locator);63 public EndStep(Locator locator) { 64 super(locator); 65 65 } 66 66 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/CommentBlock.java
r1346 r1347 43 43 super(locator, saxElement); 44 44 this.elFacade = elFacade; 45 this.startStep = new StartStep( this,locator);45 this.startStep = new StartStep(locator); 46 46 } 47 47 48 public BlockStep getStartStep() {48 public Step getStartStep() { 49 49 return startStep; 50 50 } 51 51 52 public BlockStep getEndStep() {52 public Step getEndStep() { 53 53 if (endStep == null) 54 endStep = new EndStep( this,locator);54 endStep = new EndStep(locator); 55 55 56 56 return endStep; 57 57 } 58 58 59 class StartStep extends BlockStep {59 class StartStep extends Step { 60 60 61 61 // compiledNext: first following instruction 62 62 // runtimeNext is endStep.compiledNext 63 63 64 public StartStep( TemplateBlock templateBlock,Locator locator) {65 super( templateBlock,locator);64 public StartStep(Locator locator) { 65 super(locator); 66 66 } 67 67 … … 91 91 } 92 92 93 class EndStep extends BlockStep {93 class EndStep extends Step { 94 94 95 95 // compiledNext: first following instruction after block 96 96 // runtimeNext idem 97 97 98 public EndStep( TemplateBlock templateBlock,Locator locator) {99 super( templateBlock,locator);98 public EndStep(Locator locator) { 99 super(locator); 100 100 } 101 101 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/CompiledTemplate.java
r841 r1347 25 25 * Representation of a compiled template by referencing its first "step". 26 26 */ 27 public class CompiledTemplate extends BlockStep {27 public class CompiledTemplate extends Step { 28 28 private String location; 29 29 private Validity validity; … … 32 32 private List<InitBlock> extendList; 33 33 34 public CompiledTemplate( TemplateBlock templateBlock,Locator locator) {35 super( templateBlock,locator);34 public CompiledTemplate(Locator locator) { 35 super(locator); 36 36 } 37 37 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/DefaultTemplateBuilder.java
r1346 r1347 61 61 protected StringBuffer charBuffer;// buffer for characters events 62 62 protected Locator charLocator; // keep also pointer to char location 63 // TODO: (bug) namespace declarations on KTL directives might be ignored (issue #37)64 63 protected NamespaceSupport namespaceSupport; 65 64 /** … … 72 71 protected DocumentBlock docblock; 73 72 protected PrefixMappingFilterBlock prefixMappingFilterBlock; 74 protected BlockStep startStep;75 protected BlockStep endStep;73 protected Step startStep; 74 protected Step endStep; 76 75 protected Step last; 77 76 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/DocumentBlock.java
r909 r1347 30 30 public DocumentBlock(Locator locator) { 31 31 super(locator); 32 this.startStep = new StartStep( this,locator);32 this.startStep = new StartStep(locator); 33 33 } 34 34 35 public BlockStep getStartStep() {35 public Step getStartStep() { 36 36 return startStep; 37 37 } 38 38 39 public BlockStep getEndStep() {39 public Step getEndStep() { 40 40 if (endStep == null) 41 endStep = new EndStep( this,locator);41 endStep = new EndStep(locator); 42 42 43 43 return endStep; … … 50 50 class StartStep extends CompiledTemplate { 51 51 52 public StartStep( TemplateBlock templateBlock,Locator locator) {53 super( templateBlock,locator);52 public StartStep(Locator locator) { 53 super(locator); 54 54 } 55 55 … … 84 84 } 85 85 86 class EndStep extends BlockStep {86 class EndStep extends Step { 87 87 88 public EndStep( TemplateBlock templateBlock,Locator locator) {89 super( templateBlock,locator);88 public EndStep(Locator locator) { 89 super(locator); 90 90 } 91 91 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ElementBlock.java
r1346 r1347 46 46 this.elFacade = elFacade; 47 47 this.attributes = saxElement.getAttributes(); 48 this.startStep = new StartStep( this,locator);49 this.endStep = new EndStep( this,locator);48 this.startStep = new StartStep(locator); 49 this.endStep = new EndStep(locator); 50 50 } 51 51 52 public BlockStep getStartStep() {52 public Step getStartStep() { 53 53 return startStep; 54 54 } 55 55 56 public BlockStep getEndStep() {56 public Step getEndStep() { 57 57 return endStep; 58 58 } 59 59 60 class StartStep extends BlockStep {60 class StartStep extends Step { 61 61 private Expression nameExpression; 62 62 63 public StartStep( TemplateBlock templateBlock,Locator locator) {64 super( templateBlock,locator);63 public StartStep(Locator locator) { 64 super(locator); 65 65 String name = attributes.getValue(NAME); 66 66 … … 89 89 } 90 90 91 class EndStep extends BlockStep {92 public EndStep( TemplateBlock templateBlock,Locator locator) {93 super( templateBlock,locator);91 class EndStep extends Step { 92 public EndStep(Locator locator) { 93 super(locator); 94 94 } 95 95 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ForEachBlock.java
r1346 r1347 53 53 this.elFacade = elFacade; 54 54 this.attributes = saxElement.getAttributes(); 55 this.startStep = new StartStep( this,locator);56 } 57 58 public BlockStep getStartStep() {55 this.startStep = new StartStep(locator); 56 } 57 58 public Step getStartStep() { 59 59 return startStep; 60 60 } 61 61 62 public BlockStep getEndStep() {62 public Step getEndStep() { 63 63 if (endStep == null) 64 endStep = new EndStep( this,locator);64 endStep = new EndStep(locator); 65 65 66 66 return endStep; 67 67 } 68 68 69 class StartStep extends BlockStep {69 class StartStep extends Step { 70 70 71 71 // foreach stuff … … 79 79 // runtimeNext may be endStep.compiledNext 80 80 81 public StartStep( TemplateBlock templateBlock,Locator locator) {82 super( templateBlock,locator);81 public StartStep(Locator locator) { 82 super(locator); 83 83 String begin = attributes.getValue(BEGIN); 84 84 String end = attributes.getValue(END); … … 183 183 } 184 184 185 class EndStep extends BlockStep {185 class EndStep extends Step { 186 186 187 187 // compiledNext: first following instruction after block 188 188 // runtimeNext may be startStep.compiledNext 189 189 190 public EndStep( TemplateBlock templateBlock,Locator locator) {191 super( templateBlock,locator);190 public EndStep(Locator locator) { 191 super(locator); 192 192 } 193 193 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/I18nBundleSwitchBlock.java
r1020 r1347 25 25 26 26 public I18nBundleSwitchBlock(String i18nBundleName) { 27 this.startStep = new StartStep( this,locator);27 this.startStep = new StartStep(locator); 28 28 this.i18nBundleName = i18nBundleName; 29 29 } 30 30 31 public BlockStep getStartStep() {31 public Step getStartStep() { 32 32 return startStep; 33 33 } 34 34 35 public BlockStep getEndStep() {35 public Step getEndStep() { 36 36 if (endStep == null) 37 endStep = new EndStep( this,locator);37 endStep = new EndStep(locator); 38 38 39 39 return endStep; 40 40 } 41 41 42 class StartStep extends BlockStep {43 public StartStep( TemplateBlock templateBlock,Locator locator) {44 super( templateBlock,locator);42 class StartStep extends Step { 43 public StartStep(Locator locator) { 44 super(locator); 45 45 } 46 46 … … 58 58 } 59 59 60 class EndStep extends BlockStep {61 public EndStep( TemplateBlock templateBlock,Locator locator) {62 super( templateBlock,locator);60 class EndStep extends Step { 61 public EndStep(Locator locator) { 62 super(locator); 63 63 } 64 64 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/IfBlock.java
r1346 r1347 45 45 this.elFacade = elFacade; 46 46 this.attributes = saxElement.getAttributes(); 47 this.startStep = new StartStep( this,locator);47 this.startStep = new StartStep(locator); 48 48 } 49 49 50 public BlockStep getStartStep() {50 public Step getStartStep() { 51 51 return startStep; 52 52 } 53 53 54 public BlockStep getEndStep() {54 public Step getEndStep() { 55 55 if (endStep == null) 56 endStep = new EndStep( this,locator);56 endStep = new EndStep(locator); 57 57 58 58 return endStep; 59 59 } 60 60 61 class StartStep extends BlockStep {61 class StartStep extends Step { 62 62 63 63 private Expression elExpression; … … 66 66 // runtimeNext may be endStep.compiledNext 67 67 68 public StartStep( TemplateBlock templateBlock,Locator locator) {69 super( templateBlock,locator);68 public StartStep(Locator locator) { 69 super(locator); 70 70 String expression = attributes.getValue(TEST); 71 71 if (expression == null) … … 89 89 } 90 90 91 class EndStep extends BlockStep {91 class EndStep extends Step { 92 92 93 93 // compiledNext: first following instruction after block 94 94 // runtimeNext idem 95 95 96 public EndStep( TemplateBlock templateBlock,Locator locator) {97 super( templateBlock,locator);96 public EndStep(Locator locator) { 97 super(locator); 98 98 } 99 99 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ImportBlock.java
r1346 r1347 39 39 TemplateService templateService) { 40 40 super(elFacade, locator, saxElement, templateService); 41 this.startStep = new StartStep( this,locator);41 this.startStep = new StartStep(locator); 42 42 } 43 43 44 public BlockStep getStartStep() {44 public Step getStartStep() { 45 45 return startStep; 46 46 } 47 47 48 48 @Override 49 public BlockStep getEndStep() {49 public Step getEndStep() { 50 50 if (endStep == null) 51 endStep = new EndStep( this,locator);51 endStep = new EndStep(locator); 52 52 53 53 return endStep; 54 54 } 55 55 56 class StartStep extends BlockStep {56 class StartStep extends Step { 57 57 58 58 private Expression sourceExpression; … … 61 61 // runtimeNext: imported.startstep 62 62 63 public StartStep( TemplateBlock templateBlock,Locator locator) {64 super( templateBlock,locator);63 public StartStep(Locator locator) { 64 super(locator); 65 65 String expression = attributes.getValue(SRC); 66 66 if (expression == null) 67 throw new TemplateException(SRC + " attribute is required on " + templateBlock.getSaxElement().getName());67 throw new TemplateException(SRC + " attribute is required on " + Directive.IMPORT.getTagName()); 68 68 sourceExpression = elFacade.createExpression(expression, String.class); 69 69 String mode = attributes.getValue(MODE); … … 115 115 } 116 116 117 class EndStep extends BlockStep {117 class EndStep extends Step { 118 118 119 public EndStep( TemplateBlock templateBlock,Locator locator) {120 super( templateBlock,locator);119 public EndStep(Locator locator) { 120 super(locator); 121 121 } 122 122 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/IncludeBlock.java
r1346 r1347 50 50 this.elFacade = elFacade; 51 51 this.attributes = saxElement.getAttributes(); 52 this.startStep = new StartStep( this,locator);52 this.startStep = new StartStep(locator); 53 53 this.templateService = templateService; 54 54 } 55 55 56 public BlockStep getStartStep() {56 public Step getStartStep() { 57 57 return startStep; 58 58 } 59 59 60 public BlockStep getEndStep() {60 public Step getEndStep() { 61 61 if (endStep == null) 62 endStep = new EndStep( this,locator);62 endStep = new EndStep(locator); 63 63 64 64 return endStep; 65 65 } 66 66 67 class StartStep extends BlockStep {67 class StartStep extends Step { 68 68 69 69 private Expression sourceExpression; … … 72 72 // runtimeNext: included.startstep 73 73 74 public StartStep( TemplateBlock templateBlock,Locator locator) {75 super( templateBlock,locator);74 public StartStep(Locator locator) { 75 super(locator); 76 76 String expression = attributes.getValue(SRC); 77 77 if (expression == null) 78 throw new TemplateException(SRC + " attribute is required on " + templateBlock.getSaxElement().getName());78 throw new TemplateException(SRC + " attribute is required on " + Directive.INCLUDE.getTagName()); 79 79 sourceExpression = elFacade.createExpression(expression, String.class); 80 80 String mode = attributes.getValue(MODE); … … 118 118 } 119 119 120 class EndStep extends BlockStep {120 class EndStep extends Step { 121 121 122 122 // compiledNext: first following instruction after block 123 123 // runtimeNext idem 124 124 125 public EndStep( TemplateBlock templateBlock,Locator locator) {126 super( templateBlock,locator);125 public EndStep(Locator locator) { 126 super(locator); 127 127 } 128 128 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/InheritBlock.java
r1346 r1347 44 44 this.elFacade = elFacade; 45 45 this.attributes = saxElement.getAttributes(); 46 this.startStep = new StartStep( this,locator);46 this.startStep = new StartStep(locator); 47 47 this.templateService = templateService; 48 48 } 49 49 50 public BlockStep getStartStep() {50 public Step getStartStep() { 51 51 return startStep; 52 52 } 53 53 54 public BlockStep getEndStep() {54 public Step getEndStep() { 55 55 if (endStep == null) 56 endStep = new EndStep( this,locator);56 endStep = new EndStep(locator); 57 57 58 58 return endStep; 59 59 } 60 60 61 class StartStep extends BlockStep {61 class StartStep extends Step { 62 62 63 63 private Expression inheritExpression; 64 64 65 public StartStep( TemplateBlock templateBlock,Locator locator) {66 super( templateBlock,locator);65 public StartStep(Locator locator) { 66 super(locator); 67 67 inheritExpression = elFacade.createExpression(attributes.getValue(TemplateBuilder.NAMESPACE_KTL, INHERIT), String.class); 68 68 } … … 105 105 } 106 106 107 class EndStep extends BlockStep {107 class EndStep extends Step { 108 108 109 public EndStep( TemplateBlock templateBlock,Locator locator) {110 super( templateBlock,locator);109 public EndStep(Locator locator) { 110 super(locator); 111 111 } 112 112 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/InheritanceBlock.java
r1346 r1347 38 38 public InheritanceBlock(Locator locator, SaxElement saxElement) { 39 39 super(locator, saxElement); 40 this.startStep = new StartStep( this,locator);40 this.startStep = new StartStep(locator); 41 41 this.name = saxElement.getAttributes().getValue(NAME); 42 42 } 43 43 44 public BlockStep getStartStep() {44 public Step getStartStep() { 45 45 return startStep; 46 46 } 47 47 48 public BlockStep getEndStep() {48 public Step getEndStep() { 49 49 if (endStep == null) 50 endStep = new EndStep( this,locator);50 endStep = new EndStep(locator); 51 51 52 52 return endStep; … … 57 57 } 58 58 59 class StartStep extends BlockStep {59 class StartStep extends Step { 60 60 61 public StartStep( TemplateBlock templateBlock,Locator locator) {62 super( templateBlock,locator);61 public StartStep(Locator locator) { 62 super(locator); 63 63 } 64 64 … … 72 72 } 73 73 74 class EndStep extends BlockStep {74 class EndStep extends Step { 75 75 76 public EndStep( TemplateBlock templateBlock,Locator locator) {77 super( templateBlock,locator);76 public EndStep(Locator locator) { 77 super(locator); 78 78 } 79 79 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/InitBlock.java
r841 r1347 30 30 public InitBlock(Locator locator, SaxElement saxElement) { 31 31 super(locator, saxElement); 32 this.startStep = new StartStep( this,locator);32 this.startStep = new StartStep(locator); 33 33 } 34 34 35 public BlockStep getStartStep() {35 public Step getStartStep() { 36 36 return startStep; 37 37 } 38 38 39 public BlockStep getEndStep() {39 public Step getEndStep() { 40 40 if (endStep == null) 41 endStep = new EndStep( this,locator);41 endStep = new EndStep(locator); 42 42 43 43 return endStep; 44 44 } 45 45 46 class StartStep extends BlockStep {46 class StartStep extends Step { 47 47 48 public StartStep( TemplateBlock templateBlock,Locator locator) {49 super( templateBlock,locator);48 public StartStep(Locator locator) { 49 super(locator); 50 50 } 51 51 … … 61 61 } 62 62 63 class EndStep extends BlockStep {63 class EndStep extends Step { 64 64 65 public EndStep( TemplateBlock templateBlock,Locator locator) {66 super( templateBlock,locator);65 public EndStep(Locator locator) { 66 super(locator); 67 67 } 68 68 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/InsertBlock.java
r1346 r1347 54 54 this.elFacade = elFacade; 55 55 this.attributes = saxElement.getAttributes(); 56 this.startStep = new StartStep( this,locator);56 this.startStep = new StartStep(locator); 57 57 this.parser = parser; 58 58 } 59 59 60 public BlockStep getStartStep() {60 public Step getStartStep() { 61 61 return startStep; 62 62 } 63 63 64 public BlockStep getEndStep() {64 public Step getEndStep() { 65 65 if (endStep == null) 66 endStep = new EndStep( this,locator);66 endStep = new EndStep(locator); 67 67 68 68 return endStep; 69 69 } 70 70 71 class StartStep extends BlockStep {71 class StartStep extends Step { 72 72 73 73 private Expression sourceExpression; 74 74 private String mode; 75 75 76 public StartStep( TemplateBlock templateBlock,Locator locator) {77 super( templateBlock,locator);76 public StartStep(Locator locator) { 77 super(locator); 78 78 String expression = attributes.getValue(SRC); 79 79 sourceExpression = elFacade.createExpression(expression, String.class); … … 126 126 } 127 127 128 class EndStep extends BlockStep {128 class EndStep extends Step { 129 129 130 public EndStep( TemplateBlock templateBlock,Locator locator) {131 super( templateBlock,locator);130 public EndStep(Locator locator) { 131 super(locator); 132 132 } 133 133 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/LexicalContextSwitchBlock.java
r999 r1347 37 37 this.sourceContext = source.getSourceContext(); 38 38 this.baseUri = source.getReferenceInContext(); 39 this.startStep = new StartStep( this,locator);39 this.startStep = new StartStep(locator); 40 40 this.i18nBundleName = i18nBundleName; 41 41 } 42 42 43 public BlockStep getStartStep() {43 public Step getStartStep() { 44 44 return startStep; 45 45 } 46 46 47 public BlockStep getEndStep() {47 public Step getEndStep() { 48 48 if (endStep == null) 49 endStep = new EndStep( this,locator);49 endStep = new EndStep(locator); 50 50 51 51 return endStep; 52 52 } 53 53 54 class StartStep extends BlockStep {55 public StartStep( TemplateBlock templateBlock,Locator locator) {56 super( templateBlock,locator);54 class StartStep extends Step { 55 public StartStep(Locator locator) { 56 super(locator); 57 57 } 58 58 … … 76 76 } 77 77 78 class EndStep extends BlockStep {79 public EndStep( TemplateBlock templateBlock,Locator locator) {80 super( templateBlock,locator);78 class EndStep extends Step { 79 public EndStep(Locator locator) { 80 super(locator); 81 81 } 82 82 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/MacroBlock.java
r1346 r1347 36 36 public MacroBlock(Locator locator, SaxElement saxElement) { 37 37 super(locator, saxElement); 38 this.startStep = new StartStep( this,locator);38 this.startStep = new StartStep(locator); 39 39 this.name = saxElement.getAttributes().getValue(NAME); 40 40 } 41 41 42 public BlockStep getStartStep() {42 public Step getStartStep() { 43 43 return startStep; 44 44 } 45 45 46 public BlockStep getEndStep() {46 public Step getEndStep() { 47 47 if (endStep == null) 48 endStep = new EndStep( this,locator);48 endStep = new EndStep(locator); 49 49 50 50 return endStep; … … 55 55 } 56 56 57 class StartStep extends BlockStep {57 class StartStep extends Step { 58 58 59 59 // compiledNext: first nested instruction 60 60 // runtimeNext endstep.next 61 61 62 public StartStep( TemplateBlock templateBlock,Locator locator) {63 super( templateBlock,locator);62 public StartStep(Locator locator) { 63 super(locator); 64 64 } 65 65 … … 70 70 } 71 71 72 class EndStep extends BlockStep {72 class EndStep extends Step { 73 73 74 74 // compiledNext: first following instruction after block 75 75 // runtimeNext endstep.next of the 'calling' macro 76 76 77 public EndStep( TemplateBlock templateBlock,Locator locator) {78 super( templateBlock,locator);77 public EndStep(Locator locator) { 78 super(locator); 79 79 } 80 80 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/OtherwiseBlock.java
r487 r1347 42 42 this.chooseBlock = chooseBlock; 43 43 this.attributes = saxElement.getAttributes(); 44 this.startStep = new StartStep( this,locator);44 this.startStep = new StartStep(locator); 45 45 } 46 46 47 public BlockStep getStartStep() {47 public Step getStartStep() { 48 48 return startStep; 49 49 } 50 50 51 public BlockStep getEndStep() {51 public Step getEndStep() { 52 52 if (endStep == null) 53 endStep = new EndStep( this,locator);53 endStep = new EndStep(locator); 54 54 55 55 return endStep; 56 56 } 57 57 58 class StartStep extends BlockStep {58 class StartStep extends Step { 59 59 60 60 // compiledNext: first nested instruction 61 61 // runtimeNext idem 62 62 63 public StartStep( TemplateBlock templateBlock,Locator locator) {64 super( templateBlock,locator);63 public StartStep(Locator locator) { 64 super(locator); 65 65 } 66 66 } 67 67 68 class EndStep extends BlockStep {68 class EndStep extends Step { 69 69 70 70 // compiledNext: first following instruction after block, i.e. chooseBlock.endStep 71 71 // runtimeNext: we prefer to skip a step and goto chooseBlock.endStep.compiledNext 72 72 73 public EndStep( TemplateBlock templateBlock,Locator locator) {74 super( templateBlock,locator);73 public EndStep(Locator locator) { 74 super(locator); 75 75 } 76 76 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/OutputBlock.java
r909 r1347 42 42 this.elFacade = elFacade; 43 43 this.attributes = saxElement.getAttributes(); 44 this.startStep = new StartStep( this,locator);44 this.startStep = new StartStep(locator); 45 45 this.root = root; 46 46 } 47 47 48 public BlockStep getStartStep() {48 public Step getStartStep() { 49 49 return startStep; 50 50 } 51 51 52 public BlockStep getEndStep() {52 public Step getEndStep() { 53 53 if (endStep == null) 54 endStep = new EndStep( this,locator);54 endStep = new EndStep(locator); 55 55 56 56 return endStep; 57 57 } 58 58 59 class StartStep extends BlockStep {59 class StartStep extends Step { 60 60 61 61 // EL … … 63 63 private String expression; 64 64 65 public StartStep( TemplateBlock templateBlock,Locator locator) {66 super( templateBlock,locator);65 public StartStep(Locator locator) { 66 super(locator); 67 67 if (attributes.getLength() > 0) { 68 68 elExpressions = new ArrayList<Expression>(); … … 104 104 } 105 105 106 class EndStep extends BlockStep {106 class EndStep extends Step { 107 107 108 public EndStep( TemplateBlock templateBlock,Locator locator) {109 super( templateBlock,locator);108 public EndStep(Locator locator) { 109 super(locator); 110 110 } 111 111 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ParameterBlock.java
r1110 r1347 48 48 this.elFacade = elFacade; 49 49 this.attributes = saxElement.getAttributes(); 50 this.startStep = new StartStep( this,locator);50 this.startStep = new StartStep(locator); 51 51 } 52 52 53 public BlockStep getStartStep() {53 public Step getStartStep() { 54 54 return startStep; 55 55 } 56 56 57 public BlockStep getEndStep() {57 public Step getEndStep() { 58 58 if (endStep == null) 59 endStep = new EndStep( this,locator);59 endStep = new EndStep(locator); 60 60 61 61 return endStep; 62 62 } 63 63 64 class StartStep extends BlockStep {64 class StartStep extends Step { 65 65 66 66 // variable stuff … … 68 68 private final Expression elExpression; 69 69 70 public StartStep( TemplateBlock templateBlock,Locator locator) {71 super( templateBlock,locator);70 public StartStep(Locator locator) { 71 super(locator); 72 72 name = attributes.getValue(NAME); 73 73 String expression = attributes.getValue(VALUE); … … 93 93 } 94 94 95 class EndStep extends BlockStep {95 class EndStep extends Step { 96 96 97 97 // compiledNext: first following instruction after block 98 98 // runtimeNext: idem 99 99 100 public EndStep( TemplateBlock templateBlock,Locator locator) {101 super( templateBlock,locator);100 public EndStep(Locator locator) { 101 super(locator); 102 102 } 103 103 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/PrefixMappingFilterBlock.java
r967 r1347 35 35 public PrefixMappingFilterBlock() { 36 36 super(); 37 this.startStep = new StartStep( this,locator);38 this.endStep = new EndStep( this,locator);37 this.startStep = new StartStep(locator); 38 this.endStep = new EndStep(locator); 39 39 } 40 40 41 public BlockStep getStartStep() {41 public Step getStartStep() { 42 42 return startStep; 43 43 } 44 44 45 public BlockStep getEndStep() {45 public Step getEndStep() { 46 46 return endStep; 47 47 } … … 68 68 } 69 69 70 class StartStep extends BlockStep {71 public StartStep( TemplateBlock templateBlock,Locator locator) {72 super( templateBlock,locator);70 class StartStep extends Step { 71 public StartStep(Locator locator) { 72 super(locator); 73 73 } 74 74 … … 80 80 } 81 81 82 class EndStep extends BlockStep {83 public EndStep( TemplateBlock templateBlock,Locator locator) {84 super( templateBlock,locator);82 class EndStep extends Step { 83 public EndStep(Locator locator) { 84 super(locator); 85 85 } 86 86 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/ProtectBlock.java
r1346 r1347 23 23 this.elFacade = elFacade; 24 24 this.attributes = saxElement.getAttributes(); 25 this.startStep = new StartStep( this,locator);25 this.startStep = new StartStep(locator); 26 26 } 27 27 28 public BlockStep getStartStep() {28 public Step getStartStep() { 29 29 return startStep; 30 30 } 31 31 32 public BlockStep getEndStep() {32 public Step getEndStep() { 33 33 if (endStep == null) 34 endStep = new EndStep( this,locator);34 endStep = new EndStep(locator); 35 35 36 36 return endStep; 37 37 } 38 38 39 class StartStep extends BlockStep {39 class StartStep extends Step { 40 40 41 41 private Expression accessExpr; 42 42 43 public StartStep( TemplateBlock templateBlock,Locator locator) {44 super( templateBlock,locator);43 public StartStep(Locator locator) { 44 super(locator); 45 45 String expression = attributes.getValue(ACCESS_ATTR); 46 46 if (expression == null) … … 78 78 } 79 79 80 class EndStep extends BlockStep {80 class EndStep extends Step { 81 81 82 public EndStep( TemplateBlock templateBlock,Locator locator) {83 super( templateBlock,locator);82 public EndStep(Locator locator) { 83 super(locator); 84 84 } 85 85 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/SuperBlock.java
r1346 r1347 45 45 this.inheritanceBlock = inheritanceBlock; 46 46 this.attributes = saxElement.getAttributes(); 47 this.startStep = new StartStep( this,locator);48 this.endStep = new EndStep( this,locator);47 this.startStep = new StartStep(locator); 48 this.endStep = new EndStep(locator); 49 49 } 50 50 51 public BlockStep getStartStep() {51 public Step getStartStep() { 52 52 return startStep; 53 53 } 54 54 55 public BlockStep getEndStep() {55 public Step getEndStep() { 56 56 return endStep; 57 57 } 58 58 59 class StartStep extends BlockStep {59 class StartStep extends Step { 60 60 61 public StartStep( TemplateBlock templateBlock,Locator locator) {62 super( templateBlock,locator);61 public StartStep(Locator locator) { 62 super(locator); 63 63 } 64 64 … … 87 87 } 88 88 89 class EndStep extends BlockStep {89 class EndStep extends Step { 90 90 91 public EndStep( TemplateBlock templateBlock,Locator locator) {92 super( templateBlock,locator);91 public EndStep(Locator locator) { 92 super(locator); 93 93 } 94 94 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/TemplateBlock.java
r576 r1347 39 39 } 40 40 41 public abstract BlockStep getStartStep();41 public abstract Step getStartStep(); 42 42 43 public abstract BlockStep getEndStep();43 public abstract Step getEndStep(); 44 44 45 45 public SaxElement getSaxElement() { -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/VariableBlock.java
r1346 r1347 18 18 import java.io.*; 19 19 20 import org.apache.commons.logging.Log;21 import org.apache.commons.logging.LogFactory;22 20 import org.kauriproject.template.KauriSaxHandler.OutputFormat; 23 21 import org.kauriproject.template.el.ELFacade; … … 57 55 this.elFacade = elFacade; 58 56 this.attributes = saxElement.getAttributes(); 59 this.startStep = new StartStep( this,locator);60 } 61 62 public BlockStep getStartStep() {57 this.startStep = new StartStep(locator); 58 } 59 60 public Step getStartStep() { 63 61 return startStep; 64 62 } 65 63 66 public BlockStep getEndStep() {64 public Step getEndStep() { 67 65 if (endStep == null) 68 endStep = new EndStep( this,locator);66 endStep = new EndStep(locator); 69 67 70 68 return endStep; 71 69 } 72 70 73 class StartStep extends BlockStep {71 class StartStep extends Step { 74 72 75 73 // variable stuff … … 83 81 // runtimeNext may be endStep.compiledNext 84 82 85 public StartStep( TemplateBlock templateBlock,Locator locator) {86 super( templateBlock,locator);83 public StartStep(Locator locator) { 84 super(locator); 87 85 name = attributes.getValue(NAME); 88 86 … … 192 190 } 193 191 194 class EndStep extends BlockStep {192 class EndStep extends Step { 195 193 196 194 // compiledNext: first following instruction after block 197 195 // runtimeNext idem 198 196 199 public EndStep( TemplateBlock templateBlock,Locator locator) {200 super( templateBlock,locator);197 public EndStep(Locator locator) { 198 super(locator); 201 199 } 202 200 -
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/WhenBlock.java
r487 r1347 51 51 this.chooseBlock = chooseBlock; 52 52 this.attributes = saxElement.getAttributes(); 53 this.startStep = new StartStep( this,locator);53 this.startStep = new StartStep(locator); 54 54 } 55 55 56 public BlockStep getStartStep() {56 public Step getStartStep() { 57 57 return startStep; 58 58 } 59 59 60 public BlockStep getEndStep() {60 public Step getEndStep() { 61 61 if (endStep == null) 62 endStep = new EndStep( this,locator);62 endStep = new EndStep(locator); 63 63 64 64 return endStep; 65 65 } 66 66 67 class StartStep extends BlockStep {67 class StartStep extends Step { 68 68 69 69 private Expression elExpression; … … 72 72 // runtimeNext may be endStep.compiledNext 73 73 74 public StartStep( TemplateBlock templateBlock,Locator locator) {75 super( templateBlock,locator);74 public StartStep(Locator locator) { 75 super(locator); 76 76 String expression = attributes.getValue(TEST); 77 77 elExpression = elFacade.createExpression(expression, Boolean.class); … … 92 92 } 93 93 94 class EndStep extends BlockStep {94 class EndStep extends Step { 95 95 96 96 // compiledNext: first following instruction after block 97 97 // runtimeNext: always chooseBlock.endStep.compiledNext ! 98 98 99 public EndStep( TemplateBlock templateBlock,Locator locator) {100 super( templateBlock,locator);99 public EndStep(Locator locator) { 100 super(locator); 101 101 } 102 102 -
trunk/universe/kauri-template/src/test/java/org/kauriproject/template/taglib/TestBlock.java
r487 r1347 56 56 this.elFacade = elFacade; 57 57 this.attributes = saxElement.getAttributes(); 58 this.startStep = new StartStep( this,locator);58 this.startStep = new StartStep(locator); 59 59 this.textStep = new TextStep(elFacade, locator, TEXT.toCharArray(), 0, TEXT.length()); 60 60 } 61 61 62 public BlockStep getStartStep() {62 public Step getStartStep() { 63 63 return startStep; 64 64 } 65 65 66 public BlockStep getEndStep() {66 public Step getEndStep() { 67 67 if (endStep == null) 68 endStep = new EndStep( this,locator);68 endStep = new EndStep(locator); 69 69 70 70 return endStep; 71 71 } 72 72 73 class StartStep extends BlockStep {73 class StartStep extends Step { 74 74 75 75 private Expression elExpression; … … 78 78 // runtimeNext may be newly composed step 79 79 80 public StartStep( TemplateBlock templateBlock,Locator locator) {81 super( templateBlock,locator);80 public StartStep( Locator locator) { 81 super(locator); 82 82 String expression = attributes.getValue(TEST); 83 83 elExpression = elFacade.createExpression(expression, Boolean.class); … … 99 99 } 100 100 101 class EndStep extends BlockStep {101 class EndStep extends Step { 102 102 103 103 // compiledNext: first following instruction after block 104 104 // runtimeNext idem 105 105 106 public EndStep( TemplateBlock templateBlock,Locator locator) {107 super( templateBlock,locator);106 public EndStep(Locator locator) { 107 super(locator); 108 108 } 109 109