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.Action
action
private java.util.Set<java.lang.Object>
afterProcessors
private java.util.Set<java.lang.Object>
beforeProcessors
private XMLSecurityConstants.Phase
phase
protected XMLSecurityProperties
securityProperties
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOutputProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAfterProcessor(java.lang.Object processor)
Add this processor after the given processorXMLSecStartElement
addAttributes(XMLSecStartElement xmlSecStartElement, java.util.List<XMLSecAttribute> attributeList)
void
addBeforeProcessor(java.lang.Object processor)
Add this processor before the given processorXMLSecAttribute
createAttribute(javax.xml.namespace.QName attribute, java.lang.String attributeValue)
XMLSecCharacters
createCharacters(char[] text)
XMLSecCharacters
createCharacters(java.lang.String characters)
void
createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text)
void
createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, java.lang.String characters)
XMLSecEndElement
createEndElement(javax.xml.namespace.QName element)
void
createEndElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element)
XMLSecNamespace
createNamespace(java.lang.String prefix, java.lang.String uri)
XMLSecStartElement
createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, boolean outputLocalNs, java.util.List<XMLSecAttribute> attributes)
void
createStartElementAndOutputAsEvent(OutputProcessorChain outputProcessorChain, javax.xml.namespace.QName element, java.util.List<XMLSecNamespace> namespaces, java.util.List<XMLSecAttribute> attributes)
void
doFinal(OutputProcessorChain outputProcessorChain)
Will be called when the whole document is processed.XMLSecurityConstants.Action
getAction()
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.Phase
getPhase()
The Phase in which this OutputProcessor should be appliedXMLSecurityProperties
getSecurityProperties()
void
init(OutputProcessorChain outputProcessorChain)
Method will be called after setting the propertiesprotected void
outputAsEvent(OutputProcessorChain outputProcessorChain, XMLSecEvent xmlSecEvent)
protected void
outputDOMElement(org.w3c.dom.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, java.util.Map<java.lang.Object,SecurePart> secureParts)
protected SecurePart
securePartMatches(XMLSecStartElement xmlSecStartElement, OutputProcessorChain outputProcessorChain, java.lang.String dynamicParts)
void
setAction(XMLSecurityConstants.Action action)
setter for the Action after instantiation of the processorvoid
setPhase(XMLSecurityConstants.Phase phase)
void
setXMLSecurityProperties(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:OutputProcessor
setter for the XMLSecurityProperties after instantiation of the processor- Specified by:
setXMLSecurityProperties
in interfaceOutputProcessor
-
setAction
public void setAction(XMLSecurityConstants.Action action)
Description copied from interface:OutputProcessor
setter for the Action after instantiation of the processor- Specified by:
setAction
in interfaceOutputProcessor
-
init
public void init(OutputProcessorChain outputProcessorChain) throws XMLSecurityException
Description copied from interface:OutputProcessor
Method will be called after setting the properties- Specified by:
init
in interfaceOutputProcessor
- Throws:
XMLSecurityException
-
getPhase
public XMLSecurityConstants.Phase getPhase()
Description copied from interface:OutputProcessor
The Phase in which this OutputProcessor should be applied- Specified by:
getPhase
in interfaceOutputProcessor
- Returns:
- The Phase
-
setPhase
public void setPhase(XMLSecurityConstants.Phase phase)
-
addBeforeProcessor
public void addBeforeProcessor(java.lang.Object processor)
Description copied from interface:OutputProcessor
Add this processor before the given processor- Specified by:
addBeforeProcessor
in interfaceOutputProcessor
-
getBeforeProcessors
public java.util.Set<java.lang.Object> 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
public void addAfterProcessor(java.lang.Object processor)
Description copied from interface:OutputProcessor
Add this processor after the given processor- Specified by:
addAfterProcessor
in interfaceOutputProcessor
-
getAfterProcessors
public java.util.Set<java.lang.Object> 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
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.XMLStreamException
XMLSecurityException
-
processNextEvent
public void processNextEvent(XMLSecEvent xmlSecEvent, OutputProcessorChain outputProcessorChain) throws javax.xml.stream.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 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:OutputProcessor
Will be called when the whole document is processed.- Specified by:
doFinal
in 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.XMLStreamException
XMLSecurityException
-
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.XMLStreamException
XMLSecurityException
-
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.XMLStreamException
XMLSecurityException
-
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, java.lang.String characters) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamException
XMLSecurityException
-
createCharactersAndOutputAsEvent
public void createCharactersAndOutputAsEvent(OutputProcessorChain outputProcessorChain, char[] text) throws javax.xml.stream.XMLStreamException, XMLSecurityException
- Throws:
javax.xml.stream.XMLStreamException
XMLSecurityException
-
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.XMLStreamException
XMLSecurityException
-
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.XMLStreamException
XMLSecurityException
-
-