|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.schwarzrot.data.access.support.XMLBase de.schwarzrot.data.access.support.XMLExporter
public class XMLExporter
class to export entities to xml files. Main purpose is to interchange data portions without having to care about id's or keys. 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.
Be aware, that writing of XML-files only works for persistent Entity
s
and will surely fail on other beans, as the XMLExporter
only exports
properties marked as persistent.
Another reason for writing my own exporter is the handling of entity relations, which now works without storing the id of an entity. This way imports won't fail, even if auto-increment keys are used and have different levels.
EntityDescriptor
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 | |
---|---|
XMLExporter()
|
Method Summary | ||
---|---|---|
protected void |
export(List<?> valueList,
String id,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected void |
export(Map<?,?> valueMap,
String id,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected void |
export(Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected
|
exportEntity(E instance,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected
|
exportForeigns(E instance,
EntityDescriptor ed,
Writer out)
|
|
protected
|
exportNamedChildren(E instance,
EntityDescriptor ed,
Writer out)
|
|
protected
|
exportProperty(E object,
PropertyInfo pi,
Writer out)
|
|
protected
|
exportRelated(E instance,
EntityDescriptor ed,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected void |
exportRelList(List<?> list,
int indent,
Writer out)
|
|
protected void |
exportRelMap(String attrName,
Map<?,?> map,
EntityDescriptor ed,
int indent,
Writer out)
|
|
protected
|
exportUnnamedChildren(E instance,
EntityDescriptor ed,
Writer out)
|
|
EntityDescriptorAccessor |
getEntityDescriptorAccessor()
|
|
protected
|
investigate(E instance,
EntityDescriptor ed,
Map<String,Map<Long,Entity>> cache,
Map<String,PropertyInfo> relMap,
Writer out)
|
|
protected
|
investigate(E instance,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected void |
investigate(List<?> lst,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
protected void |
investigate(Map<?,?> map,
Map<String,Map<Long,Entity>> cache,
Writer out)
|
|
|
performExport(E instance,
File target)
|
|
|
performExport(E instance,
Writer out)
exports a single entity with all relations |
|
void |
performExport(List<?> lst,
String id,
File target)
|
|
void |
performExport(List<?> lst,
String id,
Writer out)
exports a list of entities |
|
void |
performExport(Map<?,?> map,
String id,
File target)
|
|
void |
performExport(Map<?,?> map,
String id,
Writer out)
exports a map of entities |
|
void |
setEntityDescriptorAccessor(EntityDescriptorAccessor i)
injection method: sets the description accessor to access EntityDescription s |
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 |
---|
public XMLExporter()
Method Detail |
---|
public final EntityDescriptorAccessor getEntityDescriptorAccessor()
public <E extends Entity> void performExport(E instance, File target) throws IOException
IOException
public <E extends Entity> void performExport(E instance, Writer out) throws IOException
Exporter
performExport
in interface Exporter
E
- - class of entityinstance
- - instance to exportout
- - channel to write export data to
IOException
public void performExport(List<?> lst, String id, File target) throws IOException
IOException
public void performExport(List<?> lst, String id, Writer out) throws IOException
Exporter
performExport
in interface Exporter
lst
- - the list of entities to exportid
- - used to name the listout
- - channel to write export data to
IOException
public void performExport(Map<?,?> map, String id, File target) throws IOException
IOException
public void performExport(Map<?,?> map, String id, Writer out) throws IOException
Exporter
performExport
in interface Exporter
map
- - the map of entities to exportid
- - used to name the mapout
- - channel to write export data to
IOException
public final void setEntityDescriptorAccessor(EntityDescriptorAccessor i)
Exporter
EntityDescription
s
setEntityDescriptorAccessor
in interface Exporter
i
- - the accessor to useprotected void export(List<?> valueList, String id, Map<String,Map<Long,Entity>> cache, Writer out) throws IOException
IOException
protected void export(Map<?,?> valueMap, String id, Map<String,Map<Long,Entity>> cache, Writer out) throws IOException
IOException
protected void export(Map<String,Map<Long,Entity>> cache, Writer out) throws IOException
IOException
protected <E extends Entity> void exportEntity(E instance, Map<String,Map<Long,Entity>> cache, Writer out) throws IOException
IOException
protected <E extends Entity> void exportForeigns(E instance, EntityDescriptor ed, Writer out) throws IOException
IOException
protected <E extends Entity> void exportNamedChildren(E instance, EntityDescriptor ed, Writer out) throws IOException
IOException
protected <E extends Entity> void exportProperty(E object, PropertyInfo pi, Writer out) throws IOException
IOException
protected <E extends Entity> void exportRelated(E instance, EntityDescriptor ed, Map<String,Map<Long,Entity>> cache, Writer out) throws IOException
IOException
protected void exportRelList(List<?> list, int indent, Writer out) throws IOException
IOException
protected void exportRelMap(String attrName, Map<?,?> map, EntityDescriptor ed, int indent, Writer out) throws IOException
IOException
protected <E extends Entity> void exportUnnamedChildren(E instance, EntityDescriptor ed, Writer out) throws IOException
IOException
protected <E extends Entity> void investigate(E instance, EntityDescriptor ed, Map<String,Map<Long,Entity>> cache, Map<String,PropertyInfo> relMap, Writer out)
protected <E extends Entity> Map<String,Map<Long,Entity>> investigate(E instance, Map<String,Map<Long,Entity>> cache, Writer out)
protected void investigate(List<?> lst, Map<String,Map<Long,Entity>> cache, Writer out)
protected void investigate(Map<?,?> map, Map<String,Map<Long,Entity>> cache, Writer out)
|
SRJRCFrames v0.1.296 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |