|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.hibernate.support.HibernateDaoSupport org.figure8.join.core.persistence.HibernateXmlDatabinder
public class HibernateXmlDatabinder
This is an implementation of XmlDatabinder
for entity objects
using Hibernate as an ORM system.
Field Summary | |
---|---|
static java.lang.String |
CARRIAGE_RETURN
|
static java.lang.String |
CONST_CLASS
|
static java.lang.String |
CONST_CLOSE_CDATA
|
static java.lang.String |
CONST_CLOSE_OBJECT_TAG
|
static java.lang.String |
CONST_COLLECTION
|
static java.lang.String |
CONST_COMPONENT
|
static java.lang.String |
CONST_COMPOSITE_ELEMENT
|
static java.lang.String |
CONST_COMPOSITE_ID
|
static java.lang.String |
CONST_ELEMENT
|
static java.lang.String |
CONST_ID
|
static java.lang.String |
CONST_INDEX_ID
|
static java.lang.String |
CONST_INDEX_TYPE
|
static java.lang.String |
CONST_NAME
|
static java.lang.String |
CONST_OBJECT
|
static java.lang.String |
CONST_OPEN_CDATA
|
static java.lang.String |
CONST_OPEN_OBJECT_TAG
|
static java.lang.String |
CONST_PROPERTY
|
static java.lang.String |
CONST_SUBCOLLECTION
|
static java.lang.String |
CONST_TYPE
|
static java.lang.String |
DEFAULT_ENCODING
Constant representing default encoding for writing Xml |
static java.lang.String |
END_TAG_CARRIAGE_RETURN
|
static java.text.SimpleDateFormat |
isoDateFormat
Simple date formater for ISO dates |
static java.text.SimpleDateFormat |
isoTimestampFormat
Simple date formater for ISO timestamps |
static java.lang.String |
LEFT_CHEVRON
|
static java.lang.String |
RIGHT_CHEVRON
|
static java.lang.String |
START_CLOSE_TAG
|
Fields inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
---|
logger |
Constructor Summary | |
---|---|
HibernateXmlDatabinder()
Creates a new instance of HibernateXmlDatabinder |
Method Summary | |
---|---|
static java.lang.String |
formatDate(java.util.Date date)
|
static java.lang.String |
formatTimestamp(java.util.Date date)
|
java.util.Collection |
loadFromXml(java.io.InputStream is)
Load a collection of EntityObject s from a Xml stream |
static java.util.Date |
parseDate(java.lang.String dateStr)
|
static java.util.Date |
parseTimestamp(java.lang.String dateStr)
|
void |
setEncoding(java.lang.String encoding)
|
void |
writeToXml(java.io.Writer writer,
ObjectDao dao)
Write a collection of EntityObject s using their Xml form |
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
---|
afterPropertiesSet, closeSessionIfNecessary, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, initDao, setHibernateTemplate, setSessionFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ENCODING
public static java.text.SimpleDateFormat isoDateFormat
public static java.text.SimpleDateFormat isoTimestampFormat
public static final java.lang.String LEFT_CHEVRON
public static final java.lang.String RIGHT_CHEVRON
public static final java.lang.String CARRIAGE_RETURN
public static final java.lang.String START_CLOSE_TAG
public static final java.lang.String END_TAG_CARRIAGE_RETURN
public static final java.lang.String CONST_OBJECT
public static final java.lang.String CONST_OPEN_OBJECT_TAG
public static final java.lang.String CONST_CLOSE_OBJECT_TAG
public static final java.lang.String CONST_NAME
public static final java.lang.String CONST_CLASS
public static final java.lang.String CONST_INDEX_ID
public static final java.lang.String CONST_INDEX_TYPE
public static final java.lang.String CONST_COMPOSITE_ELEMENT
public static final java.lang.String CONST_ELEMENT
public static final java.lang.String CONST_SUBCOLLECTION
public static final java.lang.String CONST_ID
public static final java.lang.String CONST_COMPOSITE_ID
public static final java.lang.String CONST_COLLECTION
public static final java.lang.String CONST_PROPERTY
public static final java.lang.String CONST_COMPONENT
public static final java.lang.String CONST_TYPE
public static final java.lang.String CONST_OPEN_CDATA
public static final java.lang.String CONST_CLOSE_CDATA
Constructor Detail |
---|
public HibernateXmlDatabinder()
Method Detail |
---|
public void setEncoding(java.lang.String encoding)
encoding
- The encoding for Xml outputpublic static java.lang.String formatDate(java.util.Date date)
date
- The date to format
public static java.lang.String formatTimestamp(java.util.Date date)
date
- The date to format as a timestamp
public static java.util.Date parseDate(java.lang.String dateStr) throws java.text.ParseException
dateStr
- the string representation of date
java.text.ParseException
- if string cannot be parsedpublic static java.util.Date parseTimestamp(java.lang.String dateStr) throws java.text.ParseException
dateStr
- the string representation of timestamp
java.text.ParseException
- if string cannot be parsedpublic java.util.Collection loadFromXml(java.io.InputStream is) throws InfrastructureException, java.io.IOException
EntityObject
s from a Xml stream
loadFromXml
in interface XmlDatabinder
is
- An input stream containing Xml exported form of entity objects
EntityObject
s
InfrastructureException
- if entity objects cannot be recreated from stream
java.io.IOException
- if stream cannot be correctly readpublic void writeToXml(java.io.Writer writer, ObjectDao dao) throws InfrastructureException, java.io.IOException
EntityObject
s using their Xml form
writeToXml
in interface XmlDatabinder
writer
- The writer to use for outputing entity objectsdao
- The data access objects from whom are retrievied entities (using the findAll() method)
InfrastructureException
- if entity objects cannot be exported corectly
java.io.IOException
- if writer cannot be correctly written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |