Class OutputStreamRecord
- All Implemented Interfaces:
- org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> - org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> - org.eclipse.persistence.internal.oxm.record.XMLRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession>
- Direct Known Subclasses:
- FormattedOutputStreamRecord
Use this type of MarshalRecord when the marshal target is an OutputStream and the XML should not be formatted with carriage returns or indenting. This type is only used if the encoding of the OutputStream is UTF-8
 XMLContext xmlContext = new XMLContext("session-name");
 XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
 OutputStreamRecord record = new OutputStreamRecord();
 record.setOutputStream(myOutputStream);
 xmlMarshaller.marshal(myObject, record);
 
If the marshal(OutputStream) and setFormattedOutput(false) method is called on XMLMarshaller and the encoding is UTF-8, then the OutputStream is automatically wrapped in an OutputStream.
 XMLContext xmlContext = new XMLContext("session-name");
 XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
 xmlMarshaller xmlMarshaller.setFormattedOutput(false);
 xmlMarshaller.marshal(myObject, myOutputStream);
 
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classThis class will typically be used in conjunction with an XMLFragmentReader.Nested classes/interfaces inherited from interface org.eclipse.persistence.internal.oxm.record.MarshalRecordorg.eclipse.persistence.internal.oxm.record.MarshalRecord.CycleDetectionStack<E>Nested classes/interfaces inherited from interface org.eclipse.persistence.internal.oxm.record.XMLRecordorg.eclipse.persistence.internal.oxm.record.XMLRecord.Nil
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final byte[]protected static final byteprotected static final byte[]protected static final byte[]protected static final byteprotected static final byte[]protected static final byte[]protected static final byte[]protected booleanprotected booleanprotected static final byte[]protected static final byte[]protected static final byte[]protected static final byte[]protected static final byteprotected static final byte[]protected OutputStreamprotected static final byte[]protected static final byte[]protected static final byte[]protected static final byteFields inherited from class org.eclipse.persistence.oxm.record.MarshalRecordCOLON_W_SCHEMA_NIL_ATTRIBUTE, textWrapperFragment, TRUEFields inherited from class org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecordImplequalNamespaceResolvers, hasCustomNamespaceMapper, marshaller, namespaceAware, namespaceResolver, sessionFields inherited from interface org.eclipse.persistence.internal.oxm.record.XMLRecordDEFAULT_ATTRIBUTE_GROUP, NIL
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidINTERNAL:voidattribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver, String value) INTERNAL:voidINTERNAL:voidcharacters(String value) INTERNAL:voidINTERNAL:voidelement(org.eclipse.persistence.internal.oxm.XPathFragment frag) INTERNAL:voidINTERNAL:voidendElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL:voidflush()Return the OutputStream that the object will be marshalled to.voidnode(Node node, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver, String uri, String localName) Receive notification of a node.voidopenStartElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL:protected voidoutputStreamWrite(byte aByte) protected voidoutputStreamWrite(byte[] bytes) protected voidoutputStreamWrite(byte[] bytes, OutputStream os) protected voidoutputStreamWrite(byte aByte, OutputStream os) voidsetOutputStream(OutputStream outputStream) Set the OutputStream that the object will be marshalled to.voidstartDocument(String encoding, String version) INTERNAL:voidstartPrefixMappings(org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL: override so we don't iterate over namespaces when startPrefixMapping doesn't do anythingvoidINTERNALprotected voidwriteValue(String value, boolean escapeChars) INTERNAL:protected voidwriteValue(String value, boolean escapeChars, boolean isAttribute, OutputStream os) INTERNAL:Methods inherited from class org.eclipse.persistence.oxm.record.MarshalRecordadd, addGroupingElement, addPositionalNodes, afterContainmentMarshal, attribute, beforeContainmentMarshal, characters, clear, closeStartGroupingElements, defaultNamespaceDeclaration, emptyAttribute, emptyCollection, emptyComplex, emptySimple, endCollection, endPrefixMapping, endPrefixMappings, forceValueWrapper, getCurrentAttributeGroup, getCycleDetectionStack, getDocument, getDOM, getGroupingElements, getLocalName, getNameForFragment, getNamespaceURI, getPositionalNodes, getPrefixBytes, getPrefixForFragment, getStringForQName, getTextWrapperFragment, getValueToWrite, isWrapperAsCollectionName, marshalWithoutRootElement, namespaceDeclaration, namespaceDeclarations, nilComplex, nilSimple, node, openStartGroupingElements, popAttributeGroup, predicateAttribute, processNamespaceResolverForXSIPrefix, pushAttributeGroup, put, removeGroupingElement, setGroupingElement, setSession, startCollection, startPrefixMapping, transformToXMLMethods inherited from class org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecordImpladdExtraNamespacesToNamespaceResolver, addXsiTypeAndClassIndicatorIfRequired, addXsiTypeAndClassIndicatorIfRequired, attributeWithoutQName, getConversionManager, getLeafElementType, getMarshaller, getNamespaceResolver, getNamespaceSeparator, getOwningObject, getSession, hasCustomNamespaceMapper, hasEqualNamespaceResolvers, isNamespaceAware, isXOPPackage, removeExtraNamespacesFromNamespaceResolver, resolveNamespacePrefix, setCustomNamespaceMapper, setEqualNamespaceResolvers, setLeafElementType, setLeafElementType, setMarshaller, setNamespaceResolver, setOwningObject, setXOPPackage, writeXsiTypeAttribute, writeXsiTypeAttributeMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecordaddExtraNamespacesToNamespaceResolver, addXsiTypeAndClassIndicatorIfRequired, addXsiTypeAndClassIndicatorIfRequired, getLeafElementType, getMarshaller, getNamespaceResolver, getOwningObject, hasEqualNamespaceResolvers, isNamespaceAware, resolveNamespacePrefix, setCustomNamespaceMapper, setEqualNamespaceResolvers, setLeafElementType, setNamespaceResolver, setOwningObject, setXOPPackage, writeXsiTypeAttribute, writeXsiTypeAttributeMethods inherited from interface org.eclipse.persistence.internal.oxm.record.MarshalRecordattributeWithoutQName, hasCustomNamespaceMapper, isXOPPackage, removeExtraNamespacesFromNamespaceResolver, setLeafElementType, setMarshallerMethods inherited from interface org.eclipse.persistence.internal.oxm.record.XMLRecordgetConversionManager, getNamespaceSeparator, getSession
- 
Field Details- 
OPEN_XML_PI_AND_VERSION_ATTRIBUTEprotected static final byte[] OPEN_XML_PI_AND_VERSION_ATTRIBUTE
- 
OPEN_ENCODING_ATTRIBUTEprotected static final byte[] OPEN_ENCODING_ATTRIBUTE
- 
CLOSE_PIprotected static final byte[] CLOSE_PI
- 
SPACEprotected static final byte SPACE- See Also:
 
- 
CLOSE_ATTRIBUTE_VALUEprotected static final byte CLOSE_ATTRIBUTE_VALUE- See Also:
 
- 
OPEN_CDATAprotected static final byte[] OPEN_CDATA
- 
CLOSE_CDATAprotected static final byte[] CLOSE_CDATA
- 
OPEN_COMMENTprotected static final byte[] OPEN_COMMENT
- 
CLOSE_COMMENTprotected static final byte[] CLOSE_COMMENT
- 
OPEN_START_ELEMENTprotected static final byte OPEN_START_ELEMENT- See Also:
 
- 
CLOSE_ELEMENTprotected static final byte CLOSE_ELEMENT- See Also:
 
- 
AMPprotected static final byte[] AMP
- 
LTprotected static final byte[] LT
- 
GTprotected static final byte[] GT
- 
QUOTprotected static final byte[] QUOT
- 
ENCODINGprotected static final byte[] ENCODING
- 
SLASH_Nprotected static final byte[] SLASH_N
- 
SLASH_Rprotected static final byte[] SLASH_R
- 
outputStream
- 
isStartElementOpenprotected boolean isStartElementOpen
- 
isProcessingCDataprotected boolean isProcessingCData
 
- 
- 
Constructor Details- 
OutputStreamRecordpublic OutputStreamRecord()
 
- 
- 
Method Details- 
getOutputStreamReturn the OutputStream that the object will be marshalled to.- Returns:
- The marshal target.
 
- 
setOutputStreamSet the OutputStream that the object will be marshalled to.- Parameters:
- outputStream- The marshal target.
 
- 
startPrefixMappingspublic void startPrefixMappings(org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL: override so we don't iterate over namespaces when startPrefixMapping doesn't do anything- Overrides:
- startPrefixMappingsin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
 
- 
startDocumentINTERNAL:- Specified by:
- startDocumentin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- encoding- The XML document will be encoded using this encoding.
- version- This specifies the version of XML.
 
- 
writeHeaderpublic void writeHeader()INTERNAL- Overrides:
- writeHeaderin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
 
- 
endDocumentpublic void endDocument()INTERNAL:- Specified by:
- endDocumentin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
 
- 
openStartElementpublic void openStartElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL:- Specified by:
- openStartElementin interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Overrides:
- openStartElementin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- xPathFragment- The XPathFragment contains the name and prefix information about the XML element being ended.
- namespaceResolver- The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
 
- 
elementpublic void element(org.eclipse.persistence.internal.oxm.XPathFragment frag) INTERNAL:- Specified by:
- elementin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- frag- The XPathFragment of the element
 
- 
attributepublic void attribute(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver, String value) INTERNAL:- Specified by:
- attributein interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- attributein class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- xPathFragment- The XPathFragment contains the name and prefix information about the XML element being ended.
- namespaceResolver- The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
- value- This is the complete value for the attribute.
 
- 
attributeINTERNAL:- Specified by:
- attributein interface- org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- attributein interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- attributein class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- namespaceURI- The namespace URI, if the attribute is not namespace qualified the value of this parameter wil be null.
- localName- The local name of the attribute.
- qName- The qualified name of the attribute.
- value- This is the complete value for the attribute.
 
- 
closeStartElementpublic void closeStartElement()INTERNAL:- Specified by:
- closeStartElementin interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- closeStartElementin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
 
- 
endElementpublic void endElement(org.eclipse.persistence.internal.oxm.XPathFragment xPathFragment, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver) INTERNAL:- Specified by:
- endElementin interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- endElementin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- xPathFragment- The XPathFragment contains the name and prefix information about the XML element being ended.
- namespaceResolver- The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
 
- 
charactersINTERNAL:- Specified by:
- charactersin interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- charactersin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- value- This is the entire value of the text node.
 
- 
cdataINTERNAL:- Specified by:
- cdatain interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Specified by:
- cdatain class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- value- This is the value of the text to be wrapped
 
- 
writeValueINTERNAL:
- 
writeValueINTERNAL:
- 
nodepublic void node(Node node, org.eclipse.persistence.internal.oxm.NamespaceResolver namespaceResolver, String uri, String localName) Receive notification of a node.- Specified by:
- nodein class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
- Parameters:
- node- The Node to be added to the document
- namespaceResolver- The NamespaceResolver can be used to resolve the namespace URI/prefix of the node
- uri- replacement root name for the node
- localName- replacement root namespace for the node namespace URI/prefix of the node
 
- 
flushpublic void flush()- Specified by:
- flushin interface- org.eclipse.persistence.internal.oxm.record.MarshalRecord<org.eclipse.persistence.internal.core.sessions.CoreAbstractSession,- org.eclipse.persistence.internal.core.helper.CoreField, - org.eclipse.persistence.internal.oxm.XMLMarshaller, - org.eclipse.persistence.internal.oxm.NamespaceResolver> 
- Overrides:
- flushin class- MarshalRecord<org.eclipse.persistence.internal.oxm.XMLMarshaller>
 
- 
outputStreamWriteprotected void outputStreamWrite(byte[] bytes) 
- 
outputStreamWrite
- 
outputStreamWriteprotected void outputStreamWrite(byte aByte) 
- 
outputStreamWrite
 
-