public abstract class AbstractSchemaBindingValidator extends Object implements SchemaBindingValidator
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
excludedNs |
protected Set<QName> |
excludedTypes |
protected static org.jboss.logging.Logger |
log |
protected Set<QName> |
validatedElements |
protected Set<QName> |
validatedTypes |
protected static QName |
WILDCARD |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSchemaBindingValidator() |
protected |
AbstractSchemaBindingValidator(SchemaBindingResolver resolver) |
Modifier and Type | Method and Description |
---|---|
void |
enableLogging(boolean value) |
void |
excludeNs(String ns)
Types and elements from the namespace passed into this method will be excluded from validation.
|
void |
excludeType(QName qName)
Excludes the specified type from validation.
|
SchemaBindingResolver |
getSchemaResolver() |
protected void |
handleError(String msg)
This an error handler method.
|
void |
includeNs(String ns)
Removes the namespace from the excluded set.
|
void |
includeType(QName qName)
Removes the specified type from the excluded set.
|
boolean |
isLoggingEnabled() |
boolean |
isNsExcluded(String ns)
Checks if the specified namespace is excluded from validation.
|
boolean |
isTypeExcluded(QName qName)
Checks if the type is excluded from validation.
|
protected void |
log(String msg)
This method is supposed to log a message.
|
void |
reset()
Resets instance variables (such as a set of validated types and elements).
|
void |
setSchemaResolver(SchemaBindingResolver resolver) |
void |
validate(InputSource is,
SchemaBinding binding)
This method will check that the XSD represented with InputSource and SchemaBinding are consistent.
|
void |
validate(String xsdName,
Class<?>... cls)
Validate xsd schema against classes.
|
protected abstract void |
validate(org.apache.xerces.xs.XSModel xsSchema,
SchemaBinding schemaBinding) |
protected static final org.jboss.logging.Logger log
protected static final QName WILDCARD
protected AbstractSchemaBindingValidator()
protected AbstractSchemaBindingValidator(SchemaBindingResolver resolver)
resolver
- default schema resolverpublic void reset()
public boolean isLoggingEnabled()
public void enableLogging(boolean value)
public void excludeNs(String ns)
SchemaBindingValidator
excludeNs
in interface SchemaBindingValidator
ns
- namespace to excludepublic boolean isNsExcluded(String ns)
SchemaBindingValidator
isNsExcluded
in interface SchemaBindingValidator
ns
- the namespace to checkpublic void includeNs(String ns)
SchemaBindingValidator
includeNs
in interface SchemaBindingValidator
ns
- the namespace to remove from the excluded set.public void excludeType(QName qName)
SchemaBindingValidator
excludeType
in interface SchemaBindingValidator
qName
- the QName of the type to exclude from validationpublic boolean isTypeExcluded(QName qName)
SchemaBindingValidator
isTypeExcluded
in interface SchemaBindingValidator
qName
- the QName of the type to checkpublic void includeType(QName qName)
SchemaBindingValidator
includeType
in interface SchemaBindingValidator
qName
- the QName of type to remove from the excluded set.public SchemaBindingResolver getSchemaResolver()
public void setSchemaResolver(SchemaBindingResolver resolver)
resolver
- The default resolver used to resolve schemaspublic void validate(InputSource is, SchemaBinding binding)
SchemaBindingValidator
validate
in interface SchemaBindingValidator
is
- InputSource of the XSDbinding
- SchemaBindingpublic void validate(String xsdName, Class<?>... cls)
SchemaBindingValidator
validate
in interface SchemaBindingValidator
xsdName
- the schema namecls
- the classes to checkprotected abstract void validate(org.apache.xerces.xs.XSModel xsSchema, SchemaBinding schemaBinding)
protected void handleError(String msg)
msg
- the error messageprotected void log(String msg)
msg
- the message to log.Copyright © 2013 JBoss by Red Hat. All rights reserved.