nan.model
Class XMLFactory

java.lang.Object
  extended bynan.model.XMLFactory

public class XMLFactory
extends java.lang.Object

A static helper method class for converting from XML to Java objects.

Version:
1.21, 1/4/04
Author:
John David Ratliff

Method Summary
static Attachment getAttachment(org.dom4j.Document document)
          Reconstructs an Attachment from an XML Document.
static License getLicense(org.dom4j.Document document)
          Reconstructs a License from an XML Document.
static Message getMessage(org.dom4j.Document document)
          Reconstructs a Message from an XML Document.
static MessageHeader getMessageHeader(org.dom4j.Document document)
          Recreates a MessageHeader from an XML Document.
static Newsgroup getNewsgroup(org.dom4j.Document document)
          Recreates a Newsgroup from an XML Document.
static NewsgroupList getNewsgroupList(org.dom4j.Document document)
          Recreates a NewsgroupList from an XML Document.
static ServerSettings getServerSettings(org.dom4j.Document document)
          Recreates a ServerSettings object from an XML Document.
static UserSettings getUserSettings(org.dom4j.Document document)
          Recreates a UserSettings object from an XML Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServerSettings

public static ServerSettings getServerSettings(org.dom4j.Document document)
                                        throws XMLParseException
Recreates a ServerSettings object from an XML Document.

Parameters:
document - The XML Document.
Returns:
The ServerSettings object.
Throws:
XMLParseException - if the Document is not in proper form.

getUserSettings

public static UserSettings getUserSettings(org.dom4j.Document document)
                                    throws XMLParseException
Recreates a UserSettings object from an XML Document.

Parameters:
document - The XML Document.
Returns:
The UserSettings object.
Throws:
XMLParseException - if the XML Document is not a UserSettings XML Document.

getNewsgroup

public static Newsgroup getNewsgroup(org.dom4j.Document document)
                              throws XMLParseException
Recreates a Newsgroup from an XML Document.

Parameters:
document - The XML Document.
Returns:
The Newsgroup.
Throws:
XMLParseException - if the XML Document is not a Newsgroup XML Document.

getNewsgroupList

public static NewsgroupList getNewsgroupList(org.dom4j.Document document)
                                      throws XMLParseException
Recreates a NewsgroupList from an XML Document.

Parameters:
document - The XML Document.
Returns:
The NewsgroupList.
Throws:
XMLParseException - if the XML Document is not a NewsgroupList XML Document.

getMessageHeader

public static MessageHeader getMessageHeader(org.dom4j.Document document)
                                      throws XMLParseException
Recreates a MessageHeader from an XML Document.

Parameters:
document - The XML Document.
Returns:
The MessageHeader.
Throws:
XMLParseException - if the XML Document is not a MessageHeader XML Document.

getMessage

public static Message getMessage(org.dom4j.Document document)
                          throws XMLParseException
Reconstructs a Message from an XML Document.

Parameters:
document - The XML Document.
Returns:
The Message.
Throws:
XMLParseException - if the XML Document is not a Message XML Document.

getLicense

public static License getLicense(org.dom4j.Document document)
                          throws XMLParseException
Reconstructs a License from an XML Document.

Parameters:
document - The XML Document.
Returns:
The Message.
Throws:
XMLParseException - if the XML Document is not a License XML Document.

getAttachment

public static Attachment getAttachment(org.dom4j.Document document)
                                throws XMLParseException
Reconstructs an Attachment from an XML Document.

Parameters:
document - The XML Document.
Returns:
The Attachment.
Throws:
XMLParseException - if the XML Document is not an Attachment XML Document.