Class CanonicalizerBase
- java.lang.Object
-
- org.apache.xml.security.stax.impl.transformer.TransformIdentity
-
- org.apache.xml.security.stax.impl.transformer.canonicalizer.CanonicalizerBase
-
- All Implemented Interfaces:
Transformer
- Direct Known Subclasses:
Canonicalizer11
,Canonicalizer20010315
,Canonicalizer20010315_Excl
public abstract class CanonicalizerBase extends TransformIdentity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CanonicalizerBase.C14NStack<E>
private static class
CanonicalizerBase.DocumentLevel
-
Field Summary
Fields Modifier and Type Field Description (package private) static byte[]
__X9_
(package private) static byte[]
__XA_
(package private) static byte[]
__XD_
(package private) static byte[]
_AMP_
(package private) static byte[]
_BEGIN_COMM
(package private) static byte[]
_BEGIN_PI
(package private) static byte[]
_END_COMM
(package private) static byte[]
_END_PI
(package private) static byte[]
_END_TAG
(package private) static byte[]
_GT_
(package private) static byte[]
_LT_
(package private) static byte[]
_QUOT_
private static java.util.Map<java.lang.String,byte[]>
CACHE
private CanonicalizerBase.DocumentLevel
currentDocumentLevel
protected static char
DOUBLEPOINT
(package private) static byte[]
EQUAL_STRING
protected boolean
firstCall
private boolean
includeComments
(package private) static byte[]
NEWLINE
private CanonicalizerBase.C14NStack<XMLSecEvent>
outputStack
protected static java.lang.String
XML
protected static java.lang.String
XMLNS
-
Constructor Summary
Constructors Constructor Description CanonicalizerBase(boolean includeComments)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doFinal()
protected java.util.List<XMLSecAttribute>
getCurrentUtilizedAttributes(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
protected java.util.List<XMLSecNamespace>
getCurrentUtilizedNamespaces(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
protected java.util.List<XMLSecAttribute>
getInitialUtilizedAttributes(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
protected java.util.List<XMLSecNamespace>
getInitialUtilizedNamespaces(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
XMLSecurityConstants.TransformMethod
getPreferredTransformMethod(XMLSecurityConstants.TransformMethod forInput)
private boolean
namespaceIsAbsolute(java.lang.String namespaceValue)
protected static void
outputAttrToWriter(java.lang.String prefix, java.lang.String name, java.lang.String value, java.io.OutputStream writer, java.util.Map<java.lang.String,byte[]> CACHE)
protected static void
outputCommentToWriter(XMLSecComment currentComment, java.io.OutputStream writer, CanonicalizerBase.DocumentLevel position)
Method outputCommentToWriterprotected static void
outputPItoWriter(XMLSecProcessingInstruction currentPI, java.io.OutputStream writer, CanonicalizerBase.DocumentLevel position)
Outputs a PI to the internal Writer.protected static void
outputTextToWriter(char[] text, java.io.OutputStream writer)
protected static void
outputTextToWriter(java.lang.String text, java.io.OutputStream writer)
Outputs a Text of CDATA section to the internal Writer.void
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
void
setTransformer(Transformer transformer)
void
transform(java.io.InputStream inputStream)
void
transform(XMLSecEvent xmlSecEvent)
-
Methods inherited from class org.apache.xml.security.stax.impl.transformer.TransformIdentity
getOutputStream, getTransformer, getXmlEventWriterForOutputStream, getXmlInputFactory, getXmlOutputFactory, setOutputStream
-
-
-
-
Field Detail
-
_END_PI
static final byte[] _END_PI
-
_BEGIN_PI
static final byte[] _BEGIN_PI
-
_END_COMM
static final byte[] _END_COMM
-
_BEGIN_COMM
static final byte[] _BEGIN_COMM
-
__XA_
static final byte[] __XA_
-
__X9_
static final byte[] __X9_
-
_QUOT_
static final byte[] _QUOT_
-
__XD_
static final byte[] __XD_
-
_GT_
static final byte[] _GT_
-
_LT_
static final byte[] _LT_
-
_END_TAG
static final byte[] _END_TAG
-
_AMP_
static final byte[] _AMP_
-
EQUAL_STRING
static final byte[] EQUAL_STRING
-
NEWLINE
static final byte[] NEWLINE
-
XML
protected static final java.lang.String XML
- See Also:
- Constant Field Values
-
XMLNS
protected static final java.lang.String XMLNS
- See Also:
- Constant Field Values
-
DOUBLEPOINT
protected static final char DOUBLEPOINT
- See Also:
- Constant Field Values
-
CACHE
private static final java.util.Map<java.lang.String,byte[]> CACHE
-
outputStack
private final CanonicalizerBase.C14NStack<XMLSecEvent> outputStack
-
includeComments
private boolean includeComments
-
currentDocumentLevel
private CanonicalizerBase.DocumentLevel currentDocumentLevel
-
firstCall
protected boolean firstCall
-
-
Method Detail
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties) throws XMLSecurityException
- Specified by:
setProperties
in interfaceTransformer
- Overrides:
setProperties
in classTransformIdentity
- Throws:
XMLSecurityException
-
setTransformer
public void setTransformer(Transformer transformer) throws XMLSecurityException
- Specified by:
setTransformer
in interfaceTransformer
- Overrides:
setTransformer
in classTransformIdentity
- Throws:
XMLSecurityException
-
getCurrentUtilizedNamespaces
protected java.util.List<XMLSecNamespace> getCurrentUtilizedNamespaces(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
-
getCurrentUtilizedAttributes
protected java.util.List<XMLSecAttribute> getCurrentUtilizedAttributes(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
-
getInitialUtilizedNamespaces
protected java.util.List<XMLSecNamespace> getInitialUtilizedNamespaces(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
-
getInitialUtilizedAttributes
protected java.util.List<XMLSecAttribute> getInitialUtilizedAttributes(XMLSecStartElement xmlSecStartElement, CanonicalizerBase.C14NStack<XMLSecEvent> outputStack)
-
getPreferredTransformMethod
public XMLSecurityConstants.TransformMethod getPreferredTransformMethod(XMLSecurityConstants.TransformMethod forInput)
- Specified by:
getPreferredTransformMethod
in interfaceTransformer
- Overrides:
getPreferredTransformMethod
in classTransformIdentity
-
transform
public void transform(XMLSecEvent xmlSecEvent) throws javax.xml.stream.XMLStreamException
- Specified by:
transform
in interfaceTransformer
- Overrides:
transform
in classTransformIdentity
- Throws:
javax.xml.stream.XMLStreamException
-
transform
public void transform(java.io.InputStream inputStream) throws javax.xml.stream.XMLStreamException
- Specified by:
transform
in interfaceTransformer
- Overrides:
transform
in classTransformIdentity
- Throws:
javax.xml.stream.XMLStreamException
-
doFinal
public void doFinal() throws javax.xml.stream.XMLStreamException
- Specified by:
doFinal
in interfaceTransformer
- Overrides:
doFinal
in classTransformIdentity
- Throws:
javax.xml.stream.XMLStreamException
-
outputAttrToWriter
protected static void outputAttrToWriter(java.lang.String prefix, java.lang.String name, java.lang.String value, java.io.OutputStream writer, java.util.Map<java.lang.String,byte[]> CACHE) throws java.io.IOException
- Throws:
java.io.IOException
-
outputTextToWriter
protected static void outputTextToWriter(java.lang.String text, java.io.OutputStream writer) throws java.io.IOException
Outputs a Text of CDATA section to the internal Writer.- Parameters:
text
-writer
- writer where to write the things- Throws:
java.io.IOException
-
outputTextToWriter
protected static void outputTextToWriter(char[] text, java.io.OutputStream writer) throws java.io.IOException
- Throws:
java.io.IOException
-
outputPItoWriter
protected static void outputPItoWriter(XMLSecProcessingInstruction currentPI, java.io.OutputStream writer, CanonicalizerBase.DocumentLevel position) throws java.io.IOException
Outputs a PI to the internal Writer.- Parameters:
currentPI
-writer
- where to write the things- Throws:
java.io.IOException
-
outputCommentToWriter
protected static void outputCommentToWriter(XMLSecComment currentComment, java.io.OutputStream writer, CanonicalizerBase.DocumentLevel position) throws java.io.IOException
Method outputCommentToWriter- Parameters:
currentComment
-writer
- writer where to write the things- Throws:
java.io.IOException
-
namespaceIsAbsolute
private boolean namespaceIsAbsolute(java.lang.String namespaceValue)
-
-