Package org.geotools.xml
Class DocumentFactory
Object
DocumentFactory
This is the main entry point into the XSI parsing routines.
Example Use:
Object x = DocumentFactory.getInstance(new URI("MyInstanceDocumentURI");
A selection of the hints available to configure parsing:
VALIDATION_HINT- Boolean.FALSE to disable validationDocumentHandler.DEFAULT_NAMESPACE_HINT_KEY-Schemafor parsing and validationXMLHandlerHints.FLOW_HANDLER_HINTXMLHandlerHints.NAMESPACE_MAPPING- Map<String,URL> namespace mappingXMLHandlerHints.ENTITY_RESOLVER- control entry resolutionDISABLE_EXTERNAL_ENTITIES- Boolean.TRUE to disable entity resolutionXMLHandlerHints.SAX_PARSER_FACTORY- supply factory used bygetParser(Map)
- Author:
- dzwiers, Refractions Research, Inc. http://www.refractions.net
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectgetInstance(InputStream is, Map<String, Object> hints, Level level) Parses the instance data provided.static ObjectgetInstance(URI desiredDocument, Map<String, Object> hints) calls getInstance(URI,Level) with Level.WARNINGstatic ObjectParses the instance data provided.
-
Field Details
-
VALIDATION_HINT
When this hint is contained and set to Boolean.FALSE, element ordering will not be validated. This key may also affect data validation within the parse routines. The inherent safety of the resulting objects is weekend by turning this param to false.- See Also:
-
DISABLE_EXTERNAL_ENTITIES
When this hint is contained and set to Boolean.TRUE, external entities will be disabled. This setting is used to alivate XXE attacks, preventing bothVALIDATION_HINTandXMLHandlerHints.ENTITY_RESOLVERfrom being effective.- See Also:
-
-
Constructor Details
-
DocumentFactory
public DocumentFactory()
-
-
Method Details
-
getInstance
calls getInstance(URI,Level) with Level.WARNING- Parameters:
hints- May be null.- Returns:
- Object
- Throws:
SAXException- See Also:
-
getInstance
public static Object getInstance(URI desiredDocument, Map<String, Object> hints, Level level) throws SAXExceptionParses the instance data provided. This method assumes that the XML document is fully described using XML Schemas. Failure to be fully described as Schemas will result in errors, as opposed to a vid parse.- Parameters:
hints- May be null.- Returns:
- Object
- Throws:
SAXException- See Also:
-
DocumentFactory#getInstance(URI, Map, Level, boolean)
-
getInstance
public static Object getInstance(InputStream is, Map<String, Object> hints, Level level) throws SAXExceptionParses the instance data provided. This method assumes that the XML document is fully described using XML Schemas. Failure to be fully described as Schemas will result in errors, as opposed to a vid parse.- Parameters:
hints- May be null.- Returns:
- Object
- Throws:
SAXException- See Also:
-
DocumentFactory#getInstance(InputStream, Map, Level, boolean)
-