1 package com.thaiopensource.relaxng.impl; 2 3 class EmptyPattern extends Pattern { 4 EmptyPattern() { 5 super(true, EMPTY_CONTENT_TYPE, EMPTY_HASH_CODE); 6 } 7 boolean samePattern(Pattern other) { 8 return other instanceof EmptyPattern; 9 } 10 void accept(PatternVisitor visitor) { 11 visitor.visitEmpty(); 12 } 13 Object apply(PatternFunction f) { 14 return f.caseEmpty(this); 15 } 16 void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) 17 throws RestrictionViolationException { 18 switch (context) { 19 case DATA_EXCEPT_CONTEXT: 20 throw new RestrictionViolationException("data_except_contains_empty"); 21 case START_CONTEXT: 22 throw new RestrictionViolationException("start_contains_empty"); 23 } 24 } 25 } 26 | Popular Tags |