Class SchemaReader
- java.lang.Object
-
- org.apache.camel.support.processor.validation.SchemaReader
-
public class SchemaReader extends Object
Reads the schema used in the processorValidatingProcessor
. A schema re-reading could be forced usingorg.apache.camel.component.validator.ValidatorEndpoint#clearCachedSchema()
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCESS_EXTERNAL_DTD
Key of the global option to switch either off or on the access to external DTDs in the XML Validator for StreamSources.
-
Constructor Summary
Constructors Constructor Description SchemaReader()
SchemaReader(org.apache.camel.CamelContext camelContext, String schemaResourceUri)
Specify a camel context and a schema resource URI in order to read the schema via the class resolver specified in the Camel context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Schema
createSchema()
protected SchemaFactory
createSchemaFactory()
protected Source
createSchemaSource()
LSResourceResolver
getResourceResolver()
Schema
getSchema()
byte[]
getSchemaAsByteArray()
SchemaFactory
getSchemaFactory()
File
getSchemaFile()
String
getSchemaLanguage()
Source
getSchemaSource()
URL
getSchemaUrl()
void
loadSchema()
protected byte[]
readSchemaResource()
void
setResourceResolver(LSResourceResolver resourceResolver)
void
setSchema(Schema schema)
void
setSchemaAsByteArray(byte[] schemaAsByteArray)
void
setSchemaFactory(SchemaFactory schemaFactory)
void
setSchemaFile(File schemaFile)
void
setSchemaLanguage(String schemaLanguage)
void
setSchemaSource(Source schemaSource)
void
setSchemaUrl(URL schemaUrl)
-
-
-
Field Detail
-
ACCESS_EXTERNAL_DTD
public static final String ACCESS_EXTERNAL_DTD
Key of the global option to switch either off or on the access to external DTDs in the XML Validator for StreamSources. Only effective, if not a custom schema factory is used.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SchemaReader
public SchemaReader()
-
SchemaReader
public SchemaReader(org.apache.camel.CamelContext camelContext, String schemaResourceUri)
Specify a camel context and a schema resource URI in order to read the schema via the class resolver specified in the Camel context.
-
-
Method Detail
-
getSchema
public Schema getSchema() throws IOException, SAXException
- Throws:
IOException
SAXException
-
setSchema
public void setSchema(Schema schema)
-
getSchemaLanguage
public String getSchemaLanguage()
-
setSchemaLanguage
public void setSchemaLanguage(String schemaLanguage)
-
getSchemaSource
public Source getSchemaSource() throws IOException
- Throws:
IOException
-
setSchemaSource
public void setSchemaSource(Source schemaSource)
-
getSchemaUrl
public URL getSchemaUrl()
-
setSchemaUrl
public void setSchemaUrl(URL schemaUrl)
-
getSchemaFile
public File getSchemaFile()
-
setSchemaFile
public void setSchemaFile(File schemaFile)
-
getSchemaAsByteArray
public byte[] getSchemaAsByteArray()
-
setSchemaAsByteArray
public void setSchemaAsByteArray(byte[] schemaAsByteArray)
-
getSchemaFactory
public SchemaFactory getSchemaFactory()
-
setSchemaFactory
public void setSchemaFactory(SchemaFactory schemaFactory)
-
getResourceResolver
public LSResourceResolver getResourceResolver()
-
setResourceResolver
public void setResourceResolver(LSResourceResolver resourceResolver)
-
createSchemaFactory
protected SchemaFactory createSchemaFactory()
-
createSchemaSource
protected Source createSchemaSource() throws IOException
- Throws:
IOException
-
createSchema
protected Schema createSchema() throws SAXException, IOException
- Throws:
SAXException
IOException
-
readSchemaResource
protected byte[] readSchemaResource() throws IOException
- Throws:
IOException
-
-