|
From: <rga...@us...> - 2002-10-18 17:38:02
|
Update of /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring
In directory usw-pr-cvs1:/tmp/cvs-serv11435
Modified Files:
Event.java
Log Message:
Removed checkstyle errors
Index: Event.java
===================================================================
RCS file: /cvsroot/csms/csms-core/src/java/org/fanfoot/scoring/Event.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Event.java 18 Oct 2002 14:56:45 -0000 1.1
--- Event.java 18 Oct 2002 17:37:59 -0000 1.2
***************
*** 43,47 ****
import org.w3c.dom.Text;
import java.util.logging.Logger;
- import java.util.logging.Level;
/**
--- 43,46 ----
***************
*** 50,54 ****
*/
public class Event {
! /** Holds value of property src which indicates where this event record came from. */
private String src = "";
--- 49,54 ----
*/
public class Event {
! /** Holds value of property src which indicates
! * where this event record came from. */
private String src = "";
***************
*** 59,70 ****
Hashtable parts = new Hashtable();
! /** Holds value of property UID. */
! private String UID = "";
final Logger logger = Logger.getLogger("org.fanfoot.scoring");
/** Creates a new instance of Event of the type indicated
* @param strType the type of this event
- * @param strGroupUID a unique identifier for the group of events that
*this event belongs to. From this a unique event identifier will be
*created.
--- 59,70 ----
Hashtable parts = new Hashtable();
! /** Holds value of property uid. */
! private String uid = "";
+ /** Where to write log entries to */
final Logger logger = Logger.getLogger("org.fanfoot.scoring");
/** Creates a new instance of Event of the type indicated
* @param strType the type of this event
*this event belongs to. From this a unique event identifier will be
*created.
***************
*** 128,132 ****
/**
* Get all the parts for this event.
! * @retrun Hashtable containing all the parts, indexed by part name
*/
public Hashtable getParts() {
--- 128,132 ----
/**
* Get all the parts for this event.
! * @return Hashtable containing all the parts, indexed by part name
*/
public Hashtable getParts() {
***************
*** 145,148 ****
--- 145,150 ----
/** Return an XML DOM representation of this event
* @return Document XML DOM representation of this event
+ * @throws ParserConfigurationException if there is a
+ * problem with the XML Parser
*/
public Document toXMLDoc() throws ParserConfigurationException {
***************
*** 152,156 ****
appendXMLTo(doc);
! logger.finest("Root element of document is named " + doc.getDocumentElement().getNodeName());
logger.exiting("org.fanfoot.scoring.Event", "toXMLDoc()");
return doc;
--- 154,159 ----
appendXMLTo(doc);
! logger.finest("Root element of document is named "
! + doc.getDocumentElement().getNodeName());
logger.exiting("org.fanfoot.scoring.Event", "toXMLDoc()");
return doc;
***************
*** 168,187 ****
}
! Element elem = doc.createElement("uid");
! Text text = doc.createTextNode(this.getUID());
! elem.appendChild(text);
! root.appendChild(elem);
!
! elem=doc.createElement("type");
! text = doc.createTextNode(this.getType());
! elem.appendChild(text);
! root.appendChild(elem);
!
! elem=doc.createElement("src");
! text = doc.createTextNode(this.getSrc());
! elem.appendChild(text);
! root.appendChild(elem);
!
Enumeration enuPartNames = this.getPartNames();
String strPartName;
String strPartValue;
--- 171,181 ----
}
! root.appendChild(getUIDElement(doc));
! root.appendChild(getTypeElement(doc));
! root.appendChild(getSourceElement(doc));
!
Enumeration enuPartNames = this.getPartNames();
+ Element elem;
+ Text text;
String strPartName;
String strPartValue;
***************
*** 197,200 ****
--- 191,228 ----
}
}
+
+ /** Get the UID XML ELement
+ * @param doc the document this element will be a part of
+ * @return Element representing the UID of this event
+ */
+ protected Element getUIDElement(Document doc) {
+ Element elem = doc.createElement("uid");
+ Text text = doc.createTextNode(this.getUID());
+ elem.appendChild(text);
+ return elem;
+ }
+
+ /** Get the type XML ELement
+ * @param doc the document this element will be a part of
+ * @return Element representing the type of this event
+ */
+ protected Element getTypeElement(Document doc) {
+ Element elem = doc.createElement("type");
+ Text text = doc.createTextNode(this.getType());
+ elem.appendChild(text);
+ return elem;
+ }
+
+ /** Get the source XML ELement
+ * @param doc the document this element will be a part of
+ * @return Element representing the source of this event
+ */
+ protected Element getSourceElement(Document doc) {
+ Element elem = doc.createElement("src");
+ Text text = doc.createTextNode(this.getType());
+ elem.appendChild(text);
+ return elem;
+ }
+
/** Getter for property UID.
***************
*** 203,215 ****
*/
public String getUID() {
! return this.UID;
}
/** Setter for property UID.
! * @param UID New value of property UID.
*
*/
! public void setUID(String UID) {
! this.UID = UID;
}
--- 231,243 ----
*/
public String getUID() {
! return this.uid;
}
/** Setter for property UID.
! * @param uid New value of property UID.
*
*/
! public void setUID(String uid) {
! this.uid = uid;
}
|