org.apache.ws.jaxme.js

Class JavaSource

Implemented Interfaces:
IndentationEngine
Known Direct Subclasses:
JavaInnerClass

public class JavaSource
extends IndentationEngineImpl

A class representing a Java source file.

Nested Class Summary

static class
JavaSource.Protection
Specifies a java objects protection (default, public, protected, or private).
static class
JavaSource.Type
Specifies the type of a java class (interface, or class).

Field Summary

static JavaSource.Type
CLASS
Type of a JavaSource class.
static JavaSource.Protection
DEFAULT_PROTECTION
Default protection of a class, field or method
static JavaSource.Type
INTERFACE
Type of a JavaSource interface.
static JavaSource.Protection
PRIVATE
Protection of a class, field or method: private
static JavaSource.Protection
PROTECTED
Protection of a class, field or method: protected
static JavaSource.Protection
PUBLIC
Protection of a class, field or method: public

Fields inherited from interface org.apache.ws.jaxme.js.IndentationEngine

NOTHING

Method Summary

void
addExtends(Class pExtends)
Sets the class or interface extended by this class or interface.
void
addExtends(JavaQName pExtends)
Sets the class or interface extended by this class or interface.
void
addImplements(Class s)
Adds an interface to the list of interfaces being implemented by this class or interface.
void
addImplements(JavaQName s)
Adds an interface to the list of interfaces being implemented by this class or interface.
void
addImport(Class s)
Adds a package or class to the list of packages and classes being imported.
void
addImport(JavaQName s)
Adds a package or class to the list of packages and classes being imported.
void
addInnerClass(JavaInnerClass pClass)
Adds an inner class.
void
addRawJavaSource(String pSource)
Adds a piece of raw Java source to the class.
String
asString(JavaQName pQName, boolean pAddIfPossible)
Returns whether the given JavaQName is a local class.
void
clearExtends()
Clears the list of extended classes or interfaces.
void
clearImplements()
Clears the list of implemented interfaces.
void
clearImports()
Clears the list of imports.
void
clearInnerClasses()
Clears the list of inner classes.
void
clearRawJavaSources()
Clears the list of raw Java sources.
JavaClassInitializer[]
getClassInitializers()
Returns the static class initializers.
String
getClassName()
Returns the class or interface name.
JavaComment
getComment()
Returns the comment describing this class or interface.
JavaConstructor
getConstructor(JavaQName[] pParams)
Returns the constructor with the given signature or null, if there is no such constructor.
Iterator
getConstructorIterator()
Returns an iterator the the classes constructors.
JavaConstructor[]
getConstructors()
Returns the list of constructors that this class has.
JavaQName[]
getExtends()
Returns the class or interface extended by this class or interface.
JavaSourceFactory
getFactory()
Returns the JavaSourceFactory that created this instance of JavaSource.
JavaField
getField(String pName)
Returns the field with the given name or null, if no such field exists.
JavaField[]
getFields()
Returns the list of fields that this class has.
JavaQName[]
getImplements()
Returns the list of interfaces being implented by this class or interface.
JavaQName[]
getImports()
Returns the list of packages and classes being imported.
JavaInnerClass
getInnerClass(String pName)
Returns the inner class named pName, or null, if no such class exists.
JavaInnerClass[]
getInnerClasses()
Returns the array of inner classes.
JavaMethod
getMethod(String pMethodName, JavaQName[] pParams)
Returns the method with the given signature or null, if there is no such method.
Iterator
getMethodIterator()
Returns an iterator to the classes methods.
JavaMethod[]
getMethods()
Returns the list of methods that this class has.
String
getPackageName()
Returns the package name.
JavaSource.Protection
getProtection()
Returns the protection.
JavaQName
getQName()
Returns the JavaSource's JavaQName.
static String
getQuoted(String s)
Returns a quoted string constant suitable for embedding into Java source.
static String
getQuotedNoQuotes(String s)
Returns a quoted string constant suitable for embedding into Java source, but without quotes.
String[]
getRawJavaSources()
Returns an array with the pieces of raw Java sources.
protected boolean
getStatic()
Returns whether this JavaSource is static (for inner classes).
JavaSource.Type
getType()
Returns the JavaSource type.
boolean
hasDynamicImports()
Returns, whether the class is automatically adding imports.
boolean
isAbstract()
Returns whether class is abstract.
boolean
isExtending(Class pClass)
Returns whether the class is extending the given super class or interface.
boolean
isExtending(JavaQName pClass)
Returns whether the class is extending the given super class or interface.
boolean
isForcingFullyQualifiedName()
Returns, whether class references are always using the fully qualified class name.
boolean
isImplementing(Class pClass)
Returns whether the class is implementing the given interface.
boolean
isImplementing(JavaQName pClass)
Returns whether the class is implementing the given interface.
boolean
isInnerClass()
Returns, whether this is an inner class.
boolean
isInterface()
Returns whether this is an interface or not.
void
newBeanProperty(Class pClass, String pName)
Shortcut for newBeanProperty(JavaQNameImpl.getInstance(pClass), pName).
void
newBeanProperty(Class pClass, String pFieldName, String pGetMethodName, String pSetMethodName)
Shortcut for newBeanProperty(JavaQNameImpl.getInstance(pClass), pFieldName, pGetMethodName, pSetMethodName).
void
newBeanProperty(JavaQName pType, String pName)
Creates a new Java property with the given type and name.
void
newBeanProperty(JavaQName pType, String pFieldName, String pGetMethodName, String pSetMethodName)
Shortcut for
 newJavaField(pFieldName, pType, JavaSource.PRIVATE);
 JavaMethod getMethod = newJavaMethod(pGetMethodName, pType, JavaSource.PUBLIC);
 getMethod.addLine("return this.", pFieldName, ";");
 JavaMethod setMethod = newJavaMethod(pSetMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
 setMethod.addParam(pType, pFieldName);
 setMethod.addLine("this.", pFieldName, " = ", pFieldName, ";");
 
JavaComment
newComment()
Creates a new Javadoc comment describing this class or interface.
JavaClassInitializer
newJavaClassInitializer()
Creates a new instance of JavaClassInitializer.
JavaConstructor
newJavaConstructor()
Creates a new JavaConstructor with default protection.
JavaConstructor
newJavaConstructor(Constructor pConstructor)
Creates a new JavaConstructor with the signature of the given constructor.
JavaConstructor
newJavaConstructor(String pProtection)
Creates a new JavaConstructor with the given protection.
JavaConstructor
newJavaConstructor(JavaConstructor pConstructor)
Creates a new JavaConstructor with the same parameters, protection and exceptions than the given.
JavaConstructor
newJavaConstructor(JavaConstructor pConstructor, boolean pSuper)
Creates a new JavaConstructor with the same signature than the given constructors.
JavaConstructor
newJavaConstructor(JavaSource.Protection pProtection)
Creates a new JavaConstructor with the given protection.
JavaField
newJavaField(Field pField)
Creates a new JavaField with the given fields signature.
JavaField
newJavaField(String pName, Class pType)
Creates a new JavaField with the given name, type and default protection.
JavaField
newJavaField(String pName, Class pType, String pProtection)
Creates a new JavaField with the given name, type and protection.
JavaField
newJavaField(String pName, Class pType, JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.
JavaField
newJavaField(String pName, String pType)
Creates a new JavaField with the given name, type and default protection.
JavaField
newJavaField(String pName, String pType, String pProtection)
Creates a new JavaField with the given name, type and protection.
JavaField
newJavaField(String pName, String pType, JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.
JavaField
newJavaField(String pName, JavaQName pType)
Creates a new JavaField with the given name, type and default protection.
JavaField
newJavaField(String pName, JavaQName pType, String pProtection)
Creates a new JavaField with the given name, type and protection.
JavaField
newJavaField(String pName, JavaQName pType, JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.
JavaInnerClass
newJavaInnerClass(String pName)
Creates a new JavaInnerClass with the given name and default protection.
JavaInnerClass
newJavaInnerClass(String pName, String pProtection)
Creates a new JavaInnerClass with the given name and protection.
JavaInnerClass
newJavaInnerClass(String pName, JavaSource.Protection pProtection)
Creates a new JavaInnerClass with the given name and protection.
JavaMethod
newJavaMethod(Method pMethod)
Creates a new JavaMethod with the signature of the given method pMethod.
JavaMethod
newJavaMethod(String pName, Class pType)
Creates a new JavaMethod with the given name, return type and default protection.
JavaMethod
newJavaMethod(String pName, Class pType, String pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(String pName, Class pType, JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(String pName, String pType)
Creates a new JavaMethod with the given name, return type and default protection.
JavaMethod
newJavaMethod(String pName, String pType, String pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(String pName, String pType, JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(String pName, JavaQName pType)
Creates a new JavaMethod with the given name, return type and default protection.
JavaMethod
newJavaMethod(String pName, JavaQName pType, String pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(String pName, JavaQName pType, JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.
JavaMethod
newJavaMethod(JavaMethod pMethod)
Creates a new JavaMethod with the given methods name and signature.
void
setAbstract(boolean isAbstract)
Sets whether this class is abstract.
void
setDynamicImports(boolean pDynamicImports)
Sets, whether the class is automatically adding imports.
void
setForcingFullyQualifiedName(boolean pForcingFullyQualifiedName)
Sets, whether class references are always using the fully qualified class name.
void
setProtection(JavaSource.Protection protection)
Sets the protection; use null for default protection.
void
setQName(JavaQName pQName)
Sets the JavaSource's JavaQName.
void
setStatic(boolean pStatic)
Sets whether this JavaSource is static (for inner classes).
void
setType(JavaSource.Type pType)
Sets the JavaSource type.
String
toString()
Returns a string representation of this JavaSource file.
void
write(Writer pTarget)
Writes the JavaSource contents into the given Writer.
void
write(IndentationTarget pTarget)

Methods inherited from class org.apache.ws.jaxme.js.IndentationEngineImpl

addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, addLine, asString, checkNulls, clear, getLevel, getLines, getLines, getPlaceHolder, indent, isEmpty, moveToBottom, moveToTop, newPlaceHolder, removePlaceHolder, setLevel, unindent, write, write

Field Details

CLASS

public static final JavaSource.Type CLASS
Type of a JavaSource class.

DEFAULT_PROTECTION

public static final JavaSource.Protection DEFAULT_PROTECTION
Default protection of a class, field or method

INTERFACE

public static final JavaSource.Type INTERFACE
Type of a JavaSource interface.

PRIVATE

public static final JavaSource.Protection PRIVATE
Protection of a class, field or method: private

PROTECTED

public static final JavaSource.Protection PROTECTED
Protection of a class, field or method: protected

PUBLIC

public static final JavaSource.Protection PUBLIC
Protection of a class, field or method: public

Method Details

addExtends

public void addExtends(Class pExtends)
Sets the class or interface extended by this class or interface. Null or the empty string disable the "extends" clause.

addExtends

public void addExtends(JavaQName pExtends)
Sets the class or interface extended by this class or interface. Null or the empty string disable the "extends" clause.
See Also:
getExtends()

addImplements

public void addImplements(Class s)
Adds an interface to the list of interfaces being implemented by this class or interface.

addImplements

public void addImplements(JavaQName s)
Adds an interface to the list of interfaces being implemented by this class or interface.

addImport

public void addImport(Class s)
Adds a package or class to the list of packages and classes being imported.

addImport

public void addImport(JavaQName s)
Adds a package or class to the list of packages and classes being imported.
See Also:
getImports()

addInnerClass

public void addInnerClass(JavaInnerClass pClass)
Adds an inner class.

addRawJavaSource

public void addRawJavaSource(String pSource)
Adds a piece of raw Java source to the class.

asString

public String asString(JavaQName pQName,
                       boolean pAddIfPossible)
Returns whether the given JavaQName is a local class. In other words, whether the package name can be omitted when referencing the class.

clearExtends

public void clearExtends()
Clears the list of extended classes or interfaces.

clearImplements

public void clearImplements()
Clears the list of implemented interfaces.

clearImports

public void clearImports()
Clears the list of imports.

clearInnerClasses

public void clearInnerClasses()
Clears the list of inner classes.

clearRawJavaSources

public void clearRawJavaSources()
Clears the list of raw Java sources.

getClassInitializers

public JavaClassInitializer[] getClassInitializers()
Returns the static class initializers.

getClassName

public String getClassName()
Returns the class or interface name.

getComment

public JavaComment getComment()
Returns the comment describing this class or interface.
See Also:
newComment()

getConstructor

public JavaConstructor getConstructor(JavaQName[] pParams)
Returns the constructor with the given signature or null, if there is no such constructor.

getConstructorIterator

public Iterator getConstructorIterator()
Returns an iterator the the classes constructors. This iterator allows to remove constructors.

getConstructors

public JavaConstructor[] getConstructors()
Returns the list of constructors that this class has.

getExtends

public JavaQName[] getExtends()
Returns the class or interface extended by this class or interface.

getFactory

public JavaSourceFactory getFactory()
Returns the JavaSourceFactory that created this instance of JavaSource.

getField

public JavaField getField(String pName)
Returns the field with the given name or null, if no such field exists.

getFields

public JavaField[] getFields()
Returns the list of fields that this class has.

getImplements

public JavaQName[] getImplements()
Returns the list of interfaces being implented by this class or interface.

getImports

public JavaQName[] getImports()
Returns the list of packages and classes being imported.

getInnerClass

public JavaInnerClass getInnerClass(String pName)
Returns the inner class named pName, or null, if no such class exists.

getInnerClasses

public JavaInnerClass[] getInnerClasses()
Returns the array of inner classes.

getMethod

public JavaMethod getMethod(String pMethodName,
                            JavaQName[] pParams)
Returns the method with the given signature or null, if there is no such method.

getMethodIterator

public Iterator getMethodIterator()
Returns an iterator to the classes methods. This iterator allows to remove certain methods.

getMethods

public JavaMethod[] getMethods()
Returns the list of methods that this class has.

getPackageName

public String getPackageName()
Returns the package name. The empty String represents the root package.

getProtection

public JavaSource.Protection getProtection()
Returns the protection.

getQName

public JavaQName getQName()
Returns the JavaSource's JavaQName.

getQuoted

public static String getQuoted(String s)
Returns a quoted string constant suitable for embedding into Java source.

getQuotedNoQuotes

public static String getQuotedNoQuotes(String s)
Returns a quoted string constant suitable for embedding into Java source, but without quotes.

getRawJavaSources

public String[] getRawJavaSources()
Returns an array with the pieces of raw Java sources.

getStatic

protected boolean getStatic()
Returns whether this JavaSource is static (for inner classes).

getType

public JavaSource.Type getType()
Returns the JavaSource type.
Returns:
"class" or "interface"

hasDynamicImports

public boolean hasDynamicImports()
Returns, whether the class is automatically adding imports.

isAbstract

public boolean isAbstract()
Returns whether class is abstract.

isExtending

public boolean isExtending(Class pClass)
Returns whether the class is extending the given super class or interface.

isExtending

public boolean isExtending(JavaQName pClass)
Returns whether the class is extending the given super class or interface.

isForcingFullyQualifiedName

public boolean isForcingFullyQualifiedName()
Returns, whether class references are always using the fully qualified class name.

isImplementing

public boolean isImplementing(Class pClass)
Returns whether the class is implementing the given interface.

isImplementing

public boolean isImplementing(JavaQName pClass)
Returns whether the class is implementing the given interface.

isInnerClass

public boolean isInnerClass()
Returns, whether this is an inner class.

isInterface

public boolean isInterface()
Returns whether this is an interface or not.

newBeanProperty

public void newBeanProperty(Class pClass,
                            String pName)
Shortcut for newBeanProperty(JavaQNameImpl.getInstance(pClass), pName).

newBeanProperty

public void newBeanProperty(Class pClass,
                            String pFieldName,
                            String pGetMethodName,
                            String pSetMethodName)
Shortcut for newBeanProperty(JavaQNameImpl.getInstance(pClass), pFieldName, pGetMethodName, pSetMethodName).

newBeanProperty

public void newBeanProperty(JavaQName pType,
                            String pName)
Creates a new Java property with the given type and name. Shortcut for
 String upperCaseName = Character.toUpperCase(pName.charAt(0)) +
     pName.substring(1);
 if (JavaQNameImpl.VOID.equals(pType)) {
   newBeanProperty(pType, pName, "is" + upperCaseName, "set" + upperCaseName);
 } else {
   newBeanProperty(pType, pName, "get" + upperCaseName, "set" + upperCaseName);
 }
 

newBeanProperty

public void newBeanProperty(JavaQName pType,
                            String pFieldName,
                            String pGetMethodName,
                            String pSetMethodName)
Shortcut for
 newJavaField(pFieldName, pType, JavaSource.PRIVATE);
 JavaMethod getMethod = newJavaMethod(pGetMethodName, pType, JavaSource.PUBLIC);
 getMethod.addLine("return this.", pFieldName, ";");
 JavaMethod setMethod = newJavaMethod(pSetMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
 setMethod.addParam(pType, pFieldName);
 setMethod.addLine("this.", pFieldName, " = ", pFieldName, ";");
 
Parameters:
pType - The property type
pFieldName - The name of the generated field. The generated field has private access.
pGetMethodName - The name of the generated get method or null, if no such method is being created.
pSetMethodName - The name of the generated set method or null, if no such method is being created.

newComment

public JavaComment newComment()
Creates a new Javadoc comment describing this class or interface.
See Also:
getComment()

newJavaClassInitializer

public JavaClassInitializer newJavaClassInitializer()
Creates a new instance of JavaClassInitializer.

newJavaConstructor

public JavaConstructor newJavaConstructor()
Creates a new JavaConstructor with default protection.

newJavaConstructor

public JavaConstructor newJavaConstructor(Constructor pConstructor)
Creates a new JavaConstructor with the signature of the given constructor.

newJavaConstructor

public JavaConstructor newJavaConstructor(String pProtection)
Creates a new JavaConstructor with the given protection. Equivalent to newJavaConstructor(Protection.valueOf(pProtection)).

newJavaConstructor

public JavaConstructor newJavaConstructor(JavaConstructor pConstructor)
Creates a new JavaConstructor with the same parameters, protection and exceptions than the given. Equivalent to newJavaConstructor(pConstructor, false).

newJavaConstructor

public JavaConstructor newJavaConstructor(JavaConstructor pConstructor,
                                          boolean pSuper)
Creates a new JavaConstructor with the same signature than the given constructors. Equivalent to newJavaConstructor(pConstructor, false). If the pSuper argument is true, adds an invocation of the super classes constructor with the same arguments.

newJavaConstructor

public JavaConstructor newJavaConstructor(JavaSource.Protection pProtection)
Creates a new JavaConstructor with the given protection.

newJavaField

public JavaField newJavaField(Field pField)
Creates a new JavaField with the given fields signature.

newJavaField

public JavaField newJavaField(String pName,
                              Class pType)
Creates a new JavaField with the given name, type and default protection.

newJavaField

public JavaField newJavaField(String pName,
                              Class pType,
                              String pProtection)
Creates a new JavaField with the given name, type and protection. Equivalent to newJavaField(pName, pType, Protection.valueOf(pProtecttion).

newJavaField

public JavaField newJavaField(String pName,
                              Class pType,
                              JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.

newJavaField

public JavaField newJavaField(String pName,
                              String pType)
Creates a new JavaField with the given name, type and default protection.

newJavaField

public JavaField newJavaField(String pName,
                              String pType,
                              String pProtection)
Creates a new JavaField with the given name, type and protection.

newJavaField

public JavaField newJavaField(String pName,
                              String pType,
                              JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.

newJavaField

public JavaField newJavaField(String pName,
                              JavaQName pType)
Creates a new JavaField with the given name, type and default protection.

newJavaField

public JavaField newJavaField(String pName,
                              JavaQName pType,
                              String pProtection)
Creates a new JavaField with the given name, type and protection.

newJavaField

public JavaField newJavaField(String pName,
                              JavaQName pType,
                              JavaSource.Protection pProtection)
Creates a new JavaField with the given name, type and protection.

newJavaInnerClass

public JavaInnerClass newJavaInnerClass(String pName)
Creates a new JavaInnerClass with the given name and default protection.

newJavaInnerClass

public JavaInnerClass newJavaInnerClass(String pName,
                                        String pProtection)
Creates a new JavaInnerClass with the given name and protection.

newJavaInnerClass

public JavaInnerClass newJavaInnerClass(String pName,
                                        JavaSource.Protection pProtection)
Creates a new JavaInnerClass with the given name and protection.

newJavaMethod

public JavaMethod newJavaMethod(Method pMethod)
Creates a new JavaMethod with the signature of the given method pMethod. More precise:
  1. The name of the created method is pMethod.getName().
  2. The return type is set to pMethod.getReturnType().
  3. The protection is set to that of pMethod.
  4. For any class in pMethod.getParameterTypes(), calls JavaMethod.addParam(Class,String) with the parameter names "p0", "p1", ...
  5. For any exception in pMethod.getExceptionTypes(), calls JavaMethod.addThrows(Class).

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                Class pType)
Creates a new JavaMethod with the given name, return type and default protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                Class pType,
                                String pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                Class pType,
                                JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                String pType)
Creates a new JavaMethod with the given name, return type and default protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                String pType,
                                String pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                String pType,
                                JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                JavaQName pType)
Creates a new JavaMethod with the given name, return type and default protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                JavaQName pType,
                                String pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(String pName,
                                JavaQName pType,
                                JavaSource.Protection pProtection)
Creates a new JavaMethod with the given name, return type and protection.

newJavaMethod

public JavaMethod newJavaMethod(JavaMethod pMethod)
Creates a new JavaMethod with the given methods name and signature. This is useful, for example, if you have an interface and derive an implementation. The following values are not cloned: JavaMethod.isAbstract(), JavaMethod.isStatic(), JavaMethod.isFinal(), and JavaMethod.isSynchronized().

setAbstract

public void setAbstract(boolean isAbstract)
Sets whether this class is abstract.

setDynamicImports

public void setDynamicImports(boolean pDynamicImports)
Sets, whether the class is automatically adding imports.

setForcingFullyQualifiedName

public void setForcingFullyQualifiedName(boolean pForcingFullyQualifiedName)
Sets, whether class references are always using the fully qualified class name.

setProtection

public void setProtection(JavaSource.Protection protection)
Sets the protection; use null for default protection.

setQName

public void setQName(JavaQName pQName)
Sets the JavaSource's JavaQName.

setStatic

public void setStatic(boolean pStatic)
Sets whether this JavaSource is static (for inner classes).

setType

public void setType(JavaSource.Type pType)
Sets the JavaSource type.
Parameters:
pType - "class" or "interface"
See Also:
getType()

toString

public String toString()
Returns a string representation of this JavaSource file.

write

public void write(Writer pTarget)
            throws IOException
Writes the JavaSource contents into the given Writer.

write

public void write(IndentationTarget pTarget)
            throws IOException
Specified by:
write in interface IndentationEngine
Overrides:
write in interface IndentationEngineImpl