-
- All Superinterfaces:
Adjusting.XML.Parsing<Adjusting.XML.Result<Adjusting.XML.SourceResult>>
,Adjusting.XML.Result<Adjusting.XML.SourceResult>
,Result
- Enclosing class:
- Adjusting.XML
public static interface Adjusting.XML.SourceResult extends Adjusting.XML.Result<Adjusting.XML.SourceResult>
SpecializedResult
type for setting a new PL/JavaSQLXML
instance's content from an arbitrarySource
object of any of the types JDBC requires theSQLXML
type to support.The
set
method must be called before any of the inherited adjustment methods, and thegetSQLXML
method only after any adjustments.This is used transparently when another JDBC driver's
SQLXML
instance is returned from a PL/Java function, or passed to aResultSet
orPreparedStatement
, to produce the PL/Java instance that is ultimately needed. In that case, the sourceSQLXML
instance'sgetSource
method is passed a nullsourceClass
argument, allowing the source instance to return whichever flavor ofSource
it efficiently implements, and that will be passed to this interface'sset
method.Through explicit use of this interface, code can adjust the parser restrictions that may be applied in the process, in case the defaults are too restrictive.
-
-
Field Summary
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Method Summary
Modifier and Type Method Description SQLXML
getSQLXML()
Returns the resultSQLXML
instance ready for handing off to PostgreSQL.Adjusting.XML.SourceResult
set(String source)
Provides the content to be copied in the form of aString
.Adjusting.XML.SourceResult
set(DOMSource source)
Specialization ofset
for an argument of typeDOMSource
.Adjusting.XML.SourceResult
set(SAXSource source)
Specialization ofset
for an argument of typeSAXSource
.Adjusting.XML.SourceResult
set(Source source)
Supplies theSource
instance that is the source of the content.Adjusting.XML.SourceResult
set(StAXSource source)
Specialization ofset
for an argument of typeStAXSource
.Adjusting.XML.SourceResult
set(StreamSource source)
Specialization ofset
for an argument of typeStreamSource
.-
Methods inherited from interface org.postgresql.pljava.Adjusting.XML.Parsing
accessExternalDTD, accessExternalSchema, allowDTD, defaults, elementAttributeLimit, entityExpansionLimit, entityReplacementLimit, entityResolver, expandEntityReferences, externalGeneralEntities, externalParameterEntities, ignoreDTD, lax, loadExternalDTD, maxElementDepth, maxGeneralEntitySizeLimit, maxParameterEntitySizeLimit, maxXMLNameLimit, schema, setFirstSupportedFeature, setFirstSupportedProperty, totalEntitySizeLimit, xIncludeAware
-
Methods inherited from interface org.postgresql.pljava.Adjusting.XML.Result
get
-
Methods inherited from interface javax.xml.transform.Result
getSystemId, setSystemId
-
-
-
-
Method Detail
-
set
Adjusting.XML.SourceResult set(Source source) throws SQLException
Supplies theSource
instance that is the source of the content.This method must be called before any of the inherited adjustment methods. The argument may be a
StreamSource
,SAXSource
,StAXSource
, orDOMSource
. If it is an instance ofAdjusting.XML.Source
, itsget
method will be called, and must return one of those four supported types.- Throws:
SQLException
-
set
Adjusting.XML.SourceResult set(StreamSource source) throws SQLException
Specialization ofset
for an argument of typeStreamSource
.It may encapsulate either an
InputStream
or aReader
. In either case (even for aReader
), the start of the stream will be checked for an encoding declaration and compared to PostgreSQL's server encoding. If the encoding matches, a direct copy is done. If the encoding does not match but the source character set is contained in the server character set, a transcoding via Unicode is done. In either case, an XML parser is used to verify that the copied content is XML, and the parser's restrictions can be adjusted by the methods on this interface.If the source character set is neither the same as nor contained in the server's, the content will be parsed to SAX events and reserialized into the server encoding, and this parser's restrictions can be adjusted by the methods on this interface.
- Throws:
SQLException
-
set
Adjusting.XML.SourceResult set(SAXSource source) throws SQLException
Specialization ofset
for an argument of typeSAXSource
.Because the content will be received in an already-parsed form, the parser-adjusting methods will have no effect.
- Throws:
SQLException
-
set
Adjusting.XML.SourceResult set(StAXSource source) throws SQLException
Specialization ofset
for an argument of typeStAXSource
.Because the content will be received in an already-parsed form, the parser-adjusting methods will have no effect.
- Throws:
SQLException
-
set
Adjusting.XML.SourceResult set(String source) throws SQLException
Provides the content to be copied in the form of aString
.An exception from the pattern of
Source
-typed arguments, this method simplifies retrofitting adjustments into code that was usingSQLXML
'ssetString
. Has the same effect asset
with aStreamSource
wrapping aStringReader
over theString
.- Throws:
SQLException
-
set
Adjusting.XML.SourceResult set(DOMSource source) throws SQLException
Specialization ofset
for an argument of typeDOMSource
.Because the content will be received in an already-parsed form, the parser-adjusting methods will have no effect.
- Throws:
SQLException
-
getSQLXML
SQLXML getSQLXML() throws SQLException
Returns the resultSQLXML
instance ready for handing off to PostgreSQL.The handling/logging of exceptions normally handled in a
get
method happens here for aSourceResult
.Any necessary calls of the inherited adjustment methods must be made before this method is called.
- Throws:
SQLException
-
-