|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.beans.beancontext.BeanContextChildSupport | +--java.beans.beancontext.BeanContextSupport | +--xdoclet.beans.BeanContextSupportEx | +--xdoclet.Plugin | +--xdoclet.plugins.BetwixtPlugin
Plugin backed by Betwixt.
This plugin is used as a base class for plugins using beans generated by
XGGPlugin
.
The plugin developer only has to implement one of the populate
methods (which one depending on whether the plugin is intended to be used in
one file or multiple files mode).
The implemented populate method should cast the root bean to the class
that is passed to the constructor and populate the bean with sub-beans,
using the metaData that's passes to the same populate method. The metaData
should also be cast to the appropriate type, like XClass
or whatever metadata type the plugin expects to be fed with.
Field Summary | |
static String |
SERIALIZED_BEANREADER
|
Fields inherited from class java.beans.beancontext.BeanContextSupport |
bcmListeners, children, designTime, locale, okToUseGui |
Fields inherited from class java.beans.beancontext.BeanContextChildSupport |
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport |
Fields inherited from interface java.beans.beancontext.BeanContext |
globalHierarchyLock |
Fields inherited from interface java.beans.DesignMode |
PROPERTYNAME |
Constructor Summary | |
protected |
BetwixtPlugin(Class rootClass)
|
Method Summary | |
protected void |
generate(File file,
Collection metaData)
Generates a file. |
protected void |
generate(File file,
Object metaData)
Generates a file. |
protected Object |
parse(String mergeFile)
Parses an XML stream into a bean. |
protected void |
populate(XGGPojo root,
Collection metaData)
Populates the XML tree. |
protected void |
populate(XGGPojo root,
Object metaData)
Populates the XML tree. |
void |
setVersion(String version)
Sets the version. |
Methods inherited from class xdoclet.beans.BeanContextSupportEx |
add, createInvocations, getInvocations, getParent, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Field Detail |
public static final String SERIALIZED_BEANREADER
Constructor Detail |
protected BetwixtPlugin(Class rootClass)
Method Detail |
public void setVersion(String version)
version
- DTD/XSD version.protected final Object parse(String mergeFile) throws XDocletException
Parses an XML stream into a bean. This method can be used by subclasses to merge in additional content. The result should be cast to the expected Bean class.
The stream will be sought for on the classpath, and the mergeFile should be a relative path.
mergeFile
- a relative path to a resource containing XML.
XDocletException
- if the file can't be properly parsed.protected final void generate(File file, Object metaData) throws IOException, XDocletException
Plugin
generate
in class Plugin
file
- file to be generated.metaData
- metadata used during generation.
XDocletException
- if generation fails.
IOException
- if an IO error occurs.protected final void generate(File file, Collection metaData) throws IOException, XDocletException
Plugin
generate
in class Plugin
file
- file to be generated.metaData
- metadata used during generation.
IOException
- if an IO error occurs.
XDocletException
- if generation fails.protected void populate(XGGPojo root, Object metaData) throws XDocletException
root
- Object representing the root element in the XML.metaData
- data that can be used to populate the XML tree.
XDocletException
- if population fails.protected void populate(XGGPojo root, Collection metaData) throws XDocletException
root
- Object representing the root element in the XML.metaData
- data that can be used to populate the XML tree.
XDocletException
- if population fails.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |