|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.weft.domutil.DocumentGeneratorImpl
a simple DocumentGenerator implementation which can be specialised.
Recognises the following configuration property:
document_type_name is also set. No default.
org.w3c.dom.DOMImplementation class
to use. The class named must obviously be in the Web app's classpath.
Optional. Defaults to
org.apache.xerces.dom.DOMImplementationImpl.
| Field Summary | |
protected boolean |
allowXSLFromContext
do we allow the XSL stylesheet to be specified in the context? Normally we don't! |
protected boolean |
debug
whether or not I'm in debug mode; if I am I may print debugging messages to System.err |
protected DocumentType |
doctype
My document type |
protected java.lang.String |
dtdPublicId
the public Id to use when generating a DTD declaration, if any |
protected static java.lang.String |
DTDPUBLICIDCONFIGTOKEN
a token on which I shall seek in my config the value of the DTD public identifier to use, if I generate a DTD declaration |
protected java.lang.String |
dtdQualifiedName
the qualified name to use when generating a DTD declaration, it any |
protected static java.lang.String |
DTDQUALIFIEDNAMECONFIGTOKEN
a token on which I shall seek in my config the value of the DTD qualified name to use, if I generate a DTD declaration |
protected java.lang.String |
dtdSystemId
the system Id to use when generating a DTD declaration, if any |
protected static java.lang.String |
DTDSYSTEMIDCONFIGTOKEN
a token on which I shall seek in my config the value of the DTD system identifier to use, if I generate a DTD declaration |
protected boolean |
generateDTD
whether or not to generate a DTD declaration |
boolean |
genxml
Deprecated. no longer used - other people's serializer's don't need this! |
protected NodeGenerator |
rootGenerator
the object which generates my root node. |
protected java.lang.String |
rootName
the name of the document root element when created. |
protected java.lang.String |
xmlns
the default XML namespace URI - none |
protected java.lang.String |
xslStylesheetName
the name of the XSL stylesheet I am to use, if any |
| Constructor Summary | |
DocumentGeneratorImpl()
|
|
| Method Summary | |
protected boolean |
accept(Context context)
Whether or not I want to accept this context. |
protected java.lang.String |
cleanString(java.lang.String val)
clean a string, using Printer.cleanString to do the real work |
void |
destroy()
Do any cleaning up I need to do when my Servlet shuts down |
Document |
generate(Context context)
generate a document. |
protected java.lang.String |
getNamespaceURI(Context context)
return the value of xml_namespace_uri in the current
context, or, if none, the value in the original configuration |
NodeGenerator |
getRootGenerator()
|
NodeGenerator |
getRootGenerator(Context c)
get my root node generator object |
java.lang.String |
getTransformURL(Context context)
get the URL of my preferred XSL transform as a String. |
void |
init(Context config)
Initialise me with configuration from this context. |
void |
init(javax.servlet.ServletConfig config)
Deprecated. From Jacquard 2.0, a ServletConfig won't be passed. Specialise init( Context) instead. |
void |
setRootGenerator(NodeGenerator rootGenerator)
sets the default root generator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String DTDPUBLICIDCONFIGTOKEN
protected static final java.lang.String DTDSYSTEMIDCONFIGTOKEN
protected static final java.lang.String DTDQUALIFIEDNAMECONFIGTOKEN
public boolean genxml
protected DocumentType doctype
protected NodeGenerator rootGenerator
protected java.lang.String dtdPublicId
protected java.lang.String dtdQualifiedName
protected java.lang.String dtdSystemId
protected java.lang.String rootName
protected java.lang.String xmlns
protected java.lang.String xslStylesheetName
protected boolean allowXSLFromContext
protected boolean debug
protected boolean generateDTD
| Constructor Detail |
public DocumentGeneratorImpl()
| Method Detail |
public void setRootGenerator(NodeGenerator rootGenerator)
throws InitialisationException
rootGenerator - The rootGenerator to set.
throws - InitialisationException if the generator passed isn't
suitable
InitialisationExceptionpublic NodeGenerator getRootGenerator()
getRootGenerator(Context)
public NodeGenerator getRootGenerator(Context c)
throws GenerationException
c - the context in which I am generating. Ignored, but
specialisations could use this to select alternate generators
based on values in the context
GenerationException - if rootGenerator is null.
public java.lang.String getTransformURL(Context context)
throws GenerationException
xsl_stylesheet
magic token in the context if and only if
allow_xsl_from_context was true in config, else that
which was in the Servlet configuration. Specialise if you want
something different.
getTransformURL in interface DocumentGeneratorcontext - the context for the present service
GenerationExceptionpublic void destroy()
destroy in interface DocumentGenerator
public Document generate(Context context)
throws GenerationException,
DOMException
generate in interface DocumentGeneratorcontext - the context for this request
GenerationException - if application layer code breaks
DOMException - if anything in Xerces breaks
public void init(Context config)
throws InitialisationException
init in interface DocumentGeneratorconfig - my initial configuration
InitialisationException
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
javax.servlet.ServletException
protected java.lang.String getNamespaceURI(Context context)
throws GenerationException
xml_namespace_uri in the current
context, or, if none, the value in the original configuration
context - the context for the current service
GenerationException - never thrown, but specialisations might
want to.protected boolean accept(Context context)
context - the context of this service
protected java.lang.String cleanString(java.lang.String val)
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||