|
Oracle® Database XML Java API Reference 12c Release 1 (12.1) E15981-09 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface OXQSerializationParameters
Models the supported serialization parameters. This can be used to create a java.util.Properties instance that can be passed to any standard XQJ method that accepts serialization parameters. For example:
OXQConnection connection = ...
OXQSerializationParameters params = connection.createSerializationParameters();
params.setMethod(OXQSerializationParameters.METHOD_XML);
params.setIndent(true);
params.setEncoding("UTF-16");
XQSequence seq = ...;
String xml = seq.getSequenceAsString(params.createProperties());
| Field Summary | |
|---|---|
static javax.xml.namespace.QName |
METHOD_ORACLE_CSXThe CSX Output Method. |
static javax.xml.namespace.QName |
METHOD_TEXTThe Text Output Method. |
static javax.xml.namespace.QName |
METHOD_XMLThe XML Output Method. |
static int |
STANDALONE_NOThe value that indicates standalone='no' should appear in the document declaration. |
static int |
STANDALONE_OMITThe value that indicates standalone will not appear in the document declaration. |
static int |
STANDALONE_YESThe value that indicates standalone='yes' should appear in the document declaration. |
| Method Summary | |
|---|---|
void |
addCDATASectionElement(javax.xml.namespace.QName elementName)Adds an element name to the cdata-section-elements parameter. |
void |
addCharacterMapping(int codepoint, java.lang.String replacement)Sets the use-character-maps parameter. |
java.util.Properties |
createProperties()Exports the current parameters to a java.util.Properties object that may be used with any standard XQJ method that accepts serialization properties. |
int |
getBufferSize()Gets the buffer size in bytes that will be used during serialization. |
javax.xml.namespace.QName[] |
getCDATASectionElements()Gets the cdata-section-elements parameter. |
java.lang.String |
getCharacterMapping(int codepoint)Gets the current character mapping for the specified character. |
int[] |
getCharacterMappingCodepoints()Gets an array of Unicode characters that are currently replaced by character mappings. |
java.lang.String |
getDoctypePublic()Gets the doctype-public parameter. |
java.lang.String |
getDoctypeSystem()Gets the doctype-system parameter. |
java.nio.charset.Charset |
getEncoding()Gets the value of the encoding parameter. |
javax.xml.namespace.QName |
getMethod()Gets the method parameter. |
java.text.Normalizer.Form |
getNormalizationForm()Gets the normalization-form parameter. |
int |
getStandalone()Gets the standalone parameter. |
boolean |
isIndent()Gets the value of the indent parameter. |
boolean |
isOmitXMLDeclaration()Gets the omit-xml-declaration parameter value. |
boolean |
removeCDATASectionElement(javax.xml.namespace.QName elementName)Removes the element name from the cdata-section-elements parameter. |
void |
setBufferSize(int buffer)Sets the buffer size that will be used during serialization. |
void |
setDoctypePublic(java.lang.String doctypePublic)Sets the doctype-public parameter. |
void |
setDoctypeSystem(java.lang.String doctypeSystem)Sets the doctype-system parameter. |
void |
setEncoding(java.nio.charset.Charset encoding)Sets the encoding parameter. |
void |
setEncoding(java.lang.String encoding)Sets the encoding parameter. |
void |
setIndent(boolean indent)Sets the indent parameter. |
void |
setMethod(javax.xml.namespace.QName method)Sets the method parameter. |
void |
setNormalizationForm(java.text.Normalizer.Form form)Sets normalization-form parameter. |
void |
setOmitXMLDeclaration(boolean omitXMLDeclaration)Sets the omit-xml-declaration parameter. |
void |
setStandalone(int standalone)Sets the standalone parameter which controls the standalone document declaration. |
| Field Detail |
|---|
static final javax.xml.namespace.QName METHOD_XML
setMethod(QName)static final javax.xml.namespace.QName METHOD_TEXT
setMethod(QName)static final javax.xml.namespace.QName METHOD_ORACLE_CSX
setMethod(QName)static final int STANDALONE_YES
standalone='yes' should appear in the document declaration.
setStandalone(int), Constant Field Valuesstatic final int STANDALONE_NO
standalone='no' should appear in the document declaration.
setStandalone(int), Constant Field Valuesstatic final int STANDALONE_OMIT
standalone will not appear in the document declaration.
setStandalone(int), Constant Field Values| Method Detail |
|---|
java.util.Properties createProperties()
java.util.Properties object that may be used with any standard XQJ method that accepts serialization properties. This conversion requires the parameter values to be represented as strings. The following table describes this conversion. Note, if a parameter is currently set to the default value, it will not have an entry in the result.
| Parameter | String Conversion | Setter |
|---|---|---|
method |
java.xml.namespace.QName.toString() |
setMethod(QName) |
encoding |
The Charset name. See java.nio.Charset |
setEncoding(Charset) |
indent |
true maps to "yes" and false maps to "no". |
setIndent(boolean) |
omit-xml-declaration |
true maps to "yes" and false maps to "no". |
setOmitXMLDeclaration(boolean) |
standalone |
STANDALONE_OMIT maps to "omit", STANDALONE_YES maps to "yes", and STANDALONE_NO maps to "no". |
setStandalone(int) |
cdata-section-elements |
A semicolon separated list of QNames using javax.xml.namespace.QName.toString().For example: "{http://example.org/ns1}one; two; {http://example.org/ns2}three" |
addCDATASectionElement(QName) |
doctype-public |
No conversion needed. | setDoctypePublic(String) |
doctype-system |
No conversion needed. | setDoctypeSystem(String) |
normalization-form |
Normalizer.Form.toString().toLowerCase() |
setNormalizationForm(Normalizer.Form) |
use-character-maps |
A comma delimited list of mappings where a mapping is represented by a character followed by '=' followed by any string. More precisely:
Mapping ::= [Character] '=' [Character]*
Value ::= ( Mapping ( ';' Mapping )* )?
Note, to use the ';' character in a mapping value, it must be escaped with the characters "\;"For example: "\u03A3=[SIGMA];A=;|=\\;" This example string should be interpreted as a Java literal string. The Unicode character 0x03A3 is replaced with "[SIGMA]", the letter 'A' is replaced with the empty string, and the pipe ('|') is replaced with a semicolon. |
addCharacterMapping(int, String) |
Properties object that may be used with any XQJ serialization method
void setMethod(javax.xml.namespace.QName method)
throws XQException
method parameter. Must be one of METHOD_XML, METHOD_TEXT, or METHOD_ORACLE_CSX. The default value is METHOD_XML.method - the output methodXQException - if the specified method is not supportedjavax.xml.namespace.QName getMethod()
method parameter. The default value is METHOD_XML.setMethod(QName)
void setEncoding(java.lang.String encoding)
throws XQException
encoding parameter. The default encoding is "UTF-8".encoding - the encoding to use. Cannot be nullXQException - if the specified encoding is not a valid Charset name. See java.nio.Charsetvoid setEncoding(java.nio.charset.Charset encoding)
encoding parameter. The default encoding is UTF-8.encoding - the encoding to use. Cannot be nulljava.nio.charset.Charset getEncoding()
encoding parameter. The default encoding is UTF-8.void setIndent(boolean indent)
indent parameter.
When true, the serializer will format the output by inserting and removing whitespace adjacent to elements. For validated instances, the serializer will not modify whitespace in elements where the schema type indicates the content is mixed.
This parameter only applies when the xml output method is used.
false.indent - the value for the indent parameterboolean isIndent()
indent parameter. The default value is false.indent parametervoid setOmitXMLDeclaration(boolean omitXMLDeclaration)
omit-xml-declaration parameter. When set to false, the serializer will write an XML declaration. When set to true, an XML declaration will not be written. The default value is true.omitXMLDeclaration - the value for the omit-xml-declaration parameterboolean isOmitXMLDeclaration()
omit-xml-declaration parameter value. The default value is true.omit-xml-declaration parameter
void setStandalone(int standalone)
throws XQException
standalone parameter which controls the standalone document declaration. Must be one of STANDALONE_OMIT, STANDALONE_YES, or STANDALONE_NO. The default value is STANDALONE_OMIT.standalone - the standalone parameterXQException - if the specified value is not validint getStandalone()
standalone parameter. The default value is STANDALONE_OMIT.standalone parameter
void setDoctypeSystem(java.lang.String doctypeSystem)
throws XQException
doctype-system parameter. Setting this causes a document type declaration to be output with the specified system id. The instance being serialized must have a single top level element node and no top level text nodes.doctypeSystem - may not include both an apostrophe (#x27) and a quotation mark (#x22) character. May be nullXQException - if the specified value is invalidjava.lang.String getDoctypeSystem()
doctype-system parameter.doctype-system parameter or null if not set
void setDoctypePublic(java.lang.String doctypePublic)
throws XQException
doctype-public parameter. Specifies the public id to be used in the document type declaration. This setting is ignored unless the doctype-system parameter is specified.doctypePublic - http://www.w3.org/TR/REC-xml/#NT-PubidCharXQException - if the specified value is not validjava.lang.String getDoctypePublic()
doctype-public parameter.doctype-public parametervoid setNormalizationForm(java.text.Normalizer.Form form)
normalization-form parameter.form - may be NFC, NFD, NFKC, NFKD, or nulljava.text.Normalizer.Form getNormalizationForm()
normalization-form parameter. A value of null indicates no normalization will be performed. The default value is null."none"
void addCharacterMapping(int codepoint,
java.lang.String replacement)
use-character-maps parameter. Specifies that a given Unicode character should be replaced with the corresponding string value. This only applies to attribute and text values. Note, the string value used in the replacement will be output "as is". Characters in the string will not be normalized, swapped out with character references, etc. This means that using a character mapping can potentially lead to the production invalid XML documents; for example, if the replacement string contains a mismatched end tag.codepoint - the Unicode codepoint of the character to replacereplacement - the replacement string. If null the mapping will be removed if it already existsint[] getCharacterMappingCodepoints()
null if there are no mappingsaddCharacterMapping(int, String)java.lang.String getCharacterMapping(int codepoint)
codepoint - the Unicode characternull if no mapping existsvoid addCDATASectionElement(javax.xml.namespace.QName elementName)
cdata-section-elements parameter. When the parent element of a text node has the specified QName, the text node will be output as a CDATA section.elementName - the element name. Must not be nullboolean removeCDATASectionElement(javax.xml.namespace.QName elementName)
cdata-section-elements parameter.elementName - the element name to remove. Must not be nulltrue if the parameter contained the specified element and false otherwisejavax.xml.namespace.QName[] getCDATASectionElements()
cdata-section-elements parameter.null if none are definedvoid setBufferSize(int buffer)
buffer - the buffer sizeint getBufferSize()
|
Oracle® Database XML Java API Reference 12c Release 1 (12.1) E15981-09 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright © 2003, 2014, Oracle and/or its affiliates. All rights reserved.