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 XMLStructure>
-
-
Constructor Summary
Constructors Constructor Description XmlWriterToTree(List<XmlWriter.ToMarshal<? extends XMLStructure>> marshallers, Node parent)XmlWriterToTree(List<XmlWriter.ToMarshal<? extends XMLStructure>> marshallers, Node parent, 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 ElementgetCreatedElement()Get the root element created with this writer.StringgetCurrentLocalName()Get the local name of the current element.XMLStructuregetCurrentNodeAsStructure()voidmarshalStructure(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.voidresetToNewParent(Node newParent)Reset to a new parent so that the writer can be re-used.AttrwriteAttribute(String prefix, String namespaceURI, String localName, String value)voidwriteCharacters(String text)voidwriteComment(String text)voidwriteEndElement()See alsoXMLStreamWriter.writeEndElement()voidwriteIdAttribute(String prefix, String namespaceURI, String localName, String value)voidwriteNamespace(String prefix, String namespaceURI)voidwriteStartElement(String prefix, String localName, String namespaceURI)voidwriteTextElement(String prefix, String localName, String namespaceURI, String value)Convenience method that writes both a start and end tag, with text contents as provided.
-
-
-
Constructor Detail
-
XmlWriterToTree
public XmlWriterToTree(List<XmlWriter.ToMarshal<? extends XMLStructure>> marshallers, Node parent)
-
XmlWriterToTree
public XmlWriterToTree(List<XmlWriter.ToMarshal<? extends XMLStructure>> marshallers, Node parent, 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(Node newParent)
Reset to a new parent so that the writer can be re-used.- Parameters:
newParent-
-
getCreatedElement
public Element getCreatedElement()
Get the root element created with this writer.- Returns:
- the root element created with this writer.
-
writeStartElement
public void writeStartElement(String prefix, String localName, String namespaceURI)
- Specified by:
writeStartElementin 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:XmlWriterSee alsoXMLStreamWriter.writeEndElement()- Specified by:
writeEndElementin interfaceXmlWriter
-
writeTextElement
public void writeTextElement(String prefix, String localName, String namespaceURI, String value)
Description copied from interface:XmlWriterConvenience method that writes both a start and end tag, with text contents as provided.- Specified by:
writeTextElementin interfaceXmlWriter
-
writeNamespace
public void writeNamespace(String prefix, String namespaceURI)
- Specified by:
writeNamespacein interfaceXmlWriter
-
writeCharacters
public void writeCharacters(String text)
- Specified by:
writeCharactersin interfaceXmlWriter
-
writeComment
public void writeComment(String text)
- Specified by:
writeCommentin interfaceXmlWriter
-
writeAttribute
public Attr writeAttribute(String prefix, String namespaceURI, String localName, String value)
- Specified by:
writeAttributein interfaceXmlWriter
-
writeIdAttribute
public void writeIdAttribute(String prefix, String namespaceURI, String localName, String value)
- Specified by:
writeIdAttributein interfaceXmlWriter
-
getCurrentLocalName
public String getCurrentLocalName()
Description copied from interface:XmlWriterGet the local name of the current element.- Specified by:
getCurrentLocalNamein interfaceXmlWriter- Returns:
- the local name of the current element.
-
getCurrentNodeAsStructure
public XMLStructure getCurrentNodeAsStructure()
- Specified by:
getCurrentNodeAsStructurein interfaceXmlWriter
-
marshalStructure
public void marshalStructure(XMLStructure toMarshal, String dsPrefix, XMLCryptoContext context) throws MarshalException
Description copied from interface:XmlWriterThis 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:
marshalStructurein interfaceXmlWriter- 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.
-
-