- From: Florent Batard via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 22 Jul 2008 12:21:26 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree
In directory hutz:/tmp/cvs-serv31592/org/w3c/unicorn/tasklisttree
Modified Files:
TLTIf.java TLTNode.java EnumCondType.java TLTExec.java
TLTCond.java
Log Message:
Tree to represent the level of execution
Index: TLTNode.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/TLTNode.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TLTNode.java 11 Jul 2008 12:26:07 -0000 1.1
+++ TLTNode.java 22 Jul 2008 12:21:24 -0000 1.2
@@ -72,7 +72,7 @@
* @param tltIf The "if" to add
*/
public void addIf(TLTIf tltIf) {
- TLTNode.logger.trace("addIf : " + tltIf.getId());
+ TLTNode.logger.trace("addIf : ");
ifList.add(tltIf);
}
@@ -103,4 +103,12 @@
return level;
}
+ public String toString(){
+ String res=new String("TLTNode ");
+ for(TLTIf conds : this.ifList)
+ res+=conds.toString();
+ for(TLTExec exec : this.executionList)
+ res+=exec.toString();
+ return res;
+ }
}
Index: TLTExec.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/TLTExec.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TLTExec.java 11 Jul 2008 12:26:07 -0000 1.1
+++ TLTExec.java 22 Jul 2008 12:21:24 -0000 1.2
@@ -3,8 +3,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.w3.unicorn.tasklist.impl.ParamTypeImpl;
-import org.w3.unicorn.tasklist.impl.ValueTypeImpl;
+import org.w3.unicorn.tasklist.ParamType;
+import org.w3.unicorn.tasklist.ValueType;
/**
* Class made to manage the XML type execType of the tasklist.
@@ -17,8 +17,9 @@
public class TLTExec {
private String id;
- private ValueTypeImpl value;
- private ParamTypeImpl param;
+ private String value;
+ private String type;
+ private ParamType param;
private static final Log logger = LogFactory.getLog("org.w3c.unicorn.tasklisttree");
/**
@@ -27,13 +28,15 @@
* @param value The observer to run
* @param param The parameter of the exec
*/
- public TLTExec(String id, ValueTypeImpl value, ParamTypeImpl param) {
+ public TLTExec(String id, String value,String type, ParamType param) {
TLTExec.logger.trace("Constructor");
TLTExec.logger.trace("Id : " + id);
+ TLTExec.logger.trace("Type : " + type);
TLTExec.logger.trace("Value : " + value);
TLTExec.logger.trace("Param : " + param);
this.id = id;
this.value = value;
+ this.type=type;
this.param = param;
}
@@ -50,16 +53,25 @@
*
* @param value The observer to run
*/
- public void setValue(ValueTypeImpl value) {
+ public void setValue(String value) {
TLTExec.logger.trace("setValue : " + value);
this.value = value;
}
/**
*
+ * @param value The observer to run
+ */
+ public void setType(String type) {
+ TLTExec.logger.trace("setType : " + type);
+ this.type = type;
+ }
+
+ /**
+ *
* @param param The parameter of the exec
*/
- public void setParam(ParamTypeImpl param) {
+ public void setParam(ParamType param) {
TLTExec.logger.trace("setParam : " + param);
this.param = param;
}
@@ -75,19 +87,33 @@
/**
*
- * @return The observer to run
+ * @return The observer or subtask to run
*/
- public ValueTypeImpl getValue() {
+ public String getValue() {
TLTExec.logger.trace("getValue");
return value;
}
+
+ /**
+ *
+ * @return The type of execution Observer or subtask
+ */
+ public String getType() {
+ TLTExec.logger.trace("getType");
+ return type;
+ }
+
/**
*
* @return The parameter of the exec
*/
- public ParamTypeImpl getParam() {
+ public ParamType getParam() {
TLTExec.logger.trace("getParam");
return param;
}
+
+ public String toString(){
+ return new String("TLTExec "+this.id+"value "+this.value+" type "+this.getType()+" param "+this.param);
+ }
}
Index: EnumCondType.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/EnumCondType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- EnumCondType.java 11 Jul 2008 12:26:07 -0000 1.1
+++ EnumCondType.java 22 Jul 2008 12:21:24 -0000 1.2
@@ -2,7 +2,7 @@
public enum EnumCondType {
- XPATH("uri"), MIMETYPE("mimetype");
+ XPATH("xpath"), MIMETYPE("mimetype");
private final String sValue;
Index: TLTCond.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/TLTCond.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TLTCond.java 11 Jul 2008 12:26:07 -0000 1.1
+++ TLTCond.java 22 Jul 2008 12:21:24 -0000 1.2
@@ -18,6 +18,7 @@
private String observer;
private EnumCondType type;
private boolean result;
+ private String value;
private static final Log logger = LogFactory.getLog("org.w3c.unicorn.tasklisttree");
@@ -27,7 +28,7 @@
* @param observer The name of the observer corresponding to the condition
* @param type The type of the condition
*/
- public TLTCond(String id, String observer, EnumCondType type) {
+ public TLTCond(String id, String observer, EnumCondType type, String value) {
TLTCond.logger.trace("Constructor");
TLTCond.logger.trace("Id : " + id);
TLTCond.logger.trace("Observer : " + observer);
@@ -80,6 +81,27 @@
this.type = type;
}
+
+ /**
+ *
+ * @param type The type of the condition
+ */
+ public void setType(String type){
+ TLTCond.logger.trace("setType : " + type);
+ for(EnumCondType val : EnumCondType.values()){
+ if(val.value().equals(type))this.type=val;
+ }
+ }
+
+ /**
+ *
+ * @param value value of the condition
+ */
+ public void setValue(String value){
+ TLTCond.logger.trace("setValue : " + value);
+ this.value=value;
+ }
+
/**
* @return The id of the condition
*/
@@ -115,6 +137,17 @@
return type;
}
+ /**
+ *
+ * @return The value of the condition
+ */
+ public String getValue(){
+ TLTCond.logger.trace("getValue");
+ return value;
+ }
+ public String toString(){
+ return new String("TLTCond "+this.id+" observer "+this.observer+" value "+this.value);
+ }
}
Index: TLTIf.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/TLTIf.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TLTIf.java 11 Jul 2008 12:26:07 -0000 1.1
+++ TLTIf.java 22 Jul 2008 12:21:24 -0000 1.2
@@ -1,5 +1,7 @@
package org.w3c.unicorn.tasklisttree;
+import java.util.ArrayList;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -13,8 +15,7 @@
*/
public class TLTIf {
- private String id;
- private TLTCond cond;
+ private ArrayList<TLTCond> cond;
private TLTNode ifOk;
private TLTNode ifNotOk;
private static final Log logger = LogFactory.getLog("org.w3c.unicorn.tasklisttree");
@@ -25,8 +26,7 @@
*/
public TLTIf() {
TLTIf.logger.trace("Constructor");
- this.id = "defaultIf";
- this.cond = new TLTCond();
+ this.cond = new ArrayList<TLTCond>();
this.ifOk = new TLTNode();
this.ifNotOk = new TLTNode();
}
@@ -37,11 +37,9 @@
* @param cond The condition to check
* @param ifOK The next node if the condition is ok
*/
- public TLTIf(String id, TLTCond cond, TLTNode ifOk) {
+ public TLTIf(ArrayList<TLTCond> cond, TLTNode ifOk) {
TLTIf.logger.trace("Constructor");
- TLTIf.logger.trace("Id : " + id);
- TLTIf.logger.trace("Cond : " + cond.getId());
- this.id = id;
+ TLTIf.logger.trace("Cond : ");
this.cond = cond;
this.ifOk = ifOk;
this.ifNotOk = new TLTNode();
@@ -54,26 +52,15 @@
* @param ifOk The next node if the condition is ok
* @param ifNotOK The next node if the condition is not ok
*/
- public TLTIf(String id,TLTCond cond, TLTNode ifOk, TLTNode ifNotOK) {
+ public TLTIf(ArrayList<TLTCond> cond, TLTNode ifOk, TLTNode ifNotOK) {
TLTIf.logger.trace("Constructor");
- TLTIf.logger.trace("Id : " + id);
- TLTIf.logger.trace("Cond : " + cond.getId());
- this.id = id;
+ TLTIf.logger.trace("Cond : ");
this.cond = cond;
this.ifOk = ifOk;
this.ifNotOk = ifNotOK;
}
/**
- *
- * @param id
- */
- public void setId(String id) {
- TLTIf.logger.trace("setId : " + id);
- this.id = id;
- }
-
- /**
* Sets the child node corresponding to the "ok" case
* @param ifOk
*/
@@ -95,9 +82,9 @@
* Sets the condition to check.
* @param cond
*/
- public void setCond(TLTCond cond) {
- TLTIf.logger.trace("setCond : " + cond.getId());
- this.cond = cond;
+ public void addCond(TLTCond cond) {
+ TLTIf.logger.trace("addCond : " + cond.getId());
+ this.cond.add(cond);
}
/**
@@ -122,16 +109,16 @@
*
* @return The condition
*/
- public TLTCond getCond() {
+ public ArrayList<TLTCond> getCondArray() {
TLTIf.logger.trace("getCond");
return cond;
}
- public String getId() {
- TLTIf.logger.trace("getId");
- return id;
+ public String toString(){
+ String res=new String("TLTIf ");
+ for(TLTCond conds : this.cond)
+ res+=conds.toString();
+ return res;
}
-
-
}
Received on Tuesday, 22 July 2008 12:22:02 UTC