Module org.apache.santuario.xmlsec
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
public abstract class AbstractOutputProcessor extends java.lang.Object implements OutputProcessor
An abstract OutputProcessor class for reusabilty
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLSecurityConstants.Actionactionprotected intactionOrderprivate java.util.Set<java.lang.Class<? extends OutputProcessor>>afterProcessorsprivate java.util.Set<java.lang.Class<? extends OutputProcessor>>beforeProcessorsprivate XMLSecurityConstants.Phasephaseprotected XMLSecurityPropertiessecurityProperties
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOutputProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAfterProcessor(java.lang.Class<? extends OutputProcessor> processor)Add this processor after the given processorXMLSecStartElementaddAttributes(XMLSecStartElement xmlSecStartElement, java.util.List<XMLSecAttribute> attributeList)voidaddBeforeProcessor(java.lang.Class<? extends OutputProcessor> processor)Add this processor before the given processorXMLSecAttributecreateAttribute(javax.xml.namespace.QName attribute, java.lang.String attributeValue)XMLSecCharacterscreateCharacters(char[] text)XMLSecCharacterscreateCharacters(java.lang.String characters)voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text)voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, java.lang.String characters)XMLSecEndElementcreateEndElement(javax.xml.namespace.QName element)voidcreateEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element)XMLSecNamespacecreateNamespace(java.lang.String prefix, java.lang.String uri)XMLSecStartElementcreateStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, boolean outputLocalNs, java.util.List<XMLSecAttribute> attributes)voidcreateStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, java.util.List<XMLSecNamespace> namespaces, java.util.List<XMLSecAttribute> attributes)voiddoFinal(OutputProcessorChain outputProcessorChain)Will be called when the whole document is processed.XMLSecurityConstants.ActiongetAction()intgetActionOrder()java.util.Set<java.lang.Class<? extends OutputProcessor>>getAfterProcessors()This OutputProcessor will be added after the processors in this setjava.util.Set<java.lang.Class<? extends OutputProcessor>>getBeforeProcessors()This OutputProcessor will be added before the processors in this setXMLSecurityConstants.PhasegetPhase()The Phase in which this OutputProcessor should be appliedXMLSecurityPropertiesgetSecurityProperties()voidinit(OutputProcessorChain outputProcessorChain)Method will be called after setting the propertiesprotected voidoutputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent)protected voidoutputDOMElement(org.w3c.dom.Element element, OutputProcessorChain outputProcessorChain)protected SecurePartsecurePartMatches(XMLSecStartElement xmlSecStartElement, java.util.Map<java.lang.Object,SecurePart> secureParts)protected SecurePartsecurePartMatches(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, java.lang.String dynamicParts)voidsetAction(XMLSecurityConstants.Action action, int actionOrder)setter for the Action after instantiation of the processorvoidsetPhase(XMLSecurityConstants.Phase phase)voidsetXMLSecurityProperties(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
-
Methods inherited from interface org.apache.xml.security.stax.ext.OutputProcessor
processEvent
-
-
-
-
Field Detail
-
securityProperties
protected XMLSecurityProperties securityProperties
-
action
protected XMLSecurityConstants.Action action
-
actionOrder
protected int actionOrder
-
phase
private XMLSecurityConstants.Phase phase
-
beforeProcessors
private java.util.Set<java.lang.Class<? extends OutputProcessor>> beforeProcessors
-
afterProcessors
private java.util.Set<java.lang.Class<? extends OutputProcessor>> afterProcessors
-
-
Constructor Detail
-
AbstractOutputProcessor
protected AbstractOutputProcessor() throws XMLSecurityException- Throws:
XMLSecurityException
-
-
Method Detail
-
setXMLSecurityProperties
public void setXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)
Description copied from interface:OutputProcessorsetter for the XMLSecurityProperties after instantiation of the processor- Specified by:
setXMLSecurityPropertiesin interfaceOutputProcessor
-
setAction
public void setAction(XMLSecurityConstants.Action action, int actionOrder)
Description copied from interface:OutputProcessorsetter for the Action after instantiation of the processor- Specified by:
setActionin interfaceOutputProcessor- Parameters:
action- The action this processor belongs to, possiblynullfor no particular action.actionOrder- The action order of this processor, possibly-1for no particular action order.
-
init
public void init(OutputProcessorChain outputProcessorChain) throws XMLSecurityException
Description copied from interface:OutputProcessorMethod will be called after setting the properties- Specified by:
initin interfaceOutputProcessor- Throws:
XMLSecurityException
-
getPhase
public XMLSecurityConstants.Phase getPhase()
Description copied from interface:OutputProcessorThe Phase in which this OutputProcessor should be applied- Specified by:
getPhasein interfaceOutputProcessor- Returns:
- The Phase
-
setPhase
public void setPhase(XMLSecurityConstants.Phase phase)
-
addBeforeProcessor
public void addBeforeProcessor(java.lang.Class<? extends OutputProcessor> processor)
Description copied from interface:OutputProcessorAdd this processor before the given processor- Specified by:
addBeforeProcessorin interfaceOutputProcessor
-
getBeforeProcessors
public java.util.Set<java.lang.Class<? extends OutputProcessor>> 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
public void addAfterProcessor(java.lang.Class<? extends OutputProcessor> processor)
Description copied from interface:OutputProcessorAdd this processor after the given processor- Specified by:
addAfterProcessorin interfaceOutputProcessor
-
getAfterProcessors
public java.util.Set<java.lang.Class<? extends OutputProcessor>> 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
public XMLSecurityProperties getSecurityProperties()
-
getAction
public XMLSecurityConstants.Action getAction()
- Specified by:
getActionin interfaceOutputProcessor- Returns:
- The action to which this processor belongs, if any, else
null.
-
getActionOrder
public int getActionOrder()
- Specified by:
getActionOrderin interfaceOutputProcessor- Returns:
- The action order of this processor, or
-1.
-
doFinal
public void doFinal(OutputProcessorChain outputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException
Description copied from interface:OutputProcessorWill be called when the whole document is processed.- Specified by:
doFinalin interfaceOutputProcessor- Throws:
javax.xml.stream.XMLStreamException- thrown when a streaming error occursXMLSecurityException- thrown when a Security failure occurs
-
addAttributes
public XMLSecStartElement addAttributes(XMLSecStartElement xmlSecStartElement, java.util.List<XMLSecAttribute> attributeList) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createStartElementAndOutputAsEvent
public void createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, java.util.List<XMLSecNamespace> namespaces, java.util.List<XMLSecAttribute> attributes) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
createStartElementAndOutputAsEvent
public XMLSecStartElement createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, boolean outputLocalNs, java.util.List<XMLSecAttribute> attributes) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
createEndElement
public XMLSecEndElement createEndElement(javax.xml.namespace.QName element)
-
createEndElementAndOutputAsEvent
public void createEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, java.lang.String characters) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
createCharacters
public XMLSecCharacters createCharacters(java.lang.String characters)
-
createCharacters
public XMLSecCharacters createCharacters(char[] text)
-
createAttribute
public XMLSecAttribute createAttribute(javax.xml.namespace.QName attribute, java.lang.String attributeValue)
-
createNamespace
public XMLSecNamespace createNamespace(java.lang.String prefix, java.lang.String uri)
-
outputAsEvent
protected void outputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
securePartMatches
protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, java.lang.String dynamicParts)
-
securePartMatches
protected SecurePart securePartMatches(XMLSecStartElement xmlSecStartElement, java.util.Map<java.lang.Object,SecurePart> secureParts)
-
outputDOMElement
protected void outputDOMElement(org.w3c.dom.Element element, OutputProcessorChain outputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
-