public abstract class TransformerBase extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TransformerBase.SchemaLocationSupport
Adds support for schemaLocations.
|
class |
TransformerBase.Task
A wrapper for a Transformation Task.
|
protected static class |
TransformerBase.TranslatorSupport
Support for writing Translators.
|
protected static class |
TransformerBase.XMLReaderSupport
Support for the setup of an XMLReader for use in a transformation.
|
Modifier and Type | Field and Description |
---|---|
static String |
XMLNS_NAMESPACE |
Constructor and Description |
---|
TransformerBase() |
Modifier and Type | Method and Description |
---|---|
Transformer |
createTransformer()
Create a Transformer which is initialized with the settings of this TransformerBase.
|
TransformerBase.Task |
createTransformTask(Object object,
StreamResult result)
Create a Transformation task.
|
abstract Translator |
createTranslator(ContentHandler handler)
Create a Translator to issue SAXEvents to a ContentHandler.
|
TransformerBase.XMLReaderSupport |
createXMLReader(Object object)
Create an XMLReader to use in the transformation.
|
Charset |
getEncoding()
Gets the charset to declare in the header of the response.
|
int |
getIndentation()
Get the number of spaces to indent the output xml.
|
boolean |
isNamespaceDeclartionEnabled()
Should this transformer declare namespace prefixes in the first element it outputs?
|
boolean |
isOmitXMLDeclaration()
Will this transformation omit the standard XML declaration.
|
void |
setEncoding(Charset charset)
Sets the charset to declare in the xml header returned.
|
void |
setIndentation(int amt)
Set the number of spaces to indent the output xml.
|
void |
setNamespaceDeclarationEnabled(boolean enabled)
Enable declaration of namespace prefixes in the first element.
|
void |
setOmitXMLDeclaration(boolean xmlDecl)
Set this transformer to omit/include the XML declaration.
|
String |
transform(Object object)
Perform the XML encoding of the given object into an internal buffer and return the resulting
String.
|
void |
transform(Object object,
OutputStream out)
Perform the XML encoding on the given object to the given OutputStream.
|
void |
transform(Object object,
StreamResult result)
Perform the XML encoding on the given object to the given OutputStream.
|
void |
transform(Object object,
Writer out)
Perform the XML encoding on the given object to the given Writer.
|
public static final String XMLNS_NAMESPACE
public abstract Translator createTranslator(ContentHandler handler)
public Transformer createTransformer() throws TransformerException
TransformerException
public void transform(Object object, OutputStream out) throws TransformerException
TransformerException
public void transform(Object object, Writer out) throws TransformerException
TransformerException
public void transform(Object object, StreamResult result) throws TransformerException
TransformerException
public TransformerBase.Task createTransformTask(Object object, StreamResult result) throws TransformerException
TransformerException
public String transform(Object object) throws TransformerException
TransformerException
public TransformerBase.XMLReaderSupport createXMLReader(Object object)
public int getIndentation()
public void setIndentation(int amt)
amt
- The number of spaces to indent if > 0, otherwise disable.public Charset getEncoding()
public void setEncoding(Charset charset)
charset
- A charset object of the desired encodingpublic boolean isOmitXMLDeclaration()
public void setOmitXMLDeclaration(boolean xmlDecl)
xmlDecl
- Omit/include the XML declaration.public boolean isNamespaceDeclartionEnabled()
public void setNamespaceDeclarationEnabled(boolean enabled)
enabled
- Enable namespace declaration.Copyright © 1996–2019 Geotools. All rights reserved.