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.Actionactionprivate java.util.Set<java.lang.Object>afterProcessorsprivate java.util.Set<java.lang.Object>beforeProcessorsprivate XMLSecurityConstants.Phasephaseprotected XMLSecurityPropertiessecurityProperties
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOutputProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAfterProcessor(java.lang.Object processor)Add this processor after the given processorXMLSecStartElementaddAttributes(XMLSecStartElement xmlSecStartElement, java.util.List<XMLSecAttribute> attributeList)voidaddBeforeProcessor(java.lang.Object 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()java.util.Set<java.lang.Object>getAfterProcessors()This OutputProcessor will be added after the processors in this setjava.util.Set<java.lang.Object>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)abstract voidprocessEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)voidprocessNextEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain)Will be called from the framework for every XMLEventprotected 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)setter for the Action after instantiation of the processorvoidsetPhase(XMLSecurityConstants.Phase phase)voidsetXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)setter for the XMLSecurityProperties after instantiation of the processor
-
-
-
Field Detail
-
securityProperties
protected XMLSecurityProperties securityProperties
-
action
protected XMLSecurityConstants.Action action
-
phase
private XMLSecurityConstants.Phase phase
-
beforeProcessors
private java.util.Set<java.lang.Object> beforeProcessors
-
afterProcessors
private java.util.Set<java.lang.Object> 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)
Description copied from interface:OutputProcessorsetter for the Action after instantiation of the processor- Specified by:
setActionin interfaceOutputProcessor
-
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.Object processor)
Description copied from interface:OutputProcessorAdd this processor before the given processor- Specified by:
addBeforeProcessorin interfaceOutputProcessor
-
getBeforeProcessors
public java.util.Set<java.lang.Object> 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.Object processor)
Description copied from interface:OutputProcessorAdd this processor after the given processor- Specified by:
addAfterProcessorin interfaceOutputProcessor
-
getAfterProcessors
public java.util.Set<java.lang.Object> 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()
-
processEvent
public abstract void processEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamExceptionXMLSecurityException
-
processNextEvent
public void processNextEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException- thrown when a streaming error occursXMLSecurityException- thrown when a Security failure occurs
-
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
-
-