01: package org.kohsuke.rngom.binary;
02:
03: import org.kohsuke.rngom.binary.visitor.PatternFunction;
04: import org.kohsuke.rngom.binary.visitor.PatternVisitor;
05:
06: public class NotAllowedPattern extends Pattern {
07: NotAllowedPattern() {
08: super (false, EMPTY_CONTENT_TYPE, NOT_ALLOWED_HASH_CODE);
09: }
10:
11: boolean isNotAllowed() {
12: return true;
13: }
14:
15: boolean samePattern(Pattern other) {
16: // needs to work for UnexpandedNotAllowedPattern
17: return other.getClass() == this .getClass();
18: }
19:
20: public void accept(PatternVisitor visitor) {
21: visitor.visitNotAllowed();
22: }
23:
24: public Object apply(PatternFunction f) {
25: return f.caseNotAllowed(this);
26: }
27: }
|