public class DocumentWriter extends Object
This will create valid XML documents, given an object and a schema.
Modifier and Type | Field and Description |
---|---|
static String |
BASE_ELEMENT
Element or String ... include a ref to an Element to be used, or a string representing the
name of the element
|
static String |
ENCODING
The Encoding which should be used for the Document which should be created.
|
static Logger |
logger
DOCUMENT ME!
|
static String |
SCHEMA_LOCATION_HINT
a map of URI->URI representing targetNamespace->Location
|
static String |
SCHEMA_ORDER
Schema[] or String[]...
|
static String |
USE_NEAREST
boolean ... include the key to use the "nearest" strategy for searching schemas.
|
static String |
WRITE_SCHEMA
Writer ... include the key to represent true when writing to files, include a Writer to write
to otherwise.
|
Constructor and Description |
---|
DocumentWriter() |
Modifier and Type | Method and Description |
---|---|
static void |
setLevel(Level l)
Sets the logger level
|
static void |
writeDocument(Object value,
Schema schema,
File f,
Map hints)
Write value to file using provided schema.
|
static void |
writeDocument(Object value,
Schema schema,
Writer w,
Map hints)
Entry Point to Document writer.
|
static void |
writeFragment(Object value,
Schema schema,
File f,
Map hints)
Write value to file using provided schema.
|
static void |
writeFragment(Object value,
Schema schema,
Writer w,
Map hints)
Entry Point to Document writer.
|
static void |
writeSchema(Schema schema,
Writer w,
Map hints)
DOCUMENT ME!
|
public static final Logger logger
public static final String WRITE_SCHEMA
public static final String BASE_ELEMENT
public static final String SCHEMA_ORDER
public static final String ENCODING
public static final String USE_NEAREST
public static final String SCHEMA_LOCATION_HINT
public static void setLevel(Level l)
l
- Levelpublic static void writeDocument(Object value, Schema schema, File f, Map hints) throws OperationNotSupportedException, IOException
Hints:
value
- schema
- f
- hints
- OperationNotSupportedException
IOException
public static void writeDocument(Object value, Schema schema, Writer w, Map hints) throws OperationNotSupportedException, IOException
Hints:
value
- schema
- w
- hints
- optional hints for writingOperationNotSupportedException
IOException
public static void writeFragment(Object value, Schema schema, File f, Map hints) throws OperationNotSupportedException, IOException
Hints:
value
- schema
- f
- hints
- OperationNotSupportedException
IOException
public static void writeFragment(Object value, Schema schema, Writer w, Map hints) throws OperationNotSupportedException, IOException
Hints:
value
- schema
- w
- hints
- optional hints for writingOperationNotSupportedException
IOException
public static void writeSchema(Schema schema, Writer w, Map hints) throws IOException
schema
- DOCUMENT ME!w
- DOCUMENT ME!hints
- DOCUMENT ME!IOException
Copyright © 1996–2019 Geotools. All rights reserved.