summaryrefslogtreecommitdiffstats
path: root/Master/Agile Software Development/TestApp/src/Parser/CssParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Agile Software Development/TestApp/src/Parser/CssParser.java')
-rw-r--r--Master/Agile Software Development/TestApp/src/Parser/CssParser.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/Agile Software Development/TestApp/src/Parser/CssParser.java b/Master/Agile Software Development/TestApp/src/Parser/CssParser.java
new file mode 100644
index 0000000..9b11a1e
--- /dev/null
+++ b/Master/Agile Software Development/TestApp/src/Parser/CssParser.java
@@ -0,0 +1,41 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package Parser;
+
+import testapp.data.ExternalCssItem;
+import testapp.data.Item;
+import java.util.logging.*;
+
+/**
+ *
+ * @author robb
+ */
+public class CssParser {
+ private Item rootNode;
+ private String srcUrl;
+
+ public CssParser(Item rootNode) {
+ this.rootNode=rootNode;
+ }
+
+ public ExternalCssItem parse(String url) {
+ // Todo: http client to recieve url and put contents into code
+ String code=new String();
+ return parseCode(code);
+ }
+
+ public ExternalCssItem parseCode(String code) {
+ ExternalCssItem externalCssItem=new ExternalCssItem(srcUrl,rootNode);
+ rootNode.add(externalCssItem);
+
+ // check for @import and mark Suspicious
+ if(code.contains("@import")) {
+ externalCssItem.setSuspiciousCode();
+ }
+
+ return externalCssItem;
+ }
+}