org.apache.jcp.xml.dsig.internal.dom
Interface XmlWriter

All Known Implementing Classes:
XmlWriterToTree

public interface XmlWriter

This interface is used to construct XML via a sequence of API calls.

This is written to be similar to javax.xml.stream.XMLStreamWriter, but has slightly different requirements. Specifically, we need to be able to create an "ID" type attribute, and get the current node.


Nested Class Summary
static class XmlWriter.ToMarshal<CLZ extends XMLStructure>
          Utility class that brings together the class, and the method for marshaling an instance of said class.
 
Method Summary
 String getCurrentLocalName()
          Get the local name of the current element.
 XMLStructure getCurrentNodeAsStructure()
           
 void marshalStructure(XMLStructure toMarshal, String dsPrefix, 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.
 Attr writeAttribute(String prefix, String namespaceURI, String localName, String value)
           
 void writeCharacters(String text)
           
 void writeComment(String text)
           
 void writeEndElement()
          See also XMLStreamWriter.writeEndElement()
 void writeIdAttribute(String prefix, String namespaceURI, String localName, String value)
           
 void writeNamespace(String prefix, String namespaceURI)
           
 void writeStartElement(String prefix, String localName, String namespaceURI)
           
 void writeTextElement(String prefix, String localName, String namespaceURI, String value)
          Convenience method that writes both a start and end tag, with text contents as provided.
 

Method Detail

writeStartElement

void writeStartElement(String prefix,
                       String localName,
                       String namespaceURI)
Parameters:
prefix - What prefix to use?
localName - What local name to use?
namespaceURI - What namespace URI? See also XMLStreamWriter.writeStartElement(String, String, String)

writeEndElement

void writeEndElement()
See also XMLStreamWriter.writeEndElement()


writeTextElement

void writeTextElement(String prefix,
                      String localName,
                      String namespaceURI,
                      String value)
Convenience method that writes both a start and end tag, with text contents as provided.

Parameters:
prefix -
localName -
namespaceURI -
value -

writeNamespace

void writeNamespace(String prefix,
                    String namespaceURI)

writeCharacters

void writeCharacters(String text)

writeComment

void writeComment(String text)

writeAttribute

Attr writeAttribute(String prefix,
                    String namespaceURI,
                    String localName,
                    String value)

writeIdAttribute

void writeIdAttribute(String prefix,
                      String namespaceURI,
                      String localName,
                      String value)

getCurrentLocalName

String getCurrentLocalName()
Get the local name of the current element.

Returns:
the local name of the current element.

getCurrentNodeAsStructure

XMLStructure getCurrentNodeAsStructure()

marshalStructure

void marshalStructure(XMLStructure toMarshal,
                      String dsPrefix,
                      XMLCryptoContext context)
                      throws MarshalException
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.

Parameters:
toMarshal - The object to be marshaled.
dsPrefix - The digital signature prefix.
context - The context for marshaling.
Throws:
MarshalException - Thrown if something goes wrong during the marshaling.


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.