de.ispsoft.jaxme.generator
Class ComparatorWriter

java.lang.Object
  extended byde.ispsoft.jaxme.generator.ConfigurableImpl
      extended byde.ispsoft.jaxme.generator.SourceWriterImpl
          extended byde.ispsoft.jaxme.generator.ComparatorWriter
All Implemented Interfaces:
Configurable, SourceWriter

public class ComparatorWriter
extends SourceWriterImpl

This is a SourceWriter that generates a Comparator for sorting a JaxMe element by its various attributes and/or child elements.

Author:
Jochen Wiedmann

Field Summary
 
Fields inherited from class de.ispsoft.jaxme.generator.SourceWriterImpl
directory, generator, javaPackage
 
Constructor Summary
ComparatorWriter()
          Creates a new instance of ComparatorWriter
 
Method Summary
protected  JavaSource getComparatorClass(SchemaComplexElement pElement)
           
protected  java.lang.String getComparatorClassName(SchemaComplexElement pElement)
           
protected  java.lang.String getComparatorPackageName(SchemaComplexElement pElement)
           
protected  JavaMethod getGetInstanceMethod(JavaSource pJs, SchemaComplexElement pElement)
           
protected  JavaMethod getInitMethod(JavaSource pJs, SchemaComplexElement pElement)
           
protected  JavaInnerClass getInnerClass(int pNum, JavaSource pJs, SchemaComplexElement pParent, SchemaAbstractSimpleElement pElement)
           
protected  void getInnerClasses(JavaSource pJs, SchemaComplexElement pElement)
           
protected  JavaField getTheInstanceField(JavaSource pJs, SchemaComplexElement pElement)
           
protected  java.util.Map getUriNameMap(java.util.Iterator pIterator)
           
 void write(SchemaElement pElement)
          Called for writing a single schema element.
 
Methods inherited from class de.ispsoft.jaxme.generator.SourceWriterImpl
getDirectory, getGenerator, getJavaPackage, getOption, getSchemaDate, newJavaSource, setDirectory, setGenerator, setJavaPackage, setSchemaDate, write, writeFile, writeJavaSourceFile
 
Methods inherited from class de.ispsoft.jaxme.generator.ConfigurableImpl
getOption, getOptions, getOptionValue, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.ispsoft.jaxme.generator.Configurable
getOption, getOptions, getOptionValue, setOption
 

Constructor Detail

ComparatorWriter

public ComparatorWriter()
Creates a new instance of ComparatorWriter

Method Detail

getInnerClasses

protected void getInnerClasses(JavaSource pJs,
                               SchemaComplexElement pElement)

getInnerClass

protected JavaInnerClass getInnerClass(int pNum,
                                       JavaSource pJs,
                                       SchemaComplexElement pParent,
                                       SchemaAbstractSimpleElement pElement)

getInitMethod

protected JavaMethod getInitMethod(JavaSource pJs,
                                   SchemaComplexElement pElement)

getComparatorPackageName

protected java.lang.String getComparatorPackageName(SchemaComplexElement pElement)

getComparatorClassName

protected java.lang.String getComparatorClassName(SchemaComplexElement pElement)

getUriNameMap

protected java.util.Map getUriNameMap(java.util.Iterator pIterator)

getTheInstanceField

protected JavaField getTheInstanceField(JavaSource pJs,
                                        SchemaComplexElement pElement)

getGetInstanceMethod

protected JavaMethod getGetInstanceMethod(JavaSource pJs,
                                          SchemaComplexElement pElement)

getComparatorClass

protected JavaSource getComparatorClass(SchemaComplexElement pElement)

write

public void write(SchemaElement pElement)
           throws java.lang.Exception

Called for writing a single schema element.

Specified by:
write in interface SourceWriter
Specified by:
write in class SourceWriterImpl
Throws:
java.lang.Exception