Package org.apache.xml.security.stax.ext
Class AbstractOutputProcessor
java.lang.Object
org.apache.xml.security.stax.ext.AbstractOutputProcessor
- All Implemented Interfaces:
OutputProcessor
- Direct Known Subclasses:
AbstractBufferingOutputProcessor
,AbstractEncryptOutputProcessor
,AbstractEncryptOutputProcessor.AbstractInternalEncryptionOutputProcessor
,AbstractSignatureEndingOutputProcessor.SignedInfoProcessor
,AbstractSignatureOutputProcessor
,AbstractSignatureOutputProcessor.InternalSignatureOutputProcessor
,FinalOutputProcessor
An abstract OutputProcessor class for reusabilty
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XMLSecurityConstants.Action
private XMLSecurityConstants.Phase
protected XMLSecurityProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAfterProcessor
(Object processor) Add this processor after the given processoraddAttributes
(XMLSecStartElement xmlSecStartElement, List<XMLSecAttribute> attributeList) void
addBeforeProcessor
(Object processor) Add this processor before the given processorcreateAttribute
(QName attribute, String attributeValue) createCharacters
(char[] text) createCharacters
(String characters) void
createCharactersAndOutputAsEvent
(OutputProcessorChain outputProcessorChain, char[] text) void
createCharactersAndOutputAsEvent
(OutputProcessorChain outputProcessorChain, String characters) createEndElement
(QName element) void
createEndElementAndOutputAsEvent
(OutputProcessorChain outputProcessorChain, QName element) createNamespace
(String prefix, String uri) 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.This OutputProcessor will be added after the processors in this setThis OutputProcessor will be added before the processors in this setgetPhase()
The Phase in which this OutputProcessor should be appliedvoid
init
(OutputProcessorChain outputProcessorChain) Method will be called after setting the propertiesprotected 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 XMLEventprotected 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 processorvoid
void
setXMLSecurityProperties
(XMLSecurityProperties xmlSecurityProperties) setter for the XMLSecurityProperties after instantiation of the processor
-
Field Details
-
securityProperties
-
action
-
phase
-
beforeProcessors
-
afterProcessors
-
-
Constructor Details
-
AbstractOutputProcessor
- Throws:
XMLSecurityException
-
-
Method Details
-
setXMLSecurityProperties
Description copied from interface:OutputProcessor
setter for the XMLSecurityProperties after instantiation of the processor- Specified by:
setXMLSecurityProperties
in interfaceOutputProcessor
- Parameters:
xmlSecurityProperties
-
-
setAction
Description copied from interface:OutputProcessor
setter for the Action after instantiation of the processor- Specified by:
setAction
in interfaceOutputProcessor
- Parameters:
action
-
-
init
Description copied from interface:OutputProcessor
Method will be called after setting the properties- Specified by:
init
in interfaceOutputProcessor
- Throws:
XMLSecurityException
-
getPhase
Description copied from interface:OutputProcessor
The Phase in which this OutputProcessor should be applied- Specified by:
getPhase
in interfaceOutputProcessor
- Returns:
- The Phase
-
setPhase
-
addBeforeProcessor
Description copied from interface:OutputProcessor
Add this processor before the given processor- Specified by:
addBeforeProcessor
in interfaceOutputProcessor
- Parameters:
processor
-
-
getBeforeProcessors
Description copied from interface:OutputProcessor
This OutputProcessor will be added before the processors in this set- Specified by:
getBeforeProcessors
in interfaceOutputProcessor
- Returns:
- The set with the named OutputProcessor
-
addAfterProcessor
Description copied from interface:OutputProcessor
Add this processor after the given processor- Specified by:
addAfterProcessor
in interfaceOutputProcessor
- Parameters:
processor
-
-
getAfterProcessors
Description copied from interface:OutputProcessor
This OutputProcessor will be added after the processors in this set- Specified by:
getAfterProcessors
in interfaceOutputProcessor
- Returns:
- The set with the named OutputProcessor
-
getSecurityProperties
-
getAction
-
processEvent
public abstract void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) 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 interfaceOutputProcessor
- Parameters:
xmlSecEvent
- The next XMLEvent to processoutputProcessorChain
-- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- 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 interfaceOutputProcessor
- Parameters:
outputProcessorChain
-- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- 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 -
createStartElementAndOutputAsEvent
public XMLSecStartElement createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, boolean outputLocalNs, List<XMLSecAttribute> attributes) throws XMLStreamException, XMLSecurityException -
createEndElement
-
createEndElementAndOutputAsEvent
public void createEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element) throws XMLStreamException, XMLSecurityException -
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, String characters) throws XMLStreamException, XMLSecurityException -
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text) throws XMLStreamException, XMLSecurityException -
createCharacters
-
createCharacters
-
createAttribute
-
createNamespace
-
outputAsEvent
protected void outputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent) 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
-