org.deegree.tools.binding
Class ModelClass

java.lang.Object
  extended by org.deegree.tools.binding.ModelClass
Direct Known Subclasses:
FeatureClass

public abstract class ModelClass
extends Object

TODO add class documentation here

Version:
$Revision: 23754 $, $Date: 2010-04-22 13:33:52 +0200 (Thu, 22 Apr 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Field Summary
static String SP
           
static String SP2
           
static String SP3
           
static String SP4
           
 
Constructor Summary
ModelClass(QName name, String rootPackage, String packageDir, String defaultPackage, boolean isInterface, boolean isAbstract)
           
ModelClass(String className, String packageName, boolean isInterface)
           
 
Method Summary
protected  void addField(Field field)
           
static String arlist(String key)
           
static String arlist(String key, boolean createNew, int size)
           
protected static void closeMethod(Writer out)
           
static String createBetterClassName(String someValue)
          Removes underscores and sets the first Character to an Uppercase.
static String createBetterMethodName(String someValue)
          Removes underscores and sets the first Character to a lowercase.
protected  String createFieldName(String propName)
           
 boolean equals(Object other)
           
protected  void generateGetter(Writer out, Field field)
           
protected  void generateGettersSetters(Writer out)
           
protected static void generateMethodDoc(Writer out, List<String> lines)
           
protected  void generateSetter(Writer out, Field field)
           
 String getClassLocation()
           
 String getClassName()
           
 String getClassQName()
           
abstract  List<String> getImports(Map<QName,FeatureClass> featClasses)
           
 String getPackageDir()
           
 String getPackageName()
           
 boolean hasField(String fieldName)
           
 int hashCode()
           
static String hashMap(String key, String val, boolean createNew)
           
static String hashSet(String type, boolean createNew)
           
 boolean isAbstract()
           
 boolean isInterface()
           
static String linkedHashMap(String key, String val, boolean createNew)
           
static String list(String key)
           
static String map(String key, String val)
           
static String newList(String type, String varName)
           
static String newMap(String key, String val, String varName)
           
static String newSet(String type, String varName)
           
static String oif(boolean and, String... args)
           
protected static void openMethod(Writer out, String access, String returnType, String name, List<StringPair> params, List<String> thro, boolean override)
           
protected static void openPublic(Writer out, String returnType, String name)
           
static String set(String type)
           
 String toString()
           
 void writeClassDoc(Writer out)
           
 void writeClassStart(Writer out)
           
protected static void writeField(Writer out, Field field)
           
 void writeFields(Writer out)
           
 void writeHeader(Writer out)
           
 void writeImports(BufferedWriter out, Map<QName,FeatureClass> featClasses)
           
 void writeMethods(Writer out, HashMap<QName,FeatureClass> featClasses)
           
 void writePackage(Writer out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SP

public static final String SP
See Also:
Constant Field Values

SP2

public static final String SP2
See Also:
Constant Field Values

SP3

public static final String SP3
See Also:
Constant Field Values

SP4

public static final String SP4
See Also:
Constant Field Values
Constructor Detail

ModelClass

public ModelClass(QName name,
                  String rootPackage,
                  String packageDir,
                  String defaultPackage,
                  boolean isInterface,
                  boolean isAbstract)

ModelClass

public ModelClass(String className,
                  String packageName,
                  boolean isInterface)
Parameters:
string -
string2 -
b -
Method Detail

getImports

public abstract List<String> getImports(Map<QName,FeatureClass> featClasses)

getClassQName

public String getClassQName()

getClassName

public String getClassName()
Returns:

getPackageName

public String getPackageName()
Returns:

getPackageDir

public String getPackageDir()
Returns:

getClassLocation

public String getClassLocation()

addField

protected void addField(Field field)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isInterface

public boolean isInterface()
Returns:
the isInterface

isAbstract

public boolean isAbstract()
Returns:

hasField

public boolean hasField(String fieldName)
Parameters:
fieldName - to test.
Returns:
true if a field with the given name was already defined.

writeHeader

public void writeHeader(Writer out)
                 throws IOException
Parameters:
out -
Throws:
IOException

writePackage

public void writePackage(Writer out)
                  throws IOException
Parameters:
out -
Throws:
IOException

writeImports

public void writeImports(BufferedWriter out,
                         Map<QName,FeatureClass> featClasses)
                  throws IOException
Parameters:
out -
featClasses -
Throws:
IOException

writeClassDoc

public void writeClassDoc(Writer out)
                   throws IOException
Parameters:
out -
Throws:
IOException

writeClassStart

public void writeClassStart(Writer out)
                     throws IOException
Parameters:
out -
Throws:
IOException

writeFields

public void writeFields(Writer out)
                 throws IOException
Parameters:
out -
Throws:
IOException

writeField

protected static void writeField(Writer out,
                                 Field field)
                          throws IOException
Throws:
IOException

writeMethods

public void writeMethods(Writer out,
                         HashMap<QName,FeatureClass> featClasses)
                  throws IOException
Parameters:
out -
Throws:
IOException

generateGettersSetters

protected void generateGettersSetters(Writer out)
                               throws IOException
Parameters:
out -
Throws:
IOException

openMethod

protected static void openMethod(Writer out,
                                 String access,
                                 String returnType,
                                 String name,
                                 List<StringPair> params,
                                 List<String> thro,
                                 boolean override)
                          throws IOException
Throws:
IOException

closeMethod

protected static void closeMethod(Writer out)
                           throws IOException
Throws:
IOException

generateSetter

protected void generateSetter(Writer out,
                              Field field)
                       throws IOException
Parameters:
sb -
fieldType -
fieldName -
Throws:
IOException

generateGetter

protected void generateGetter(Writer out,
                              Field field)
                       throws IOException
Throws:
IOException

generateMethodDoc

protected static void generateMethodDoc(Writer out,
                                        List<String> lines)
                                 throws IOException
Throws:
IOException

openPublic

protected static void openPublic(Writer out,
                                 String returnType,
                                 String name)
                          throws IOException
Throws:
IOException

createBetterClassName

public static String createBetterClassName(String someValue)
Removes underscores and sets the first Character to an Uppercase.

Parameters:
someValue -
Returns:
the new class name

createBetterMethodName

public static String createBetterMethodName(String someValue)
Removes underscores and sets the first Character to a lowercase.

Parameters:
someValue -
Returns:
the new class name

createFieldName

protected String createFieldName(String propName)

map

public static String map(String key,
                         String val)

linkedHashMap

public static String linkedHashMap(String key,
                                   String val,
                                   boolean createNew)

hashMap

public static String hashMap(String key,
                             String val,
                             boolean createNew)

list

public static String list(String key)

arlist

public static String arlist(String key)

arlist

public static String arlist(String key,
                            boolean createNew,
                            int size)

oif

public static String oif(boolean and,
                         String... args)

newMap

public static String newMap(String key,
                            String val,
                            String varName)

newList

public static String newList(String type,
                             String varName)

newSet

public static String newSet(String type,
                            String varName)

hashSet

public static String hashSet(String type,
                             boolean createNew)
Parameters:
type -
b -
Returns:

set

public static String set(String type)
Parameters:
type -
Returns:


Copyright © 2011. All Rights Reserved.