Package org.apache.axiom.om.util
Class DigestGenerator
java.lang.Object
org.apache.axiom.om.util.DigestGenerator
Helper class to provide the functionality of the digest value generation. This is an
implementation of the DOMHASH algorithm on OM.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
compareOMAttribute
(OMAttribute attribute, OMAttribute comparingAttribute, String digestAlgorithm) Compares two OMAttributes for the XML equalityboolean
compareOMDocument
(OMDocument document, OMDocument comparingDocument, String digestAlgorithm) Compares two OMDocuments for the XML equalityboolean
compareOMNode
(OMNode node, OMNode comparingNode, String digestAlgorithm) Compares two OMNodes for the XML equalitygetAttributesWithoutNS
(OMElement element) Gets the collection of attributes which are none namespace declarations for an OMElementbyte[]
getDigest
(OMAttribute attribute, String digestAlgorithm) This method is an overloaded method for the digest generation for OMAttributebyte[]
getDigest
(OMDocument document, String digestAlgorithm) This method is an overloaded method for the digest generation for OMDocumentbyte[]
This method is an overloaded method for the digest generation for OMElementbyte[]
This method is an overloaded method for the digest generation for OMNodebyte[]
getDigest
(OMProcessingInstruction pi, String digestAlgorithm) This method is an overloaded method for the digest generation for OMProcessingInstructionbyte[]
This method is an overloaded method for the digest generation for OMTextgetExpandedName
(OMAttribute attribute) This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for OMAttributegetExpandedName
(OMElement element) This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for OMElementgetStringRepresentation
(byte[] array) Gets the String representation of the byte arraygetValidElements
(OMDocument document) Gets the valid element collection of an OMDocument.
-
Field Details
-
md5DigestAlgorithm
String representing the MD5 digest algorithm- See Also:
-
shaDigestAlgorithm
String representing the SHA digest algorithm- See Also:
-
sha1DigestAlgorithm
String representing the SHA1 digest algorithm- See Also:
-
-
Constructor Details
-
DigestGenerator
public DigestGenerator()
-
-
Method Details
-
getDigest
This method is an overloaded method for the digest generation for OMDocument- Parameters:
document
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest
- Throws:
OMException
-
getDigest
This method is an overloaded method for the digest generation for OMNode- Parameters:
node
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest value
-
getDigest
This method is an overloaded method for the digest generation for OMElement- Parameters:
element
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest value
- Throws:
OMException
-
getDigest
This method is an overloaded method for the digest generation for OMProcessingInstruction- Parameters:
pi
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest value
- Throws:
OMException
-
getDigest
This method is an overloaded method for the digest generation for OMAttribute- Parameters:
attribute
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest value
- Throws:
OMException
-
getDigest
This method is an overloaded method for the digest generation for OMText- Parameters:
text
-digestAlgorithm
-- Returns:
- Returns a byte array representing the calculated digest value
- Throws:
OMException
-
getExpandedName
This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for OMElement- Parameters:
element
-- Returns:
- Returns the expanded name of OMElement
-
getExpandedName
This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for OMAttribute- Parameters:
attribute
-- Returns:
- Returns the expanded name of the OMAttribute
-
getAttributesWithoutNS
Gets the collection of attributes which are none namespace declarations for an OMElement- Parameters:
element
-- Returns:
- Returns the collection of attributes which are none namespace declarations
-
getValidElements
Gets the valid element collection of an OMDocument. OMElement and OMProcessingInstruction only- Parameters:
document
-- Returns:
- Returns a collection of OMProcessingInstructions and OMElements
-
getStringRepresentation
Gets the String representation of the byte array- Parameters:
array
-- Returns:
- Returns the String of the byte
-
compareOMNode
Compares two OMNodes for the XML equality- Parameters:
node
-comparingNode
-digestAlgorithm
-- Returns:
- Returns true if the OMNode XML contents are equal
-
compareOMDocument
public boolean compareOMDocument(OMDocument document, OMDocument comparingDocument, String digestAlgorithm) Compares two OMDocuments for the XML equality- Parameters:
document
-comparingDocument
-digestAlgorithm
-- Returns:
- Returns true if the OMDocument XML content are equal
-
compareOMAttribute
public boolean compareOMAttribute(OMAttribute attribute, OMAttribute comparingAttribute, String digestAlgorithm) Compares two OMAttributes for the XML equality- Parameters:
attribute
-comparingAttribute
-digestAlgorithm
-- Returns:
- Returns true if the OMDocument XML content are equal
-