类 DefaultJavaSource

java.lang.Object
com.thoughtworks.qdox.model.impl.DefaultJavaSource
所有已实现的接口:
JavaSource, Serializable

public class DefaultJavaSource extends Object implements JavaSource, Serializable
另请参阅:
  • 构造器详细资料

    • DefaultJavaSource

      public DefaultJavaSource(ClassLibrary classLibrary)
      Default constructor for the Default JavaSource
      参数:
      classLibrary - the classLibrary, should not be null
  • 方法详细资料

    • setURL

      public void setURL(URL url)
      参数:
      url - the URL of the source file
      从以下版本开始:
      1.4
    • getURL

      public URL getURL()
      指定者:
      getURL 在接口中 JavaSource
      返回:
      the URL of the source file
    • getPackage

      public JavaPackage getPackage()
      The package of this source or null
      指定者:
      getPackage 在接口中 JavaSource
      返回:
      the package
    • setPackage

      public void setPackage(JavaPackage pkg)
    • addImport

      public void addImport(String imp)
    • getImports

      public List<String> getImports()
      Retrieve all the import
      指定者:
      getImports 在接口中 JavaSource
      返回:
      the imports, never null
    • addClass

      public void addClass(JavaClass cls)
    • getClasses

      public List<JavaClass> getClasses()
      A List with all direct classes of this source, never null
      指定者:
      getClasses 在接口中 JavaSource
      返回:
      a list of JavaClasses, never null
    • getCodeBlock

      public String getCodeBlock()
      Complete code representation of this source
      指定者:
      getCodeBlock 在接口中 JavaSource
      返回:
      the code block of this source
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • getClassNamePrefix

      public String getClassNamePrefix()
      If there's a package, return the packageName, followed by a dot, otherwise an empty String
      指定者:
      getClassNamePrefix 在接口中 JavaSource
      返回:
      the class name prefix, otherwise an empty String
    • getNestedClassByName

      public JavaClass getNestedClassByName(String name)
      Try to get the JavaClass child based on its name relative to the package. This doesn't try to resolve it by recursion.
      指定者:
      getNestedClassByName 在接口中 JavaSource
      参数:
      name - the name of the class
      返回:
      the resolved JavaClass, otherwise null
    • getClassByName

      public JavaClass getClassByName(String name)
      Try to get any class of this source by name. The name can be both the fully qualified name or just the name of the class.
      指定者:
      getClassByName 在接口中 JavaSource
      参数:
      name - the (fully qualified) name of the class
      返回:
      the matching class, otherwise null
    • getJavaClassLibrary

      public ClassLibrary getJavaClassLibrary()
      指定者:
      getJavaClassLibrary 在接口中 JavaSource
    • getPackageName

      public String getPackageName()
      Returns the name of the package or an empty String if there's no package
      指定者:
      getPackageName 在接口中 JavaSource
      返回:
      the package name, otherwise an empty String
    • setModelWriterFactory

      public void setModelWriterFactory(ModelWriterFactory modelWriterFactory)
      参数:
      modelWriterFactory - the modelWriterFactory
      从以下版本开始:
      2.0