Package org.keycloak.saml.common.util
Class StaxUtil
java.lang.Object
org.keycloak.saml.common.util.StaxUtil
Utility class that deals with StAX
- Since:
- Oct 19, 2010
- Author:
- Anil.Saldhana@redhat.com
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
flush
(XMLStreamWriter writer) Flush the stream writerstatic XMLEventWriter
getXMLEventWriter
(OutputStream outStream) Get anXMLEventWriter
static XMLStreamWriter
getXMLStreamWriter
(OutputStream outStream) Get anXMLStreamWriter
static XMLStreamWriter
getXMLStreamWriter
(Writer writer) Get anXMLStreamWriter
static XMLStreamWriter
getXMLStreamWriter
(Result result) static void
setPrefix
(XMLStreamWriter writer, String prefix, String nsURI) Set a prefixstatic void
writeAttribute
(XMLStreamWriter writer, String localName, String value) Write an xml attributestatic void
writeAttribute
(XMLStreamWriter writer, String localName, String type, String value) Write an xml attributestatic void
writeAttribute
(XMLStreamWriter writer, String prefix, String localName, String type, String value) Write an xml attributestatic void
writeAttribute
(XMLStreamWriter writer, String attributeName, QName attributeValue) Write an attributestatic void
writeAttribute
(XMLStreamWriter writer, QName attributeName, String attributeValue) Write an attributestatic void
writeCData
(XMLStreamWriter writer, String value) Write a string as text nodestatic void
writeCharacters
(XMLStreamWriter writer, String value) Write a string as text nodestatic void
writeDefaultNameSpace
(XMLStreamWriter writer, String ns) Write the default namespacestatic void
writeDOMElement
(XMLStreamWriter writer, Element domElement) Write DOM Element to the streamstatic void
writeDOMNode
(XMLStreamWriter writer, Node node) Write a DOM Node to the streamstatic void
writeEndElement
(XMLStreamWriter writer) Write an end element.static void
writeNameSpace
(XMLStreamWriter writer, String prefix, String ns) Write a namespacestatic void
writeStartElement
(XMLStreamWriter writer, String prefix, String localPart, String ns) Write a start element
-
Constructor Details
-
StaxUtil
public StaxUtil()
-
-
Method Details
-
flush
Flush the stream writer- Parameters:
writer
-- Throws:
ProcessingException
-
getXMLEventWriter
Get anXMLEventWriter
- Parameters:
outStream
-- Returns:
- Throws:
ProcessingException
-
getXMLStreamWriter
Get anXMLStreamWriter
- Parameters:
outStream
-- Returns:
- Throws:
ProcessingException
-
getXMLStreamWriter
Get anXMLStreamWriter
- Parameters:
writer
-Writer
- Returns:
- Throws:
ProcessingException
-
getXMLStreamWriter
- Throws:
ProcessingException
-
setPrefix
public static void setPrefix(XMLStreamWriter writer, String prefix, String nsURI) throws ProcessingException Set a prefix- Parameters:
writer
-prefix
-nsURI
-- Throws:
ProcessingException
-
writeAttribute
public static void writeAttribute(XMLStreamWriter writer, String attributeName, QName attributeValue) throws ProcessingException Write an attribute- Parameters:
writer
-attributeName
- QName of the attributeattributeValue
-- Throws:
ProcessingException
-
writeAttribute
public static void writeAttribute(XMLStreamWriter writer, QName attributeName, String attributeValue) throws ProcessingException Write an attribute- Parameters:
writer
-attributeName
- QName of the attributeattributeValue
-- Throws:
ProcessingException
-
writeAttribute
public static void writeAttribute(XMLStreamWriter writer, String localName, String value) throws ProcessingException Write an xml attribute- Parameters:
writer
-localName
- localpartvalue
- value of the attribute- Throws:
ProcessingException
-
writeAttribute
public static void writeAttribute(XMLStreamWriter writer, String localName, String type, String value) throws ProcessingException Write an xml attribute- Parameters:
writer
-localName
- localparttype
- typically xsi:typevalue
- value of the attribute- Throws:
ProcessingException
-
writeAttribute
public static void writeAttribute(XMLStreamWriter writer, String prefix, String localName, String type, String value) throws ProcessingException Write an xml attribute- Parameters:
writer
-prefix
- prefix for the attributelocalName
- localparttype
- typically xsi:typevalue
- value of the attribute- Throws:
ProcessingException
-
writeCharacters
Write a string as text node- Parameters:
writer
-value
-- Throws:
ProcessingException
-
writeCData
Write a string as text node- Parameters:
writer
-value
-- Throws:
ProcessingException
-
writeDefaultNameSpace
public static void writeDefaultNameSpace(XMLStreamWriter writer, String ns) throws ProcessingException Write the default namespace- Parameters:
writer
-ns
-- Throws:
ProcessingException
-
writeDOMNode
Write a DOM Node to the stream- Parameters:
writer
-node
-- Throws:
ProcessingException
-
writeDOMElement
public static void writeDOMElement(XMLStreamWriter writer, Element domElement) throws ProcessingException Write DOM Element to the stream- Parameters:
writer
-domElement
-- Throws:
ProcessingException
-
writeNameSpace
public static void writeNameSpace(XMLStreamWriter writer, String prefix, String ns) throws ProcessingException Write a namespace- Parameters:
writer
-prefix
- prefixns
- Namespace URI- Throws:
ProcessingException
-
writeStartElement
public static void writeStartElement(XMLStreamWriter writer, String prefix, String localPart, String ns) throws ProcessingException Write a start element- Parameters:
writer
-prefix
-localPart
-ns
-- Throws:
ProcessingException
-
writeEndElement
Write an end element. The stream writer keeps track of which start element needs to be closed with an end tag.
- Parameters:
writer
-- Throws:
ProcessingException
-