Top Description Inners Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.output

public Class C14nXmlOutput

extends UTF8XmlOutput
Class Inheritance
Imports
com.sun.istack.FinalArrayList, org.glassfish.jaxb.core.marshaller.CharacterEscapeHandler, org.glassfish.jaxb.runtime.api.JAXBRIContext, org.glassfish.jaxb.runtime.v2.runtime.Name, java.io.IOException, .OutputStream, java.util.Arrays, .Collections

XmlOutput that generates canonical XML.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
private int
private final boolean
namedAttributesAreOrdered

True if JAXBRIContext is created with c14n support on, in which case all named attributes are sorted by the marshaller and we won't have to do it here.

private int[]
nsBuf

Used to sort namespace declarations.

private final FinalArrayList<C14nXmlOutput.DynamicAttribute>
otherAttributes

Hosts other attributes whose name are not statically known (AKA attribute wildcard.) As long as this map is empty, there's no need for sorting.

private C14nXmlOutput.StaticAttribute[]
staticAttributes

Hosts statically known attributes.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput:
closeStartTagPendingoctetBufferoctetBufferIndexout

Constructor Summary

AccessConstructor and Description
public
C14nXmlOutput(OutputStream out, Encoded[] localNames, boolean namedAttributesAreOrdered, CharacterEscapeHandler escapeHandler)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
protected void
writeNsDecls(int base)

Overrides org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput.writeNsDecls.

Write namespace declarations after sorting them.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput:
beginStartTagbeginStartTagcloseStartTagendDocumentendTagendTagflushBuffersetHeaderstartDocumenttexttexttexttexttoByteswritewritewritewriteNsDecl

Field Detail

lenback to summary
private int len
namedAttributesAreOrderedback to summary
private final boolean namedAttributesAreOrdered

True if JAXBRIContext is created with c14n support on, in which case all named attributes are sorted by the marshaller and we won't have to do it here.

nsBufback to summary
private int[] nsBuf

Used to sort namespace declarations. Reused.

otherAttributesback to summary
private final FinalArrayList<C14nXmlOutput.DynamicAttribute> otherAttributes

Hosts other attributes whose name are not statically known (AKA attribute wildcard.) As long as this map is empty, there's no need for sorting.

staticAttributesback to summary
private C14nXmlOutput.StaticAttribute[] staticAttributes

Hosts statically known attributes. StaticAttribute instances are reused.

Constructor Detail

C14nXmlOutputback to summary
public C14nXmlOutput(OutputStream out, Encoded[] localNames, boolean namedAttributesAreOrdered, CharacterEscapeHandler escapeHandler)

Method Detail

attributeback to summary
public void attribute(Name name, String value) throws IOException

Overrides org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput.attribute.

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.attribute.

Annotations
@Override
attributeback to summary
public void attribute(int prefix, String localName, String value) throws IOException

Overrides org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput.attribute.

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.attribute.

Annotations
@Override
endStartTagback to summary
public void endStartTag() throws IOException

Overrides org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput.endStartTag.

Implements org.glassfish.jaxb.runtime.v2.runtime.output.XmlOutput.endStartTag.

Annotations
@Override
writeNsDeclsback to summary
protected void writeNsDecls(int base) throws IOException

Overrides org.glassfish.jaxb.runtime.v2.runtime.output.UTF8XmlOutput.writeNsDecls.

Write namespace declarations after sorting them.

Annotations
@Override
org.glassfish.jaxb.runtime.v2.runtime.output back to summary

pack-priv final Class C14nXmlOutput.DynamicAttribute

extends Object
implements Comparable<C14nXmlOutput.DynamicAttribute>
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.runtime.output.C14nXmlOutput.DynamicAttribute
All Implemented Interfaces
java.lang.Comparable

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final int
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
DynamicAttribute(int prefix, String localName, String value)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(C14nXmlOutput.DynamicAttribute that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

private String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

localNameback to summary
pack-priv final String localName
prefixback to summary
pack-priv final int prefix
valueback to summary
pack-priv final String value

Constructor Detail

DynamicAttributeback to summary
public DynamicAttribute(int prefix, String localName, String value)

Method Detail

compareToback to summary
public int compareTo(C14nXmlOutput.DynamicAttribute that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
getURIback to summary
private String getURI()
org.glassfish.jaxb.runtime.v2.runtime.output back to summary

pack-priv final Class C14nXmlOutput.StaticAttribute

extends Object
implements Comparable<C14nXmlOutput.StaticAttribute>
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.runtime.output.C14nXmlOutput.StaticAttribute
All Implemented Interfaces
java.lang.Comparable

Field Summary

Modifier and TypeField and Description
pack-priv Name
pack-priv String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(C14nXmlOutput.StaticAttribute that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public void
set(Name name, String value)

pack-priv C14nXmlOutput.DynamicAttribute
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
pack-priv Name name
valueback to summary
pack-priv String value

Constructor Detail

StaticAttributeback to summary
pack-priv StaticAttribute()

Method Detail

compareToback to summary
public int compareTo(C14nXmlOutput.StaticAttribute that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
setback to summary
public void set(Name name, String value)
toDynamicAttributeback to summary
pack-priv C14nXmlOutput.DynamicAttribute toDynamicAttribute()
writeback to summary
pack-priv void write() throws IOException