JavaSource
Date: 2017-03-29

com.thoughtworks.qdox.model

## Class JavaSource

- java.lang.Object
- - com.thoughtworks.qdox.model.JavaSource

- All Implemented Interfaces:
    JavaClassParent, java.io.Serializable

      public class JavaSource
      extends java.lang.Object
      implements java.io.Serializable, JavaClassParent

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaSource()`
    `JavaSource(JavaClassContext context)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClass(JavaClass cls)`
    `void` | `addImport(java.lang.String imp)`
    `JavaClass[]` | `getClasses()`
    `ClassLibrary` | `getClassLibrary()`
    `java.lang.String` | `getClassNamePrefix()`
    `java.lang.String` | `getCodeBlock()`
    `java.io.File` | `getFile()` Deprecated. use getURL
    `java.lang.String[]` | `getImports()`
    `JavaClassContext` | `getJavaClassContext()`
    `JavaClass` | `getNestedClassByName(java.lang.String name)`
    `JavaPackage` | `getPackage()`
    `java.lang.String` | `getPackageName()`
    `JavaSource` | `getParentSource()`
    `java.net.URL` | `getURL()`
    `java.lang.String` | `resolveType(java.lang.String typeName)` Resolve a type-name within the context of this source or class.
    `void` | `setClassLibrary(ClassLibrary classLibrary)`
    `void` | `setFile(java.io.File file)` Deprecated. use setURL
    `void` | `setPackage(JavaPackage packge)`
    `void` | `setURL(java.net.URL url)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaSource

          public JavaSource()

    - #### JavaSource

          public JavaSource(JavaClassContext context)

  - ### Method Detail

    - #### setURL

          public void setURL(java.net.URL url)

      Since:
        1.4

    - #### getURL

          public java.net.URL getURL()

      Since:
        1.4

    - #### setFile

          public void setFile(java.io.File file)

      Deprecated. use setURL

    - #### getFile

          public java.io.File getFile()

      Deprecated. use getURL

    - #### getPackage

          public JavaPackage getPackage()

    - #### setPackage

          public void setPackage(JavaPackage packge)

    - #### addImport

          public void addImport(java.lang.String imp)

    - #### getImports

          public java.lang.String[] getImports()

    - #### addClass

          public void addClass(JavaClass cls)

      Specified by:
        `addClass` in interface `JavaClassParent`

    - #### getClasses

          public JavaClass[] getClasses()

    - #### getJavaClassContext

          public JavaClassContext getJavaClassContext()

      Specified by:
        `getJavaClassContext` in interface `JavaClassParent`

    - #### setClassLibrary

          public void setClassLibrary(ClassLibrary classLibrary)

    - #### getCodeBlock

          public java.lang.String getCodeBlock()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### resolveType

          public java.lang.String resolveType(java.lang.String typeName)

      Description copied from interface: `JavaClassParent`
      Resolve a type-name within the context of this source or class.
      Specified by:
        `resolveType` in interface `JavaClassParent`
      Parameters:
        `typeName` - name of a type
      Returns:
        the fully-qualified name of the type, or null if it cannot be resolved

    - #### getClassNamePrefix

          public java.lang.String getClassNamePrefix()

      Specified by:
        `getClassNamePrefix` in interface `JavaClassParent`

    - #### getParentSource

          public JavaSource getParentSource()

      Specified by:
        `getParentSource` in interface `JavaClassParent`

    - #### getNestedClassByName

          public JavaClass getNestedClassByName(java.lang.String name)

      Specified by:
        `getNestedClassByName` in interface `JavaClassParent`

    - #### getClassLibrary

          public ClassLibrary getClassLibrary()

      Returns:

    - #### getPackageName

          public java.lang.String getPackageName()