|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.xml.Transformer | +--com.rsa.certj.xml.XPATHTransformer
This class implements an XPath transformation. The primary purpose of this transform is to ensure that only specifically defined changes to the input XML document are permitted after the signature is affixed. The input required by this transform is an XPath node-set. If the input is an octet stream, this class converts the octet stream to an XPath node-set first. The are two parts to the transformation.
1
.
See Also
Fields inherited from class com.rsa.certj.xml.Transformer |
BASE64_LIST, C14N_LIST, C14N_WITH_COMMENTS_LIST, ENVELOPED_SIGNATURE_LIST, XPATH_LIST |
Constructor Summary |
|
XPATHTransformer()
Generates an |
Method Summary |
|
clone()
Overrides the default |
|
getTransformAlgorithm()
Returns the transform algorithm. |
|
org.w3c.dom.Node |
getXPathExpression()
Returns the XPath expression as a |
getXPathExpressionAsString()
Returns the XPath expression as a |
|
byte[] |
performTransformation(byte[] input,
int inOffset,
int inputLength)
Processes the XPath transformation to the content data. |
org.w3c.dom.NodeList |
performTransformation(org.w3c.dom.NodeList inputNodes)
Processes the transform operation on the content data. |
void |
setXPathExpression(org.w3c.dom.Node xpathExpression)
Sets the XPath evaluation expression with the given |
void |
setXPathExpression(String xpathExpStr)
Sets the XPath evaluation expression with the
given |
static org.w3c.dom.NodeList |
toNodeset(org.w3c.dom.Node node,
org.w3c.dom.Node exceptedNode,
boolean withComments)
Converts the |
Methods inherited from class com.rsa.certj.xml.Transformer |
getAllTransformsInfo, getInstance |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XPATHTransformer()
XPATHTransformer
object by initializing
the transform algorithm to the default one, which is the top one in
Transformer.ENVELOPED_SIGNATURE_LIST
.Method Detail |
public byte[] performTransformation(byte[] input, int inOffset, int inputLength) throws XMLException
byte
array as input data, converts it to an
XPath node-set, process the transformation and
produces a node-set as the result, and converts the resulting
node-set to a byte
array.
Overrides
performTransformation
in class Transformer
Parameters
input | A | ||
inOffset | The starting index of the input data. | ||
inputLength | The size of the input data to process. |
Returns
byte
array containing the transform output.Throws
XMLException
- If an error occurs while performing the
transformation.public org.w3c.dom.NodeList performTransformation(org.w3c.dom.NodeList inputNodes) throws XMLException
Overrides
performTransformation
in class Transformer
Parameters
inputNodes | A |
Returns
NodeList
object containing a node-set that is
the transform output.Throws
XMLException
- If an error occurs while performing the
transformation.public String getTransformAlgorithm()
Overrides
getTransformAlgorithm
in class Transformer
Returns
String
containing the
transform algorithm name.public void setXPathExpression(org.w3c.dom.Node xpathExpression)
Node
value. This node should define namespace
,
which is required by the
org.apache.xpath package.
Parameters
xpathExpression | An expression which is a |
public org.w3c.dom.Node getXPathExpression()
Node
.
Returns
Node
object.public void setXPathExpression(String xpathExpStr)
String
values.
Use this method only when the expression is
not namespace-related; otherwise, use the
setXPathExpression
method that takes a
Node
object.
Parameters
xpathExpStr | A |
public String getXPathExpressionAsString()
String
.
Returns
String
object.public Object clone() throws CloneNotSupportedException
clone
method to get a
deeper clone.
Returns
XPATHTransforme
object,
a copy of this object.Throws
CloneNotSupportedException
- If the cloning operation
is not successful.public static org.w3c.dom.NodeList toNodeset(org.w3c.dom.Node node, org.w3c.dom.Node exceptedNode, boolean withComments) throws XMLException
Node
object to node-set by collecting all of its
descendants.
Internal method, do not use
Parameters
node | A | ||
exceptedNode | The | ||
withComments | A |
Throws
If
- an error occurs during converting the input node
to a node-set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |