org.apache.openjpa.lib.meta
Class CFMetaDataSerializer

java.lang.Object
  extended by org.apache.openjpa.lib.meta.XMLMetaDataSerializer
      extended by org.apache.openjpa.lib.meta.CFMetaDataSerializer
All Implemented Interfaces:
MetaDataSerializer
Direct Known Subclasses:
XMLPersistenceMetaDataSerializer

public abstract class CFMetaDataSerializer
extends XMLMetaDataSerializer

Helps serialize metadata objects to package and class elements.

Author:
Abe White
See Also:
CFMetaDataParser

Field Summary
 
Fields inherited from interface org.apache.openjpa.lib.meta.MetaDataSerializer
APPEND, COMPACT, PRETTY, VERBOSE
 
Constructor Summary
CFMetaDataSerializer()
           
 
Method Summary
protected  String getClassName(String name)
          Returns the given class name, stripping the package if it is not needed.
protected  String getPackage()
          The default package for objects being serialized.
protected  String getPackage(Object obj)
          Return the package name of the given object, or null if not in a package.
protected  Map<String,Collection<Object>> groupByPackage(Collection<Object> objs)
          Helper method to group objects by package.
protected  void setPackage(String pkg)
          The default package for objects being serialized.
 
Methods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataSerializer
addAttribute, addComments, addComments, addText, currentBackupFile, endElement, getAttributes, getFileMap, getLog, getObjects, getSourceFile, isVerbose, prepareWrite, reset, serialize, serialize, serialize, serialize, serialize, serialize, serialize, setLog, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFMetaDataSerializer

public CFMetaDataSerializer()
Method Detail

getPackage

protected String getPackage()
The default package for objects being serialized.


setPackage

protected void setPackage(String pkg)
The default package for objects being serialized.


groupByPackage

protected Map<String,Collection<Object>> groupByPackage(Collection<Object> objs)
                                                 throws SAXException
Helper method to group objects by package.

Returns:
mapping of package name to a collection of objects in that package
Throws:
SAXException

getPackage

protected String getPackage(Object obj)
Return the package name of the given object, or null if not in a package. Used by groupByPackage(java.util.Collection). Returns null by default.


getClassName

protected String getClassName(String name)
Returns the given class name, stripping the package if it is not needed.



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.