|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwxtutils.domer
domer has only static methods and serve as a library for utilities that load, save, validates and transform DOMs makeDomFromString makeDomFromUri makeTransformedDomFromUri saveDom saveTransformedDom stringFromDom stringFromTransformedDom ValidateString
Constructor Summary | |
domer()
Creates a new instance of domer |
Method Summary | |
static javax.xml.parsers.DocumentBuilder |
makeDocBuilder()
Make a documentbuilder |
static org.w3c.dom.Document |
makeDomFromString(java.lang.String S)
Establish a Dom from a string |
static org.w3c.dom.Document |
makeDomFromUri(java.net.URI theUri)
Establish a Dom from a XML-file |
static org.w3c.dom.Document |
makeTransformedDomFromString(java.lang.String theString,
java.net.URI transUri,
java.util.HashMap parameters,
java.util.HashMap options)
Establish a Dom from a transformed XML-file |
static org.w3c.dom.Document |
makeTransformedDomFromUri(java.net.URI theUri,
java.net.URI transUri,
java.util.HashMap parameters,
java.util.HashMap options)
Establish a Dom from a transformed XML-file |
static org.w3c.dom.DocumentFragment |
produceDocFragmentFromString(java.lang.String theText,
java.lang.String enc)
Try to establish a documentfragment from a string |
static org.w3c.dom.Document |
produceDocFromString(java.lang.String theText,
java.lang.String enc)
Try to establish a document from a string |
protected static java.util.Properties |
propsFromDoc(org.w3c.dom.Document doc,
java.lang.String fileExtension,
java.lang.String encoding)
Prepare a a set of transformer output options from whatever information we can extract from the document, the targets filextension and the encoding |
protected static java.util.Properties |
propsFromOptions(java.util.HashMap options)
Prepare a a set of transformer output options from buildoptions |
static void |
saveDom(org.w3c.dom.Document doc,
java.net.URI theUri,
java.lang.String encoding)
Saves a dom tree to file with an identity transformation Throws a general exception |
static void |
saveTransformedDom(org.w3c.dom.Document doc,
java.net.URI theUri,
java.net.URI transUri,
java.util.HashMap parameters,
java.util.HashMap options)
Saves a dom tree to file after a transformation Throws a general exception |
static java.lang.String |
serializeDomToString(org.w3c.dom.Document doc,
java.lang.String encoding)
Saves a dom tree to string using serializing |
static void |
serializeDomToUri(org.w3c.dom.Document doc,
java.net.URI theUri,
java.lang.String encoding)
Saves a dom tree to file using serializing |
static java.lang.String |
stringFromDom(org.w3c.dom.Document doc,
java.net.URI theUri,
java.lang.String encoding)
Saves a dom tree to a string with an identity transformation Throws a general exception |
static java.lang.String |
stringFromTransformedDom(org.w3c.dom.Document doc,
java.net.URI theUri,
java.net.URI transUri,
java.util.HashMap parameters,
java.util.HashMap options)
Saves a dom tree to a string after a transformation Throws a general exception |
static boolean |
ValidateString(java.lang.String theText,
java.net.URI theSchema,
validationErrorHandler errors)
Validate a stringrepresentation of a Document against a schema |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public domer()
Method Detail |
public static void serializeDomToUri(org.w3c.dom.Document doc, java.net.URI theUri, java.lang.String encoding) throws java.lang.Exception
doc
- The documenttheUri
- Where it goesencoding
- The encoding we want
java.lang.Exception
- when save is not acomplishedpublic static java.lang.String serializeDomToString(org.w3c.dom.Document doc, java.lang.String encoding) throws java.lang.Exception
doc
- The documentencoding
- The encoding we want
java.lang.Exception
- when save is not complishedpublic static boolean ValidateString(java.lang.String theText, java.net.URI theSchema, validationErrorHandler errors)
errors
- An errorhandlertheText
- The Text we will validatetheSchema
- The schema we want to validate against
public static java.lang.String stringFromDom(org.w3c.dom.Document doc, java.net.URI theUri, java.lang.String encoding) throws java.lang.Exception
doc
- The document(DOM)theUri
- Where it goesencoding
- The encoding we want, set elsewhere
java.lang.Exception
- when save is not accomplishedpublic static org.w3c.dom.Document produceDocFromString(java.lang.String theText, java.lang.String enc) throws java.lang.Exception
theText
- The text we will attempt to interpret as XMLenc
- The encoding we want, defaults to UTF-8
java.lang.Exception
- when parsing failspublic static org.w3c.dom.DocumentFragment produceDocFragmentFromString(java.lang.String theText, java.lang.String enc) throws java.lang.Exception
theText
- The text we will attempt to interpret as XMLenc
- The encoding we want, defaults to UTF-8
java.lang.Exception
- when the String can not be parsedpublic static java.lang.String stringFromTransformedDom(org.w3c.dom.Document doc, java.net.URI theUri, java.net.URI transUri, java.util.HashMap parameters, java.util.HashMap options) throws java.lang.Exception
doc
- The document(DOM)theUri
- Where it goestransUri
- The URI for the transformationparameters
- The parameters that will be set for the transformationoptions
- The options that will be set for the transformation
java.lang.Exception
- when save is not accomplishedpublic static void saveDom(org.w3c.dom.Document doc, java.net.URI theUri, java.lang.String encoding) throws java.lang.Exception
doc
- The document(DOM)theUri
- Where it goesencoding
- The encoding we want, set elsewhere
java.lang.Exception
- when save is not accomplishedpublic static void saveTransformedDom(org.w3c.dom.Document doc, java.net.URI theUri, java.net.URI transUri, java.util.HashMap parameters, java.util.HashMap options) throws java.lang.Exception
doc
- The document(DOM)theUri
- Where it goestransUri
- The URI for the transformationparameters
- The parameters that will be set for the transformationoptions
- The options that will be set for the transformation
java.lang.Exception
- when save is not accomplishedpublic static org.w3c.dom.Document makeDomFromUri(java.net.URI theUri) throws java.lang.Exception
theUri
- Where the XML-file is located
java.lang.Exception
- when no DOM is establishedpublic static org.w3c.dom.Document makeDomFromString(java.lang.String S) throws java.lang.Exception
S
- the string that should be parsed
java.lang.Exception
- when no DOM is establishedpublic static org.w3c.dom.Document makeTransformedDomFromString(java.lang.String theString, java.net.URI transUri, java.util.HashMap parameters, java.util.HashMap options) throws java.lang.Exception
theString
- the XML-file as a stringtransUri
- Where we find the transformationparameters
- The parameters that will be applied in the transformationoptions
- The options that will be applied to output from the transformation
java.lang.Exception
- when no DOM is establishedpublic static org.w3c.dom.Document makeTransformedDomFromUri(java.net.URI theUri, java.net.URI transUri, java.util.HashMap parameters, java.util.HashMap options) throws java.lang.Exception
theUri
- Where the XML-file is locatedtransUri
- Where we find the transformationparameters
- The parameters that will be applied in the transformationoptions
- The options that will be applied to output from the transformation
java.lang.Exception
- when no DOM is establishedpublic static javax.xml.parsers.DocumentBuilder makeDocBuilder() throws javax.xml.parsers.ParserConfigurationException, javax.xml.parsers.FactoryConfigurationError
javax.xml.parsers.ParserConfigurationException
- when bad parser configuration
javax.xml.parsers.FactoryConfigurationError
- when bad factory configurationprotected static java.util.Properties propsFromOptions(java.util.HashMap options)
options
- The options
protected static java.util.Properties propsFromDoc(org.w3c.dom.Document doc, java.lang.String fileExtension, java.lang.String encoding)
doc
- The DOM we want to serializefileExtension
- The extension of the file we will write toencoding
- The encoding we want
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |