Package overit.geocall.xml
Class SchemaProvider
java.lang.Object
overit.geocall.xml.SchemaProvider
This class is an implementation of easy security settings XML schema parsers.
Inspired by http://openjdk.java.net/jeps/185
Inspired by http://openjdk.java.net/jeps/185
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTool for building xml schema.SchemaProvider(boolean secureProcessing) Tool for parsing xml securely. -
Method Summary
Modifier and TypeMethodDescriptioncreates a newSchemabased on the current object configurationvoidsetDisallowDoctypeDecl(boolean disallowDoctypeDecl) Defines if allowing or not the DOCTYPE declaration in the XML to be processed
-
Field Details
-
sf
-
-
Constructor Details
-
SchemaProvider
public SchemaProvider()Tool for building xml schema. By default it configures all the factories with FEATURE_SECURE_POLICY, but it offers one more method (most proprietary) to customize parsers to prevent security issues
See https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet -
SchemaProvider
public SchemaProvider(boolean secureProcessing) Tool for parsing xml securely. It configures all the factories with FEATURE_SECURE_POLICY dependent on the parametersecureProcessing, but it offers one more method (most proprietary) to customize parsers to prevent security issues
See https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet- Parameters:
secureProcessing-truefor configuring the factories with the feature FEATURE_SECURE_POLICY
-
-
Method Details
-
setDisallowDoctypeDecl
Defines if allowing or not the DOCTYPE declaration in the XML to be processed- Parameters:
disallowDoctypeDecl-trueto allow andfalseto get an error if the xml has any kind of DOCTYPE declaration- Throws:
SAXException- if there is any problem parsing the document with the current object configuration
-
newSchema
creates a newSchemabased on the current object configuration- Parameters:
xsdUrl- the URL of the document containing the xsd definition for the schema- Returns:
- a new
Schemabased on the current object configuration - Throws:
SAXException- if there is any problem parsing the document with the current object configuration
-