Top Description Inners Fields Constructors Methods
org.eclipse.persistence.oxm.record

public Class OutputStreamRecord

extends MarshalRecord<XMLMarshaller<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler, CONTEXT extends Context<ABSTRACT_SESSION, DESCRIPTOR, ?, ?, ?, SESSION, ?>, DESCRIPTOR extends Descriptor<?, ?, ?, ?, ?, ?, ?, ?, ?, ?>, MARSHALLER_LISTENER extends Marshaller.Listener, MEDIA_TYPE extends MediaType, NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper, OBJECT_BUILDER extends ObjectBuilder<?, ABSTRACT_SESSION, ?, XMLMarshaller ...>, SESSION extends CoreSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager>>>
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.oxm.record.FormattedOutputStreamRecord
Imports
java.io.CharArrayWriter, .OutputStream, .IOException, .UnsupportedEncodingException, java.util.HashMap, .Iterator, .Map, .Map.Entry, .Set, org.eclipse.persistence.exceptions.XMLMarshalException, org.eclipse.persistence.internal.oxm.CharacterEscapeHandler, .Constants, .NamespaceResolver, .XMLMarshaller, .XPathFragment, org.eclipse.persistence.internal.oxm.record.ExtendedContentHandler, .XMLFragmentReader, org.w3c.dom.Attr, .Node, org.xml.sax.Attributes, .Locator, .SAXException, org.xml.sax.ext.LexicalHandler

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
org.eclipse.persistence.oxm.XMLMarshaller

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
OutputStreamRecord.OutputStreamRecordContentHandler

This class will typically be used in conjunction with an XMLFragmentReader.

Field Summary

Modifier and TypeField and Description
protected static final byte[]
private byte[]
private static final int
private int
protected static final byte
protected static final byte[]
protected static final byte[]
protected static final byte
protected static final byte[]
protected static final byte[]
protected static final byte[]
protected boolean
protected boolean
protected static final byte[]
protected static final byte[]
protected static final byte[]
protected static final byte[]
protected static final byte
protected static final byte[]
protected OutputStream
protected static final byte[]
protected static final byte[]
protected static final byte[]
protected static final byte
Inherited from org.eclipse.persistence.oxm.record.MarshalRecord:
COLON_W_SCHEMA_NIL_ATTRIBUTEtextWrapperFragmentTRUE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
attribute(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
,
String
This is the complete value for the attribute.
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute.

INTERNAL:
public void
attribute(String
The namespace URI, if the attribute is not namespace qualified the value of this parameter wil be null.
namespaceURI
,
String
The local name of the attribute.
localName
,
String
The qualified name of the attribute.
qName
,
String
This is the complete value for the attribute.
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.attribute.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.attribute, org.eclipse.persistence.internal.oxm.record.AbstractMarshalRecord.attribute.

INTERNAL:
public void
cdata(String
This is the value of the text to be wrapped
value
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.cdata.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.cdata.

INTERNAL:
public void
public void
public void
element(XPathFragment<XML_FIELD extends Field>
The XPathFragment of the element
frag
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.element.

INTERNAL:
public void
public void
endElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.endElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.endElement.

INTERNAL:
public void
public OutputStream

Returns:

The marshal target.
getOutputStream
()

Return the OutputStream that the object will be marshalled to.

public void
node(Node
The Node to be added to the document
node
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI/prefix of the node
namespaceResolver
,
String
replacement root name for the node
uri
,
String
replacement root namespace for the node namespace URI/prefix of the node
localName
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.node.

Receive notification of a node.
public void
openStartElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix information about the XML element being ended.
xPathFragment
,
NamespaceResolver
The NamespaceResolver can be used to resolve the namespace URI for the namespace prefix held by the XPathFragment (if required).
namespaceResolver
)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.openStartElement.

Implements org.eclipse.persistence.internal.oxm.record.MarshalRecord.openStartElement.

INTERNAL:
protected void
outputStreamWrite(byte[] bytes)

protected void
outputStreamWrite(byte[] bytes, OutputStream os)

protected void
outputStreamWrite(byte aByte)

protected void
public void
setOutputStream(OutputStream
The marshal target.
outputStream
)

Set the OutputStream that the object will be marshalled to.

public void
startDocument(String
The XML document will be encoded using this encoding.
encoding
,
String
This specifies the version of XML.
version
)

Implements abstract org.eclipse.persistence.oxm.record.MarshalRecord.startDocument.

INTERNAL:
public void
startPrefixMappings(NamespaceResolver namespaceResolver)

Overrides org.eclipse.persistence.oxm.record.MarshalRecord.startPrefixMappings.

INTERNAL: override so we don't iterate over namespaces when startPrefixMapping doesn't do anything
public void
protected void
writeValue(String value, boolean escapeChars)

INTERNAL:

protected void
writeValue(String value, boolean escapeChars, boolean isAttribute, OutputStream os)

INTERNAL:

Inherited from org.eclipse.persistence.oxm.record.MarshalRecord:
addaddGroupingElementaddPositionalNodesafterContainmentMarshalattributebeforeContainmentMarshalcharactersclearcloseStartGroupingElementsdefaultNamespaceDeclarationemptyAttributeemptyCollectionemptyComplexemptySimpleendCollectionendPrefixMappingendPrefixMappingsforceValueWrappergetCurrentAttributeGroupgetCycleDetectionStackgetDocumentgetDOMgetGroupingElementsgetLocalNamegetNameForFragmentgetNamespaceURIgetPositionalNodesgetPrefixBytesgetPrefixForFragmentgetStringForQNamegetTextWrapperFragmentgetValueToWriteisWrapperAsCollectionNamemarshalWithoutRootElementnamespaceDeclarationnamespaceDeclarationsnilComplexnilSimplenodeopenStartGroupingElementspopAttributeGrouppredicateAttributeprocessNamespaceResolverForXSIPrefixpushAttributeGroupputremoveGroupingElementsetGroupingElementsetSessionsplitCDatastartCollectionstartPrefixMappingtransformToXML