org.apache.ibatis.abator.api
Class GeneratedJavaFile

java.lang.Object
  extended byorg.apache.ibatis.abator.api.GeneratedFile
      extended byorg.apache.ibatis.abator.api.GeneratedJavaFile

public class GeneratedJavaFile
extends GeneratedFile

Author:
Jeff Butler

Constructor Summary
GeneratedJavaFile(FullyQualifiedJavaType type)
          Default constructor
 
Method Summary
 void addField(java.lang.String field)
           
 void addImportedType(FullyQualifiedJavaType importedType)
          The underlying Set does not allow duplicates, so clients do not need to be concerned with duplicate resolution.
 void addMethod(java.lang.String method)
           
 void addSuperInterfaceType(FullyQualifiedJavaType superInterfaceType)
           
 java.lang.String getContent()
          This method returns the entire contents of the generated file.
 java.util.List getFields()
           
 java.lang.String getFileName()
          Get the file name (without any path).
 java.util.Set getImportedTypes()
           
 java.util.List getMethods()
           
 FullyQualifiedJavaType getSuperClass()
           
 java.util.Set getSuperInterfaceTypes()
           
 java.lang.String getTargetPackage()
          Get the target package for the file.
 boolean isJavaInterface()
           
 void newLine(java.lang.StringBuffer sb)
          Utility method, adds a newline character to a StringBuffer.
 void setJavaInterface(boolean javaInterface)
           
 void setSuperClass(FullyQualifiedJavaType superClass)
           
 
Methods inherited from class org.apache.ibatis.abator.api.GeneratedFile
getTargetProject, setTargetProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedJavaFile

public GeneratedJavaFile(FullyQualifiedJavaType type)
Default constructor

Method Detail

getFields

public java.util.List getFields()

getImportedTypes

public java.util.Set getImportedTypes()

getMethods

public java.util.List getMethods()

getContent

public java.lang.String getContent()
Description copied from class: GeneratedFile
This method returns the entire contents of the generated file. Clients can simply save the value returned from this method as the file contents. Subclasses such as @see org.apache.ibatis.abator.api.GeneratedJavaFile offer more fine grained access to file parts, but still implement this method in the event that the entire contents are desired.

Specified by:
getContent in class GeneratedFile
Returns:
Returns the content.

isJavaInterface

public boolean isJavaInterface()

setJavaInterface

public void setJavaInterface(boolean javaInterface)

getSuperInterfaceTypes

public java.util.Set getSuperInterfaceTypes()

addSuperInterfaceType

public void addSuperInterfaceType(FullyQualifiedJavaType superInterfaceType)

addImportedType

public void addImportedType(FullyQualifiedJavaType importedType)
The underlying Set does not allow duplicates, so clients do not need to be concerned with duplicate resolution.

Parameters:
importedType - the type to import.

addField

public void addField(java.lang.String field)

addMethod

public void addMethod(java.lang.String method)

getSuperClass

public FullyQualifiedJavaType getSuperClass()
Returns:
Returns the superClass.

setSuperClass

public void setSuperClass(FullyQualifiedJavaType superClass)
Parameters:
superClass - The superClass to set.

getFileName

public java.lang.String getFileName()
Description copied from class: GeneratedFile
Get the file name (without any path). Clients should use this method to determine how to save the results.

Specified by:
getFileName in class GeneratedFile
Returns:
Returns the file name.

getTargetPackage

public java.lang.String getTargetPackage()
Description copied from class: GeneratedFile
Get the target package for the file. Clients should use this method to determine how to save the results.

Specified by:
getTargetPackage in class GeneratedFile
Returns:
Returns the target project.

newLine

public void newLine(java.lang.StringBuffer sb)
Utility method, adds a newline character to a StringBuffer.

Parameters:
sb - the StringBuffer to be appended to