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
public abstract class AbstractOutputProcessor extends Object implements OutputProcessor
An abstract OutputProcessor class for reusabilty
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLSecurityConstants.Actionactionprotected intactionOrderprotected XMLSecurityPropertiessecurityProperties
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOutputProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAfterProcessor(Class<? extends OutputProcessor> processor)Add this processor after the given processororg.apache.xml.security.stax.ext.stax.XMLSecStartElementaddAttributes(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributeList)voidaddBeforeProcessor(Class<? extends OutputProcessor> processor)Add this processor before the given processororg.apache.xml.security.stax.ext.stax.XMLSecAttributecreateAttribute(QName attribute, String attributeValue)org.apache.xml.security.stax.ext.stax.XMLSecCharacterscreateCharacters(char[] text)org.apache.xml.security.stax.ext.stax.XMLSecCharacterscreateCharacters(String characters)voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text)voidcreateCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, String characters)org.apache.xml.security.stax.ext.stax.XMLSecEndElementcreateEndElement(QName element)voidcreateEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element)org.apache.xml.security.stax.ext.stax.XMLSecNamespacecreateNamespace(String prefix, String uri)org.apache.xml.security.stax.ext.stax.XMLSecStartElementcreateStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, boolean outputLocalNs, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributes)voidcreateStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, List<org.apache.xml.security.stax.ext.stax.XMLSecNamespace> namespaces, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributes)voiddoFinal(OutputProcessorChain outputProcessorChain)Will be called when the whole document is processed.XMLSecurityConstants.ActiongetAction()intgetActionOrder()Set<Class<? extends OutputProcessor>>getAfterProcessors()This OutputProcessor will be added after the processors in this setSet<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, org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)protected voidoutputDOMElement(Element element, OutputProcessorChain outputProcessorChain)protected SecurePartsecurePartMatches(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, Map<Object,SecurePart> secureParts)protected SecurePartsecurePartMatches(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, 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
-
-
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(Class<? extends OutputProcessor> processor)
Description copied from interface:OutputProcessorAdd this processor before the given processor- Specified by:
addBeforeProcessorin interfaceOutputProcessor
-
getBeforeProcessors
public Set<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(Class<? extends OutputProcessor> processor)
Description copied from interface:OutputProcessorAdd this processor after the given processor- Specified by:
addAfterProcessorin interfaceOutputProcessor
-
getAfterProcessors
public Set<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 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 org.apache.xml.security.stax.ext.stax.XMLSecStartElement addAttributes(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributeList) throws XMLStreamException- Throws:
XMLStreamException
-
createStartElementAndOutputAsEvent
public void createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, List<org.apache.xml.security.stax.ext.stax.XMLSecNamespace> namespaces, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributes) throws XMLStreamException, XMLSecurityException
-
createStartElementAndOutputAsEvent
public org.apache.xml.security.stax.ext.stax.XMLSecStartElement createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, QName element, boolean outputLocalNs, List<org.apache.xml.security.stax.ext.stax.XMLSecAttribute> attributes) throws XMLStreamException, XMLSecurityException
-
createEndElement
public org.apache.xml.security.stax.ext.stax.XMLSecEndElement createEndElement(QName element)
-
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
public org.apache.xml.security.stax.ext.stax.XMLSecCharacters createCharacters(String characters)
-
createCharacters
public org.apache.xml.security.stax.ext.stax.XMLSecCharacters createCharacters(char[] text)
-
createAttribute
public org.apache.xml.security.stax.ext.stax.XMLSecAttribute createAttribute(QName attribute, String attributeValue)
-
createNamespace
public org.apache.xml.security.stax.ext.stax.XMLSecNamespace createNamespace(String prefix, String uri)
-
outputAsEvent
protected void outputAsEvent(OutputProcessorChain outputProcessorChain, org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent) throws XMLStreamException, XMLSecurityException
-
securePartMatches
protected SecurePart securePartMatches(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, String dynamicParts)
-
securePartMatches
protected SecurePart securePartMatches(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, Map<Object,SecurePart> secureParts)
-
outputDOMElement
protected void outputDOMElement(Element element, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException
-
-