aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/Node.java
diff options
context:
space:
mode:
authorSaad Mohammad <[email protected]>2011-07-19 12:14:35 -0400
committerSaad Mohammad <[email protected]>2011-07-19 12:14:35 -0400
commitc5d960db80e654d2203401414fd96b709f704648 (patch)
treee39002866d8d10c5a07c2a85a269849089957dd3 /netx/net/sourceforge/jnlp/Node.java
parent6f78ede87c47e097c6aee5c5ebaaf7b0dc5f7544 (diff)
Added algorithm that compares signed JNLP application/template file with launching JNLP file (with test case and its resources)
Diffstat (limited to 'netx/net/sourceforge/jnlp/Node.java')
-rw-r--r--netx/net/sourceforge/jnlp/Node.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/Node.java b/netx/net/sourceforge/jnlp/Node.java
index 3ab00ca..2c754d7 100644
--- a/netx/net/sourceforge/jnlp/Node.java
+++ b/netx/net/sourceforge/jnlp/Node.java
@@ -19,6 +19,7 @@ class Node {
private XMLElement xml;
private Node next;
private Node children[];
+ private List <String> attributeNames= null;
Node(XMLElement xml) {
this.xml = xml;
@@ -60,6 +61,21 @@ class Node {
return children;
}
+
+ /**
+ * To retrieve all attribute names
+ * @return all attribute names of the Node in ArrayList<String>
+ */
+ List<String> getAttributeNames() {
+ if (attributeNames == null) {
+ attributeNames= new ArrayList<String>();
+
+ for (Enumeration e = xml.enumerateAttributeNames(); e.hasMoreElements();)
+ attributeNames.add(new String((String) e.nextElement()));
+ }
+
+ return attributeNames;
+ }
String getAttribute(String name) {
return (String) xml.getAttribute(name);
@@ -86,6 +102,7 @@ class Node {
private ParsedXML tinyNode;
private Node next;
private Node children[];
+ private String attributeNames[];
Node(ParsedXML tinyNode) {
this.tinyNode = tinyNode;
@@ -127,6 +144,19 @@ class Node {
return children;
}
+
+ String[] getAttributeNames() {
+ if (attributeNames == null) {
+ List<String> list = new ArrayList<String>();
+
+ for (Enumeration e = xml.enumerateAttributeNames(); e.hasMoreElements();)
+ list.add(new String((String) e.nextElement()));
+
+ attributeNames = list.toArray(new String[list.size()]);
+
+ }
+ return attributeNames;
+ }
String getAttribute(String name) {
return tinyNode.getAttribute(name);