de.schwarzrot.data.access.support
Class XMLImporter
java.lang.Object
de.schwarzrot.data.access.support.XMLBase
de.schwarzrot.data.access.support.XMLImporter
- All Implemented Interfaces:
- Importer
public class XMLImporter
- extends XMLBase
- implements Importer
class to import exported entities from xml files. Main purpose is to
interchange data portions without having to care about keys or ids. Developed
with the intention to ex- or import just themes and skins, it has now matured
to serve as well to ex- and import complete database schemas.
- Author:
- Reinhard Mantey
Fields inherited from class de.schwarzrot.data.access.support.XMLBase |
EYECATCH, VA_ATTR, VA_CLASS, VA_ENTITY, VA_ENTRY, VA_ID, VA_ITEM, VA_KEY, VA_LIST, VA_MAIN, VA_MAP, VA_NAME, VA_REFID, VA_VALUE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLImporter
public XMLImporter()
getEntityDescriptorAccessor
public final EntityDescriptorAccessor getEntityDescriptorAccessor()
performImport
public Object performImport(File source)
throws IOException
- imports entities from a xml-file. To allow arbitrary references between
entities, import is performed in 2 stages:
- create instances
- setup properties of created instances
- Specified by:
performImport
in interface Importer
- Parameters:
source
- - the file that holds the xml data
- Returns:
- the imported object
- Throws:
IOException
- - raise exception from underlying layer to application
performImport
public Object performImport(String source)
throws IOException
- imports entities from xml, that has been read into a string buffer. To
allow arbitrary references between entities, import is performed in 2
stages:
- create instances
- setup properties of created instances
- Specified by:
performImport
in interface Importer
- Parameters:
source
- - the string buffer, that holds the xml data
- Returns:
- the imported object
- Throws:
IOException
- - raise exception from underlying layer to application
setEntityDescriptorAccessor
public final void setEntityDescriptorAccessor(EntityDescriptorAccessor i)
- Description copied from interface:
Importer
- injection method: sets the description accessor to access
EntityDescription
s
- Specified by:
setEntityDescriptorAccessor
in interface Importer
- Parameters:
i
- - the accessor to use
firstPass
protected void firstPass(XMLEvent e)
throws Exception
- Throws:
Exception
parseAttrEnd
protected void parseAttrEnd(EndElement ee)
throws Exception
- Throws:
Exception
parseAttrStart
protected void parseAttrStart(StartElement se)
throws Exception
- Throws:
Exception
parseEntryEnd
protected void parseEntryEnd(EndElement ee)
parseEntryStart
protected void parseEntryStart(StartElement se)
reset
protected void reset()
secondPass
protected void secondPass(XMLEvent e)
throws Exception
- Throws:
Exception
Submit
a bug or request a feature
SRJRCFrames is published according to the
GNU General Public License
Copyright 2005-2012
Reinhard Mantey - some rights reserved.