net.sf.jagzilla.hibernate
Class XmlObjectImpl

java.lang.Object
  extended bynet.sf.jagzilla.hibernate.XmlObjectImpl
All Implemented Interfaces:
XmlObject
Direct Known Subclasses:
Attachment, AttachStatus, AttachStatusDef, Bug, BugActivity, Cc, Component, Dependency, Duplicate, FieldDef, Group, Keyword, KeywordDef, LoginCookie, LongDesc, Milestone, NamedQuery, Product, Profile, ProfileActivity, ShadowLog, Token, Version, Vote, Watch

public abstract class XmlObjectImpl
extends java.lang.Object
implements XmlObject

Author:
mike To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments

Constructor Summary
XmlObjectImpl()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true always, since this base class contains xml helpers, but no data.
 java.lang.String getXmlString()
          returns a String containing the XML representation of the object.
 java.lang.Object loadObjectFromXml(java.io.Reader reader)
           
 void setXmlString(java.lang.String xml)
          set the object data from xml string.
 void toXml(java.io.Writer writer)
          marhsall the object to xml and place it in writer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jagzilla.hibernate.XmlObject
loadFromXml
 

Constructor Detail

XmlObjectImpl

public XmlObjectImpl()
Method Detail

toXml

public void toXml(java.io.Writer writer)
           throws MarshalException,
                  ValidationException,
                  java.io.IOException,
                  MappingException
Description copied from interface: XmlObject
marhsall the object to xml and place it in writer. This method internally uses castor.

Specified by:
toXml in interface XmlObject
Parameters:
writer -
Throws:
java.io.IOException
MarshalException
ValidationException
MappingException

loadObjectFromXml

public java.lang.Object loadObjectFromXml(java.io.Reader reader)
                                   throws java.io.IOException,
                                          MappingException,
                                          MarshalException,
                                          ValidationException
Throws:
java.io.IOException
MappingException
MarshalException
ValidationException

setXmlString

public void setXmlString(java.lang.String xml)
                  throws MarshalException,
                         ValidationException,
                         java.io.IOException,
                         MappingException
set the object data from xml string. This is a helper function that creates a StringReader and calls loadObjectFromXml

Parameters:
xml - the xml string
Throws:
MarshalException - if loadFromXml throws it
ValidationException - if loadFromXml throws it
java.io.IOException - if loadFromXml throws it
MappingException - if loadFromXml throws it
See Also:
loadObjectFromXml(Reader)

equals

public boolean equals(java.lang.Object o)
Returns true always, since this base class contains xml helpers, but no data.

Returns:
true

getXmlString

public java.lang.String getXmlString()
                              throws java.io.IOException,
                                     MappingException,
                                     MarshalException,
                                     ValidationException
Description copied from interface: XmlObject
returns a String containing the XML representation of the object. This method internally calls toXml, exceptions thrown from this method are not caught.

Specified by:
getXmlString in interface XmlObject
Throws:
java.io.IOException - if toXml throws it
MappingException
MarshalException
ValidationException
See Also:
XmlObject.toXml(Writer)


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.