1 package org.relaxng.datatype.helpers; 2 3 import org.relaxng.datatype.*; 4 5 27 public final class StreamingValidatorImpl implements DatatypeStreamingValidator { 28 29 30 private final StringBuffer buffer = new StringBuffer (); 31 32 33 private final Datatype baseType; 34 35 36 private final ValidationContext context; 37 38 public void addCharacters( char[] buf, int start, int len ) { 39 buffer.append(buf,start,len); 41 } 42 43 public boolean isValid() { 44 return baseType.isValid(buffer.toString(),context); 45 } 46 47 public void checkValid() throws DatatypeException { 48 baseType.checkValid(buffer.toString(),context); 49 } 50 51 public StreamingValidatorImpl( Datatype baseType, ValidationContext context ) { 52 this.baseType = baseType; 53 this.context = context; 54 } 55 } 56 | Popular Tags |