SRJRCFrames
v0.1.296

de.schwarzrot.data.access.support
Class XMLImporter

java.lang.Object
  extended by de.schwarzrot.data.access.support.XMLBase
      extended by 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

Field Summary
 
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
 
Constructor Summary
XMLImporter()
           
 
Method Summary
protected  void firstPass(XMLEvent e)
           
 EntityDescriptorAccessor getEntityDescriptorAccessor()
           
protected  void parseAttrEnd(EndElement ee)
           
protected  void parseAttrStart(StartElement se)
           
protected  void parseEntryEnd(EndElement ee)
           
protected  void parseEntryStart(StartElement se)
           
 Object performImport(File source)
          imports entities from a xml-file.
 Object performImport(String source)
          imports entities from xml, that has been read into a string buffer.
protected  void reset()
           
protected  void secondPass(XMLEvent e)
           
 void setEntityDescriptorAccessor(EntityDescriptorAccessor i)
          injection method: sets the description accessor to access EntityDescriptions
 
Methods inherited from class de.schwarzrot.data.access.support.XMLBase
getLogger, loadClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLImporter

public XMLImporter()
Method Detail

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:
  1. create instances
  2. 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:
  1. create instances
  2. 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 EntityDescriptions

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

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
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.