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_ELEMENTElement or String ... include a ref to an Element to be used, or a string representing the
 name of the element | 
| static String | ENCODINGThe Encoding which should be used for the Document which should be created. | 
| static Logger | loggerDOCUMENT ME! | 
| static String | SCHEMA_LOCATION_HINTa map of URI->URI representing targetNamespace->Location | 
| static String | SCHEMA_ORDERSchema[] or String[]... | 
| static String | USE_NEARESTboolean ... include the key to use the "nearest" strategy for searching schemas. | 
| static String | WRITE_SCHEMAWriter ... 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 - OperationNotSupportedExceptionIOExceptionpublic static void writeDocument(Object value, Schema schema, Writer w, Map hints) throws OperationNotSupportedException, IOException
Hints:
value - schema - w - hints - optional hints for writingOperationNotSupportedExceptionIOExceptionpublic static void writeFragment(Object value, Schema schema, File f, Map hints) throws OperationNotSupportedException, IOException
Hints:
value - schema - f - hints - OperationNotSupportedExceptionIOExceptionpublic static void writeFragment(Object value, Schema schema, Writer w, Map hints) throws OperationNotSupportedException, IOException
Hints:
value - schema - w - hints - optional hints for writingOperationNotSupportedExceptionIOExceptionpublic static void writeSchema(Schema schema, Writer w, Map hints) throws IOException
schema - DOCUMENT ME!w - DOCUMENT ME!hints - DOCUMENT ME!IOExceptionCopyright © 1996–2019 Geotools. All rights reserved.