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.Actionprotected XMLSecurityProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAfterProcessor(Object processor) Add this processor after the given processoraddAttributes(XMLSecStartElement xmlSecStartElement, List<XMLSecAttribute> attributeList) voidaddBeforeProcessor(Object processor) Add this processor before the given processorcreateAttribute(QName attribute, String attributeValue) createCharacters(char[] text) createCharacters(String characters) voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text) voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, String characters) createEndElement(QName element) voidcreateEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element) createNamespace(String prefix, String uri) createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, boolean outputLocalNs, List<XMLSecAttribute> attributes) voidcreateStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, List<XMLSecNamespace> namespaces, List<XMLSecAttribute> attributes) voiddoFinal(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 appliedvoidinit(OutputProcessorChain outputProcessorChain) Method will be called after setting the propertiesprotected voidoutputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent) protected voidoutputDOMElement(Element element, OutputProcessorChain outputProcessorChain) abstract voidprocessEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) voidprocessNextEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) Will be called from the framework for every XMLEventprotected SecurePartsecurePartMatches(XMLSecStartElement xmlSecStartElement, Map<Object, SecurePart> secureParts) protected SecurePartsecurePartMatches(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, String dynamicParts) voidsetAction(XMLSecurityConstants.Action action) setter for the Action after instantiation of the processorvoidvoidsetXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties) setter for the XMLSecurityProperties after instantiation of the processor
-
Field Details
-
securityProperties
-
action
-
-
Constructor Details
-
AbstractOutputProcessor
- Throws:
XMLSecurityException
-
-
Method Details
-
setXMLSecurityProperties
Description copied from interface:OutputProcessorsetter for the XMLSecurityProperties after instantiation of the processor- Specified by:
setXMLSecurityPropertiesin interfaceOutputProcessor
-
setAction
Description copied from interface:OutputProcessorsetter for the Action after instantiation of the processor- Specified by:
setActionin interfaceOutputProcessor
-
init
Description copied from interface:OutputProcessorMethod will be called after setting the properties- Specified by:
initin interfaceOutputProcessor- Throws:
XMLSecurityException
-
getPhase
Description copied from interface:OutputProcessorThe Phase in which this OutputProcessor should be applied- Specified by:
getPhasein interfaceOutputProcessor- Returns:
- The Phase
-
setPhase
-
addBeforeProcessor
Description copied from interface:OutputProcessorAdd this processor before the given processor- Specified by:
addBeforeProcessorin interfaceOutputProcessor
-
getBeforeProcessors
Description copied from interface:OutputProcessorThis OutputProcessor will be added before the processors in this set- Specified by:
getBeforeProcessorsin interfaceOutputProcessor- Returns:
- The set with the named OutputProcessor
-
addAfterProcessor
Description copied from interface:OutputProcessorAdd this processor after the given processor- Specified by:
addAfterProcessorin interfaceOutputProcessor
-
getAfterProcessors
Description copied from interface:OutputProcessorThis OutputProcessor will be added after the processors in this set- Specified by:
getAfterProcessorsin 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:OutputProcessorWill be called from the framework for every XMLEvent- Specified by:
processNextEventin interfaceOutputProcessor- Parameters:
xmlSecEvent- The next XMLEvent to process- 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:OutputProcessorWill be called when the whole document is processed.- Specified by:
doFinalin interfaceOutputProcessor- 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
-