Search in sources :

Example 6 with TypedInputSource

use of nu.validator.xml.TypedInputSource in project validator by validator.

the class SourceCode method initialize.

public void initialize(InputSource inputSource) {
    this.uri = inputSource.getSystemId();
    this.encoding = inputSource.getEncoding();
    if (inputSource instanceof TypedInputSource) {
        TypedInputSource typedInputSource = (TypedInputSource) inputSource;
        int length = typedInputSource.getLength();
        if (length == -1) {
            expectedLength = 2048;
        } else {
            expectedLength = length;
        }
        this.type = typedInputSource.getType();
    } else {
        expectedLength = 2048;
        this.type = null;
    }
}
Also used : TypedInputSource(nu.validator.xml.TypedInputSource)

Aggregations

TypedInputSource (nu.validator.xml.TypedInputSource)6 SchemaReader (com.thaiopensource.validate.SchemaReader)3 AutoSchemaReader (com.thaiopensource.validate.auto.AutoSchemaReader)3 CompactSchemaReader (com.thaiopensource.validate.rng.CompactSchemaReader)3 Schema (com.thaiopensource.validate.Schema)2 IOException (java.io.IOException)2 CheckerSchema (nu.validator.checker.jing.CheckerSchema)2 PropertyMap (com.thaiopensource.util.PropertyMap)1 PropertyMapBuilder (com.thaiopensource.util.PropertyMapBuilder)1 IncorrectSchemaException (com.thaiopensource.validate.IncorrectSchemaException)1 Jaxp11XMLReaderCreator (com.thaiopensource.xml.sax.Jaxp11XMLReaderCreator)1 InputStream (java.io.InputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 StringReader (java.io.StringReader)1 Writer (java.io.Writer)1 SAXDriver (nu.validator.gnu.xml.aelfred2.SAXDriver)1 BoundedInputStream (nu.validator.io.BoundedInputStream)1 StreamBoundException (nu.validator.io.StreamBoundException)1 ContentTypeParser (nu.validator.xml.ContentTypeParser)1 NullEntityResolver (nu.validator.xml.NullEntityResolver)1