PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.core.util
Class StaxUtil

java.lang.Object
  extended by org.picketlink.identity.federation.core.util.StaxUtil

public class StaxUtil
extends Object

Utility class that deals with StAX

Since:
Oct 19, 2010
Author:
Anil.Saldhana@redhat.com

Constructor Summary
StaxUtil()
           
 
Method Summary
static void flush(XMLStreamWriter writer)
          Flush the stream writer
static XMLEventWriter getXMLEventWriter(OutputStream outStream)
          Get an XMLEventWriter
static XMLStreamWriter getXMLStreamWriter(OutputStream outStream)
          Get an XMLStreamWriter
static XMLStreamWriter getXMLStreamWriter(Result result)
           
static XMLStreamWriter getXMLStreamWriter(Writer writer)
          Get an XMLStreamWriter
static void setPrefix(XMLStreamWriter writer, String prefix, String nsURI)
          Set a prefix
static void writeAttribute(XMLStreamWriter writer, QName attributeName, String attributeValue)
          Write an attribute
static void writeAttribute(XMLStreamWriter writer, String attributeName, QName attributeValue)
          Write an attribute
static void writeAttribute(XMLStreamWriter writer, String localName, String value)
          Write an xml attribute
static void writeAttribute(XMLStreamWriter writer, String localName, String type, String value)
          Write an xml attribute
static void writeAttribute(XMLStreamWriter writer, String prefix, String localName, String type, String value)
          Write an xml attribute
static void writeCData(XMLStreamWriter writer, String value)
          Write a string as text node
static void writeCharacters(XMLStreamWriter writer, String value)
          Write a string as text node
static void writeDefaultNameSpace(XMLStreamWriter writer, String ns)
          Write the default namespace
static void writeDOMElement(XMLStreamWriter writer, Element domElement)
          Write DOM Element to the stream
static void writeDOMNode(XMLStreamWriter writer, Node node)
          Write a DOM Node to the stream
static void writeDSAKeyValueType(XMLStreamWriter writer, DSAKeyValueType type)
           
static void writeEndElement(XMLStreamWriter writer)
           Write an end element.
static void writeKeyInfo(XMLStreamWriter writer, KeyInfoType keyInfo)
          Write the KeyInfoType
static void writeNameSpace(XMLStreamWriter writer, String prefix, String ns)
          Write a namespace
static void writeRSAKeyValueType(XMLStreamWriter writer, RSAKeyValueType type)
           
static void writeStartElement(XMLStreamWriter writer, String prefix, String localPart, String ns)
          Write a start element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaxUtil

public StaxUtil()
Method Detail

flush

public static void flush(XMLStreamWriter writer)
                  throws ProcessingException
Flush the stream writer

Parameters:
writer -
Throws:
ProcessingException

getXMLEventWriter

public static XMLEventWriter getXMLEventWriter(OutputStream outStream)
                                        throws ProcessingException
Get an XMLEventWriter

Parameters:
outStream -
Returns:
Throws:
ProcessingException

getXMLStreamWriter

public static XMLStreamWriter getXMLStreamWriter(OutputStream outStream)
                                          throws ProcessingException
Get an XMLStreamWriter

Parameters:
outStream -
Returns:
Throws:
ProcessingException

getXMLStreamWriter

public static XMLStreamWriter getXMLStreamWriter(Writer writer)
                                          throws ProcessingException
Get an XMLStreamWriter

Parameters:
writer - Writer
Returns:
Throws:
ProcessingException

getXMLStreamWriter

public static XMLStreamWriter getXMLStreamWriter(Result result)
                                          throws ProcessingException
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 attribute
attributeValue -
Throws:
ProcessingException

writeAttribute

public static void writeAttribute(XMLStreamWriter writer,
                                  QName attributeName,
                                  String attributeValue)
                           throws ProcessingException
Write an attribute

Parameters:
writer -
attributeName - QName of the attribute
attributeValue -
Throws:
ProcessingException

writeAttribute

public static void writeAttribute(XMLStreamWriter writer,
                                  String localName,
                                  String value)
                           throws ProcessingException
Write an xml attribute

Parameters:
writer -
localName - localpart
value - 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 - localpart
type - typically xsi:type
value - 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 attribute
localName - localpart
type - typically xsi:type
value - value of the attribute
Throws:
ProcessingException

writeCharacters

public static void writeCharacters(XMLStreamWriter writer,
                                   String value)
                            throws ProcessingException
Write a string as text node

Parameters:
writer -
value -
Throws:
ProcessingException

writeCData

public static void writeCData(XMLStreamWriter writer,
                              String value)
                       throws ProcessingException
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

public static void writeDOMNode(XMLStreamWriter writer,
                                Node node)
                         throws ProcessingException
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 - prefix
ns - 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

public static void writeEndElement(XMLStreamWriter writer)
                            throws ProcessingException

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

writeKeyInfo

public static void writeKeyInfo(XMLStreamWriter writer,
                                KeyInfoType keyInfo)
                         throws ProcessingException
Write the KeyInfoType

Parameters:
writer -
keyInfo -
Throws:
ProcessingException

writeRSAKeyValueType

public static void writeRSAKeyValueType(XMLStreamWriter writer,
                                        RSAKeyValueType type)
                                 throws ProcessingException
Throws:
ProcessingException

writeDSAKeyValueType

public static void writeDSAKeyValueType(XMLStreamWriter writer,
                                        DSAKeyValueType type)
                                 throws ProcessingException
Throws:
ProcessingException

PicketLink Federation Core 2.1.6.Final-redhat-2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.