public class DocumentFactory extends Object
Example Use:
Object x = DocumentFactory.getInstance(new URI("MyInstanceDocumentURI");
A selection of the hints available to configure parsing:
VALIDATION_HINT
- Boolean.FALSE to disable validation
DocumentHandler.DEFAULT_NAMESPACE_HINT_KEY
- Schema
for parsing and
validation
XMLHandlerHints.FLOW_HANDLER_HINT
XMLHandlerHints.NAMESPACE_MAPPING
- Map<String,URL> namespace mapping
XMLHandlerHints.ENTITY_RESOLVER
- control entry resolution
DISABLE_EXTERNAL_ENTITIES
- Boolean.TRUE to disable entity resolution
XMLHandlerHints.SAX_PARSER_FACTORY
- supply factory used by getParser(Map)
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_EXTERNAL_ENTITIES
When this hint is contained and set to Boolean.TRUE, external entities will be disabled.
|
static String |
VALIDATION_HINT
When this hint is contained and set to Boolean.FALSE, element ordering will not be validated.
|
Constructor and Description |
---|
DocumentFactory() |
Modifier and Type | Method and Description |
---|---|
static Object |
getInstance(InputStream is,
Map<String,Object> hints,
Level level)
Parses the instance data provided.
|
static Object |
getInstance(URI desiredDocument,
Map<String,Object> hints)
calls getInstance(URI,Level) with Level.WARNING
|
static Object |
getInstance(URI desiredDocument,
Map hints,
Level level)
Parses the instance data provided.
|
public static final String VALIDATION_HINT
public static final String DISABLE_EXTERNAL_ENTITIES
VALIDATION_HINT
and XMLHandlerHints.ENTITY_RESOLVER
from being effective.public static Object getInstance(URI desiredDocument, Map<String,Object> hints) throws SAXException
desiredDocument
- hints
- May be null.SAXException
getInstance(URI, Map, Level)
public static Object getInstance(URI desiredDocument, Map hints, Level level) throws SAXException
desiredDocument
- hints
- May be null.level
- SAXException
DocumentFactory#getInstance(URI, Map, Level, boolean)
public static Object getInstance(InputStream is, Map<String,Object> hints, Level level) throws SAXException
is
- hints
- May be null.level
- SAXException
DocumentFactory#getInstance(InputStream, Map, Level, boolean)
Copyright © 1996–2019 Geotools. All rights reserved.