org.geotools.xml
Class DocumentWriter

java.lang.Object
  extended byorg.geotools.xml.DocumentWriter

public class DocumentWriter
extends java.lang.Object

This is the thing that writes documents.

This will create valid XML documents, given an object and a schema.

Author:
dzwiers

Field Summary
static java.lang.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 java.util.logging.Logger logger
          DOCUMENT ME!
static java.lang.String SCHEMA_LOCATION_HINT
          a map of URI->URI representing targetNamespace->Location
static java.lang.String SCHEMA_ORDER
          Schema[] or String[]...
static java.lang.String USE_NEAREST
          boolean ... include the key to use the "nearest" strategy for searching schemas.
static java.lang.String WRITE_SCHEMA
          Writer ... include the key to represent true when writing to files, include a Writer to write to otherwise.
 
Constructor Summary
DocumentWriter()
           
 
Method Summary
static void setLevel(java.util.logging.Level l)
          Sets the logger level
static void writeDocument(java.lang.Object value, Schema schema, java.io.File f, java.util.Map hints)
          Write value to file using provided schema.
static void writeDocument(java.lang.Object value, Schema schema, java.io.Writer w, java.util.Map hints)
          Entry Point to Document writer.
static void writeFragment(java.lang.Object value, Schema schema, java.io.File f, java.util.Map hints)
          Write value to file using provided schema.
static void writeFragment(java.lang.Object value, Schema schema, java.io.Writer w, java.util.Map hints)
          Entry Point to Document writer.
static void writeSchema(Schema schema, java.io.Writer w, java.util.Map hints)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger
DOCUMENT ME!


WRITE_SCHEMA

public static final java.lang.String WRITE_SCHEMA
Writer ... include the key to represent true when writing to files, include a Writer to write to otherwise.

See Also:
Constant Field Values

BASE_ELEMENT

public static final java.lang.String BASE_ELEMENT
Element or String ... include a ref to an Element to be used, or a string representing the name of the element

See Also:
Constant Field Values

SCHEMA_ORDER

public static final java.lang.String SCHEMA_ORDER
Schema[] or String[]... The order to search the schemas for a valid element, either an array of ref to Schema instances or an Array or TargetNamespaces

See Also:
Constant Field Values

USE_NEAREST

public static final java.lang.String USE_NEAREST
boolean ... include the key to use the "nearest" strategy for searching schemas. This will be ignored if a schema order was set. When not included the schema order as they appear in the orginal schema will be used.

See Also:
Constant Field Values

SCHEMA_LOCATION_HINT

public static final java.lang.String SCHEMA_LOCATION_HINT
a map of URI->URI representing targetNamespace->Location

See Also:
Constant Field Values
Constructor Detail

DocumentWriter

public DocumentWriter()
Method Detail

setLevel

public static void setLevel(java.util.logging.Level l)
Sets the logger level

Parameters:
l - Level

writeDocument

public static void writeDocument(java.lang.Object value,
                                 Schema schema,
                                 java.io.File f,
                                 java.util.Map hints)
                          throws javax.naming.OperationNotSupportedException,
                                 java.io.IOException
Write value to file using provided schema.

Hints:

Parameters:
value -
schema -
f -
hints -
Throws:
javax.naming.OperationNotSupportedException
java.io.IOException

writeDocument

public static void writeDocument(java.lang.Object value,
                                 Schema schema,
                                 java.io.Writer w,
                                 java.util.Map hints)
                          throws javax.naming.OperationNotSupportedException,
                                 java.io.IOException
Entry Point to Document writer.

Hints:

Parameters:
value -
schema -
w -
hints - optional hints for writing
Throws:
javax.naming.OperationNotSupportedException
java.io.IOException

writeFragment

public static void writeFragment(java.lang.Object value,
                                 Schema schema,
                                 java.io.File f,
                                 java.util.Map hints)
                          throws javax.naming.OperationNotSupportedException,
                                 java.io.IOException
Write value to file using provided schema.

Hints:

Parameters:
value -
schema -
f -
hints -
Throws:
javax.naming.OperationNotSupportedException
java.io.IOException

writeFragment

public static void writeFragment(java.lang.Object value,
                                 Schema schema,
                                 java.io.Writer w,
                                 java.util.Map hints)
                          throws javax.naming.OperationNotSupportedException,
                                 java.io.IOException
Entry Point to Document writer.

Hints:

Parameters:
value -
schema -
w -
hints - optional hints for writing
Throws:
javax.naming.OperationNotSupportedException
java.io.IOException

writeSchema

public static void writeSchema(Schema schema,
                               java.io.Writer w,
                               java.util.Map hints)
                        throws java.io.IOException
DOCUMENT ME!

Parameters:
schema - DOCUMENT ME!
w - DOCUMENT ME!
hints - DOCUMENT ME!
Throws:
java.io.IOException


Copyright © GeoTools. All Rights Reserved.