- All Superinterfaces:
Adjusting.XML.Parsing<Adjusting.XML.Result<Adjusting.XML.SourceResult>>,Adjusting.XML.Result<Adjusting.XML.SourceResult>,Result
- Enclosing class:
Adjusting.XML
Result type for setting a new PL/Java
SQLXML instance's content from an arbitrary Source
object of any of the types JDBC requires the SQLXML type
to support.
The set method must be called before any of the
inherited adjustment methods, and the getSQLXML
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 a
ResultSet or PreparedStatement, to produce the
PL/Java instance that is ultimately needed. In that case, the source
SQLXML instance's getSource method is passed a null
sourceClass argument, allowing the source instance to return
whichever flavor of Source it efficiently implements, and
that will be passed to this interface's set 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 TypeMethodDescriptionReturns the resultSQLXMLinstance ready for handing off to PostgreSQL.Provides the content to be copied in the form of aString.Specialization ofsetfor an argument of typeDOMSource.Specialization ofsetfor an argument of typeSAXSource.Supplies theSourceinstance that is the source of the content.set(StAXSource source) Specialization ofsetfor an argument of typeStAXSource.set(StreamSource source) Specialization ofsetfor 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, xIncludeAwareMethods inherited from interface org.postgresql.pljava.Adjusting.XML.Result
getMethods inherited from interface javax.xml.transform.Result
getSystemId, setSystemId
-
Method Details
-
set
Supplies theSourceinstance 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, itsgetmethod will be called, and must return one of those four supported types.- Throws:
SQLException
-
set
Specialization ofsetfor an argument of typeStreamSource.It may encapsulate either an
InputStreamor 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
Specialization ofsetfor 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
Specialization ofsetfor 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
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 assetwith aStreamSourcewrapping aStringReaderover theString.- Throws:
SQLException
-
set
Specialization ofsetfor 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
Returns the resultSQLXMLinstance ready for handing off to PostgreSQL.The handling/logging of exceptions normally handled in a
getmethod happens here for aSourceResult.Any necessary calls of the inherited adjustment methods must be made before this method is called.
- Throws:
SQLException
-