org.apache.xml.security.stax.ext
Class AbstractOutputProcessor

java.lang.Object
  extended by org.apache.xml.security.stax.ext.AbstractOutputProcessor
All Implemented Interfaces:
OutputProcessor
Direct Known Subclasses:
AbstractBufferingOutputProcessor, AbstractEncryptOutputProcessor, AbstractEncryptOutputProcessor.AbstractInternalEncryptionOutputProcessor, AbstractSignatureEndingOutputProcessor.SignedInfoProcessor, AbstractSignatureOutputProcessor, AbstractSignatureOutputProcessor.InternalSignatureOutputProcessor, FinalOutputProcessor

public abstract class AbstractOutputProcessor
extends Object
implements OutputProcessor

An abstract OutputProcessor class for reusabilty

Version:
$Revision: 1602377 $ $Date: 2014-06-13 12:20:43 +0100 (Fri, 13 Jun 2014) $
Author:
$Author: coheigea $

Field Summary
protected  XMLSecurityConstants.Action action
           
protected  XMLSecurityProperties securityProperties
           
 
Constructor Summary
protected AbstractOutputProcessor()
           
 
Method Summary
 void addAfterProcessor(Object processor)
          Add this processor after the given processor
 XMLSecStartElement addAttributes(XMLSecStartElement xmlSecStartElement, List<XMLSecAttribute> attributeList)
           
 void addBeforeProcessor(Object processor)
          Add this processor before the given processor
 XMLSecAttribute createAttribute(QName attribute, String attributeValue)
           
 XMLSecCharacters createCharacters(char[] text)
           
 XMLSecCharacters createCharacters(String characters)
           
 void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text)
           
 void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, String characters)
           
 XMLSecEndElement createEndElement(QName element)
           
 void createEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element)
           
 XMLSecNamespace createNamespace(String prefix, String uri)
           
 XMLSecStartElement createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, boolean outputLocalNs, List<XMLSecAttribute> attributes)
           
 void createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, List<XMLSecNamespace> namespaces, List<XMLSecAttribute> attributes)
           
 void doFinal(OutputProcessorChain outputProcessorChain)
          Will be called when the whole document is processed.
 XMLSecurityConstants.Action getAction()
           
 Set<Object> getAfterProcessors()
          This OutputProcessor will be added after the processors in this set
 Set<Object> getBeforeProcessors()
          This OutputProcessor will be added before the processors in this set
 XMLSecurityConstants.Phase getPhase()
          The Phase in which this OutputProcessor should be applied
 XMLSecurityProperties getSecurityProperties()
           
 void init(OutputProcessorChain outputProcessorChain)
          Method will be called after setting the properties
protected  void outputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent)
           
protected  void outputDOMElement(Element element, OutputProcessorChain outputProcessorChain)
           
abstract  void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
           
 void processNextEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)
          Will be called from the framework for every XMLEvent
protected  SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, Map<Object,SecurePart> secureParts)
           
protected  SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, String dynamicParts)
           
 void setAction(XMLSecurityConstants.Action action)
          setter for the Action after instantiation of the processor
 void setPhase(XMLSecurityConstants.Phase phase)
           
 void setXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)
          setter for the XMLSecurityProperties after instantiation of the processor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityProperties

protected XMLSecurityProperties securityProperties

action

protected XMLSecurityConstants.Action action
Constructor Detail

AbstractOutputProcessor

protected AbstractOutputProcessor()
                           throws XMLSecurityException
Throws:
XMLSecurityException
Method Detail

setXMLSecurityProperties

public void setXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)
Description copied from interface: OutputProcessor
setter for the XMLSecurityProperties after instantiation of the processor

Specified by:
setXMLSecurityProperties in interface OutputProcessor

setAction

public void setAction(XMLSecurityConstants.Action action)
Description copied from interface: OutputProcessor
setter for the Action after instantiation of the processor

Specified by:
setAction in interface OutputProcessor

init

public void init(OutputProcessorChain outputProcessorChain)
          throws XMLSecurityException
Description copied from interface: OutputProcessor
Method will be called after setting the properties

Specified by:
init in interface OutputProcessor
Throws:
XMLSecurityException

getPhase

public XMLSecurityConstants.Phase getPhase()
Description copied from interface: OutputProcessor
The Phase in which this OutputProcessor should be applied

Specified by:
getPhase in interface OutputProcessor
Returns:
The Phase

setPhase

public void setPhase(XMLSecurityConstants.Phase phase)

addBeforeProcessor

public void addBeforeProcessor(Object processor)
Description copied from interface: OutputProcessor
Add this processor before the given processor

Specified by:
addBeforeProcessor in interface OutputProcessor

getBeforeProcessors

public Set<Object> getBeforeProcessors()
Description copied from interface: OutputProcessor
This OutputProcessor will be added before the processors in this set

Specified by:
getBeforeProcessors in interface OutputProcessor
Returns:
The set with the named OutputProcessor

addAfterProcessor

public void addAfterProcessor(Object processor)
Description copied from interface: OutputProcessor
Add this processor after the given processor

Specified by:
addAfterProcessor in interface OutputProcessor

getAfterProcessors

public Set<Object> getAfterProcessors()
Description copied from interface: OutputProcessor
This OutputProcessor will be added after the processors in this set

Specified by:
getAfterProcessors in interface OutputProcessor
Returns:
The set with the named OutputProcessor

getSecurityProperties

public XMLSecurityProperties getSecurityProperties()

getAction

public XMLSecurityConstants.Action getAction()

processEvent

public abstract void processEvent(XMLSecEvent xmlSecEvent,
                                  OutputProcessorChain outputProcessorChain)
                           throws XMLStreamException,
                                  XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

processNextEvent

public void processNextEvent(XMLSecEvent xmlSecEvent,
                             OutputProcessorChain outputProcessorChain)
                      throws XMLStreamException,
                             XMLSecurityException
Description copied from interface: OutputProcessor
Will be called from the framework for every XMLEvent

Specified by:
processNextEvent in interface OutputProcessor
Parameters:
xmlSecEvent - The next XMLEvent to process
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

doFinal

public void doFinal(OutputProcessorChain outputProcessorChain)
             throws XMLStreamException,
                    XMLSecurityException
Description copied from interface: OutputProcessor
Will be called when the whole document is processed.

Specified by:
doFinal in interface OutputProcessor
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

addAttributes

public XMLSecStartElement addAttributes(XMLSecStartElement xmlSecStartElement,
                                        List<XMLSecAttribute> attributeList)
                                 throws XMLStreamException
Throws:
XMLStreamException

createStartElementAndOutputAsEvent

public void createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain,
                                               QName element,
                                               List<XMLSecNamespace> namespaces,
                                               List<XMLSecAttribute> attributes)
                                        throws XMLStreamException,
                                               XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

createStartElementAndOutputAsEvent

public XMLSecStartElement createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain,
                                                             QName element,
                                                             boolean outputLocalNs,
                                                             List<XMLSecAttribute> attributes)
                                                      throws XMLStreamException,
                                                             XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

createEndElement

public XMLSecEndElement createEndElement(QName element)

createEndElementAndOutputAsEvent

public void createEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain,
                                             QName element)
                                      throws XMLStreamException,
                                             XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

createCharactersAndOutputAsEvent

public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain,
                                             String characters)
                                      throws XMLStreamException,
                                             XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

createCharactersAndOutputAsEvent

public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain,
                                             char[] text)
                                      throws XMLStreamException,
                                             XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

createCharacters

public XMLSecCharacters createCharacters(String characters)

createCharacters

public XMLSecCharacters createCharacters(char[] text)

createAttribute

public XMLSecAttribute createAttribute(QName attribute,
                                       String attributeValue)

createNamespace

public XMLSecNamespace createNamespace(String prefix,
                                       String uri)

outputAsEvent

protected void outputAsEvent(OutputProcessorChain outputProcessorChain,
                             XMLSecEvent xmlSecEvent)
                      throws XMLStreamException,
                             XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException

securePartMatches

protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement,
                                       OutputProcessorChain outputProcessorChain,
                                       String dynamicParts)

securePartMatches

protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement,
                                       Map<Object,SecurePart> secureParts)

outputDOMElement

protected void outputDOMElement(Element element,
                                OutputProcessorChain outputProcessorChain)
                         throws XMLStreamException,
                                XMLSecurityException
Throws:
XMLStreamException
XMLSecurityException


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