ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/XMLPacketMaker.java
(Generate patch)

Comparing projects/cms/source/util/uk/org/iscream/cms/util/XMLPacketMaker.java (file contents):
Revision 1.5 by ajm, Thu Nov 30 02:38:17 2000 UTC vs.
Revision 1.9 by tdb, Sun Jan 28 05:47:05 2001 UTC

# Line 10 | Line 10 | import javax.xml.parsers.SAXParserFactory;
10   import javax.xml.parsers.ParserConfigurationException;
11   import javax.xml.parsers.SAXParser;
12  
13 import uk.ac.ukc.iscream.core.*;
14
13   /**
14   * XMLPacketMaker - Creates an XMLPacket object.
15   *
# Line 31 | Line 29 | public class XMLPacketMaker extends HandlerBase {
29  
30   //---CONSTRUCTORS---
31  
32 <    // Constructor for accepting XML input.
32 >    /**
33 >     * Constructor for accepting XML input.
34 >     *
35 >     * @param xml A String of XML to process.
36 >     */
37      public XMLPacketMaker (String xml) {
38          _xml = xml;
39      }
40  
41   //---PUBLIC METHODS---
42  
43 +    /**
44 +     * Method to create an XML packet from the data this
45 +     * class was constructed with.
46 +     *
47 +     * @return an XMLPacket representing the XML String given
48 +     */
49      public XMLPacket createXMLPacket() {
50  
51          // Create the XMLPacket to store values in.
# Line 54 | Line 62 | public class XMLPacketMaker extends HandlerBase {
62  
63          }
64          catch (Exception e) {
57            _logger.write(this.toString(), Logger.WARNING, "An invalid XML UDP packet has been detected: "+packet.printAll());
65              return null;
66          }
67          
# Line 65 | Line 72 | public class XMLPacketMaker extends HandlerBase {
72       * Overrides the {@link java.lang.Object#toString() Object.toString()}
73       * method to provide clean logging (every class should have this).
74       *
75 +     * This uses the uk.ac.ukc.iscream.util.NameFormat class
76 +     * to format the toString()
77 +     *
78       * @return the name of this class and its CVS revision
79       */
80      public String toString() {
81 <        return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
81 >        return FormatName.getName(
82 >            _name,
83 >            getClass().getName(),
84 >            REVISION);
85      }
86  
87   //---PRIVATE METHODS---
# Line 77 | Line 90 | public class XMLPacketMaker extends HandlerBase {
90  
91   //---ATTRIBUTES---
92  
93 +    /**
94 +     * Holds the xml
95 +     */
96      String _xml;
97 <    Logger _logger = ReferenceManager.getInstance().getLogger();
97 >    
98 >    /**
99 >     * This is the friendly identifier of the
100 >     * component this class is running in.
101 >     * eg, a Filter may be called "filter1",
102 >     * If this class does not have an owning
103 >     * component,  a name from the configuration
104 >     * can be placed here.  This name could also
105 >     * be changed to null for utility classes.
106 >     */
107 >    private String _name = null;
108  
109   //---STATIC ATTRIBUTES---
110  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines