|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.component.framework.util.SourceUtil
public class SourceUtil
Sample class used to manage the mapping between
javax.xml.transform.Source from String. the mapping is a quicly
"string" -> "
| Constructor Summary | |
|---|---|
SourceUtil()
Creates a new instance of SourceUtil |
|
| Method Summary | |
|---|---|
static org.w3c.dom.Document |
createDocument(javax.xml.transform.Source source)
Create a Document from a Source. |
static org.w3c.dom.Document |
createDocument(javax.xml.transform.Source source,
boolean forkSource)
Create a Document from a Source. |
static javax.xml.transform.dom.DOMSource |
createDOMSource(org.w3c.dom.Document document)
Create a DOM Source from the DOM document. |
static org.w3c.dom.Document |
createSoapFaultDocument(java.lang.Throwable e,
javax.xml.namespace.QName errorCode)
Creates an SOAP fault, as a DOM document, according to provided exception and code: <s:Fault xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> |
static javax.xml.transform.Source |
createSource(java.lang.String message)
Create a Source from the String. |
static javax.xml.transform.Source |
createSource(java.lang.String message,
java.lang.String charFormat)
Create a Source from the String with a specified encoding format. |
static javax.xml.transform.stream.StreamSource |
createStreamSource(org.w3c.dom.Document document)
Create a Stream Source from the DOM document. |
static java.lang.String |
createString(javax.xml.transform.Source source)
Create a String from a Source.-If the Source is a StreamSource, the source would be still
available. |
static java.lang.String |
createString(javax.xml.transform.Source source,
boolean forkSource)
Create a String from a Source.-If the Source is a StreamSource and forkSource is set to
true, the source would be still available. |
static boolean |
isDOM3(org.w3c.dom.Document document)
Test if the document is a DOM3 document |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SourceUtil()
SourceUtil
| Method Detail |
|---|
public static final org.w3c.dom.Document createDocument(javax.xml.transform.Source source)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Document from a Source. StreamSource, the source would be still
available.DomSource and contains a Document,
the returned document is a clone of this document.
source - the Source
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
public static final org.w3c.dom.Document createDocument(javax.xml.transform.Source source,
boolean forkSource)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Document from a Source. StreamSource and forkSource is set to
true, the source would be still available. Otherwise the source
is no more available.DomSource and contains a Document and
forkSource is set to true, the returned document is a
clone of this document. Otherwise the original Document is
returned.
source - the SourceforkSource - true to fork the content of the source if necessary
org.ow2.petals.component.framework.api.exception.PEtALSCDKExceptionpublic static final javax.xml.transform.dom.DOMSource createDOMSource(org.w3c.dom.Document document)
document - A DOM document
public static final org.w3c.dom.Document createSoapFaultDocument(java.lang.Throwable e,
javax.xml.namespace.QName errorCode)
Creates an SOAP fault, as a DOM document, according to provided exception
and code:
<s:Fault xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>{org.objectweb.petals}ERROR</faultcode>
<faultstring>mesage</faultstring>
<faultactor>component</faultactor>
<detail>
...
</detail>
<s:Fault>
If the provided exception is an instance of DocumentException:
FaultException.getFaultCode(),Throwable.getMessage(),FaultException.getFaultActor(),DocumentException.getDocument().
If the provided exception is an instance of FaultException:
FaultException.getFaultCode(),Throwable.getMessage(),FaultException.getFaultActor(),<stackTrace>.otherwise:
errorCode,Throwable.getMessage(),null,<stackTrace>.
e - An exception used to provide faultstring and detailerrorCode - The QName of the fault code. It is not used if the exception
is an instance of FaultException or
DocumentException.
public static final javax.xml.transform.Source createSource(java.lang.String message)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
message - a valid XML String
org.ow2.petals.component.framework.api.exception.PEtALSCDKException - if an error occurs during Source creation
public static final javax.xml.transform.Source createSource(java.lang.String message,
java.lang.String charFormat)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
message - a valid XML StringcharFormat - the encoding format, must be non null
org.ow2.petals.component.framework.api.exception.PEtALSCDKException - if an error occurs during Source creation
public static final javax.xml.transform.stream.StreamSource createStreamSource(org.w3c.dom.Document document)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
document - A DOM document
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
public static final java.lang.String createString(javax.xml.transform.Source source)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
String from a Source.StreamSource, the source would be still
available.
source - the Source
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
public static final java.lang.String createString(javax.xml.transform.Source source,
boolean forkSource)
throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
String from a Source.StreamSource and forkSource is set to
true, the source would be still available. Otherwise the source
is no more available.
source - the Source
org.ow2.petals.component.framework.api.exception.PEtALSCDKExceptionpublic static final boolean isDOM3(org.w3c.dom.Document document)
document - the document to test
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||