KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > relaxng > impl > RecoverAfterFunction


1 package com.thaiopensource.relaxng.impl;
2
3 class RecoverAfterFunction extends AbstractPatternFunction {
4   private final ValidatorPatternBuilder builder;
5
6   RecoverAfterFunction(ValidatorPatternBuilder builder) {
7     this.builder = builder;
8   }
9
10   public Object JavaDoc caseOther(Pattern p) {
11     throw new RuntimeException JavaDoc("recover after botch");
12   }
13
14   public Object JavaDoc caseChoice(ChoicePattern p) {
15     return builder.makeChoice(p.getOperand1().applyForPattern(this),
16                   p.getOperand2().applyForPattern(this));
17   }
18
19   public Object JavaDoc caseAfter(AfterPattern p) {
20     return p.getOperand2();
21   }
22 }
23
Popular Tags