org.ephman.abra.tools.plugins
Class GeneratorPlugin

java.lang.Object
  |
  +--org.ephman.abra.tools.plugins.GeneratorPlugin
All Implemented Interfaces:
Generator

public abstract class GeneratorPlugin
extends java.lang.Object
implements Generator

this class will describe the basics for adding a plugin to the abra generation framework callbacks when parsing xml for information storage and generation calls to run

Version:
0.1 (8/16/2002)
Author:
Paul M Bethe

Constructor Summary
GeneratorPlugin()
           
 
Method Summary
protected  void assertMandatory(java.lang.String field, java.lang.String name)
           
abstract  void close()
          incase files need to be closed or whatever
protected abstract  ClassPluginData createDefault(JClass currentClass)
          create a default plugin (ie base taglib, validator
abstract  void generate(JClass currentClass)
          close and generate are part of Generator inteface
abstract  java.lang.String[] getClassLevelNodeNames()
          returns the names which are registered to this generator ie.
 java.lang.String getDefaultFormatName()
           
abstract  java.lang.String[] getFieldLevelNodeNames()
          returns the names which are registered to this generator but at the field level ie.
abstract  java.lang.String getName()
           
protected  java.util.HashMap getNamedMap(JClass currentClass)
           
protected  ClassPluginData getPlugin(JClass currentClass, java.lang.String formatName)
           
abstract  void handleClassLevelNode(java.lang.String nodeName, java.util.Map attributes, JClass currentClass)
          call back when the node 'nodeName' which has been registered by this class is encountered
abstract  void handleFieldLevelNode(java.lang.String nodeName, java.util.Map attributes, JClass currentClass, JField currentField)
          call back when the node 'nodeName' which has been registered by this class is encountered
protected abstract  boolean hasDefault()
          does this plugin need a call to createDefault ?
protected  void registerPlugin(ClassPluginData plugin, JClass currentClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorPlugin

public GeneratorPlugin()
Method Detail

getClassLevelNodeNames

public abstract java.lang.String[] getClassLevelNodeNames()
returns the names which are registered to this generator ie. "class-view" would map to View generator


getFieldLevelNodeNames

public abstract java.lang.String[] getFieldLevelNodeNames()
returns the names which are registered to this generator but at the field level ie.

handleClassLevelNode

public abstract void handleClassLevelNode(java.lang.String nodeName,
                                          java.util.Map attributes,
                                          JClass currentClass)
                                   throws SchemaException
call back when the node 'nodeName' which has been registered by this class is encountered

Parameters:
nodeName - the node name ie "class-view"
attributes - all the attributes in the xml node in key-value hmap
currentClass - the JClass on which this node occured
Throws:
SchemaException - if the data is invalid.

handleFieldLevelNode

public abstract void handleFieldLevelNode(java.lang.String nodeName,
                                          java.util.Map attributes,
                                          JClass currentClass,
                                          JField currentField)
                                   throws SchemaException
call back when the node 'nodeName' which has been registered by this class is encountered

Parameters:
nodeName - the node name ie "view"
attributes - all the attributes in the xml node in key-value hmap
currentClass - the JClass on which this node occured
currentField - the JField on which this node occured
Throws:
SchemaException - if the data is invalid.

getName

public abstract java.lang.String getName()

generate

public abstract void generate(JClass currentClass)
                       throws java.io.IOException,
                              SchemaException
close and generate are part of Generator inteface

Specified by:
generate in interface Generator
java.io.IOException
SchemaException

close

public abstract void close()
                    throws java.io.IOException
incase files need to be closed or whatever

Specified by:
close in interface Generator
java.io.IOException

createDefault

protected abstract ClassPluginData createDefault(JClass currentClass)
create a default plugin (ie base taglib, validator


hasDefault

protected abstract boolean hasDefault()
does this plugin need a call to createDefault ?


getDefaultFormatName

public java.lang.String getDefaultFormatName()

assertMandatory

protected void assertMandatory(java.lang.String field,
                               java.lang.String name)
                        throws SchemaException
SchemaException

registerPlugin

protected void registerPlugin(ClassPluginData plugin,
                              JClass currentClass)

getPlugin

protected ClassPluginData getPlugin(JClass currentClass,
                                    java.lang.String formatName)

getNamedMap

protected java.util.HashMap getNamedMap(JClass currentClass)