Class XmlWriterToTree
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.XmlWriterToTree
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jcp.xml.dsig.internal.dom.XmlWriter
XmlWriter.ToMarshal<CLZ extends javax.xml.crypto.XMLStructure>
-
-
Constructor Summary
Constructors Constructor Description XmlWriterToTree(java.util.List<XmlWriter.ToMarshal<? extends javax.xml.crypto.XMLStructure>> marshallers, org.w3c.dom.Node parent)
XmlWriterToTree(java.util.List<XmlWriter.ToMarshal<? extends javax.xml.crypto.XMLStructure>> marshallers, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)
In cases where the serialization is supposed to precede a specific element, we add an extra parameter to capture that.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Element
getCreatedElement()
Get the root element created with this writer.java.lang.String
getCurrentLocalName()
Get the local name of the current element.javax.xml.crypto.XMLStructure
getCurrentNodeAsStructure()
void
marshalStructure(javax.xml.crypto.XMLStructure toMarshal, java.lang.String dsPrefix, javax.xml.crypto.XMLCryptoContext context)
This method marshals a structure, and relies on implementation specific details for how an instance of a particular class maps to the method that actually does the marshaling.void
resetToNewParent(org.w3c.dom.Node newParent)
Reset to a new parent so that the writer can be re-used.org.w3c.dom.Attr
writeAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
void
writeCharacters(java.lang.String text)
void
writeComment(java.lang.String text)
void
writeEndElement()
See alsoXMLStreamWriter.writeEndElement()
void
writeIdAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
void
writeNamespace(java.lang.String prefix, java.lang.String namespaceURI)
void
writeStartElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI)
void
writeTextElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI, java.lang.String value)
Convenience method that writes both a start and end tag, with text contents as provided.
-
-
-
Constructor Detail
-
XmlWriterToTree
public XmlWriterToTree(java.util.List<XmlWriter.ToMarshal<? extends javax.xml.crypto.XMLStructure>> marshallers, org.w3c.dom.Node parent)
-
XmlWriterToTree
public XmlWriterToTree(java.util.List<XmlWriter.ToMarshal<? extends javax.xml.crypto.XMLStructure>> marshallers, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)
In cases where the serialization is supposed to precede a specific element, we add an extra parameter to capture that. Only affects the first element insertion (obviously?).- Parameters:
marshallers
-parent
-nextSibling
- The first element created will be created *before* this element.
-
-
Method Detail
-
resetToNewParent
public void resetToNewParent(org.w3c.dom.Node newParent)
Reset to a new parent so that the writer can be re-used.- Parameters:
newParent
-
-
getCreatedElement
public org.w3c.dom.Element getCreatedElement()
Get the root element created with this writer.- Returns:
- the root element created with this writer.
-
writeStartElement
public void writeStartElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI)
- Specified by:
writeStartElement
in interfaceXmlWriter
- Parameters:
prefix
- What prefix to use?localName
- What local name to use?namespaceURI
- What namespace URI? See alsoXMLStreamWriter.writeStartElement(String, String, String)
-
writeEndElement
public void writeEndElement()
Description copied from interface:XmlWriter
See alsoXMLStreamWriter.writeEndElement()
- Specified by:
writeEndElement
in interfaceXmlWriter
-
writeTextElement
public void writeTextElement(java.lang.String prefix, java.lang.String localName, java.lang.String namespaceURI, java.lang.String value)
Description copied from interface:XmlWriter
Convenience method that writes both a start and end tag, with text contents as provided.- Specified by:
writeTextElement
in interfaceXmlWriter
-
writeNamespace
public void writeNamespace(java.lang.String prefix, java.lang.String namespaceURI)
- Specified by:
writeNamespace
in interfaceXmlWriter
-
writeCharacters
public void writeCharacters(java.lang.String text)
- Specified by:
writeCharacters
in interfaceXmlWriter
-
writeComment
public void writeComment(java.lang.String text)
- Specified by:
writeComment
in interfaceXmlWriter
-
writeAttribute
public org.w3c.dom.Attr writeAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
- Specified by:
writeAttribute
in interfaceXmlWriter
-
writeIdAttribute
public void writeIdAttribute(java.lang.String prefix, java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
- Specified by:
writeIdAttribute
in interfaceXmlWriter
-
getCurrentLocalName
public java.lang.String getCurrentLocalName()
Description copied from interface:XmlWriter
Get the local name of the current element.- Specified by:
getCurrentLocalName
in interfaceXmlWriter
- Returns:
- the local name of the current element.
-
getCurrentNodeAsStructure
public javax.xml.crypto.XMLStructure getCurrentNodeAsStructure()
- Specified by:
getCurrentNodeAsStructure
in interfaceXmlWriter
-
marshalStructure
public void marshalStructure(javax.xml.crypto.XMLStructure toMarshal, java.lang.String dsPrefix, javax.xml.crypto.XMLCryptoContext context) throws javax.xml.crypto.MarshalException
Description copied from interface:XmlWriter
This method marshals a structure, and relies on implementation specific details for how an instance of a particular class maps to the method that actually does the marshaling.- Specified by:
marshalStructure
in interfaceXmlWriter
- Parameters:
toMarshal
- The object to be marshaled.dsPrefix
- The digital signature prefix.context
- The context for marshaling.- Throws:
javax.xml.crypto.MarshalException
- Thrown if something goes wrong during the marshaling.
-
-