2012-04-29 2 views
12

をリンク:@seeマーカー、のは、私がjava.lang.Doubleの者は、equalsメソッドをhtmlタグを使用してリンクする例えばましょう他のクラスのメソッド

@see <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Double.html#equals(java.lang.Object)"> 

これはOKですが、私はどのように理解していません非標準クラスをリンクする
たとえば、AbstractVehicleとVehicleという名前の2つのクラスを開発していますが、まだドキュメントが生成されているため、AbstractVehicleのjavadocドキュメントはありません。
次に、メソッドまたはクラス参照をリンクするにはどうすればよいですか?これを考慮してください:

@see mypackage.AbstractVehilce 

これはクラスのURLを入れません、私はURLを取得する方法を知っているか、またはドキュメントを生成する前に参照です。
私は質問がはっきりしていることを願って、そうでなければ教えてください。

答えて

12

特定のクラスにlinkを作成するには、{@link mypackage.AbstractVehicle}タグを使用できます。同様に、{@link mypackage.AbstractVehicle#someMethod}を使用してクラスのsomeMethod()へのリンクを作成することもできます。

javadocの推奨事項の詳細は、Oracleのjavadoc - The Java API Documentation Generatorページを参照してください。

+0

JavaDocが同じパッケージ内の別のクラスに追加される場合は、完全なパッケージ名を指定する必要がありますか? –

3

javadocのマンページでは、javadocに渡されなかったパッケージのリンクの生成方法を制御する-linkおよび-linkofflineが説明されています。

-link extdocURL 
      Creates links to existing javadoc-generated documentation 
      of external referenced classes. It takes one argument. 

      extdocURL is the absolute or relative URL of the directory 
      containing the external javadoc-generated documentation 
      you want to link to. Examples are shown below. The pack- 
      age-list file must be found in this directory (otherwise, 
      use -linkoffline). The Javadoc tool reads the package 
      names from the package-list file and then links to those 
      packages at that URL. When the Javadoc tool is run, the 
      extdocURL value is copied literally into the <A HREF> 
      links that are created. Therefore, extdocURL must be the 
      URL to the directory, not to a file. 

      You can use an absolute link for extdocURL to enable your 
      docs to link to a document on any website, or can use a 
      relative link to link only to a relative location. If rel- 
      ative, the value you pass in should be the relative path 
      from the destination directory (specified with -d) to the 
      directory containing the packages being linked to. 

      When specifying an absolute link you normally use an http: 
      link. However, if you want to link to a file system that 
      has no web server, you can use a file: link - however, do 
      this only if everyone wanting to access the generated doc- 
      umentation shares the same file system. 

      You can specify multiple -link options in a given javadoc 
      run to link to multiple documents. 

      Choosing between -linkoffline and -link - One or the other 
      option is appropriate when linking to an API document that 
      is external to the current javadoc run. 

      Use -link: when using a relative path to the external API 
      document, or when using an absolute URL to the external 
      API document, if you shell does not allow a program to 
      open a connection to that URL for reading. 

      Use -linkoffline : when using an absolute URL to the 
      external API document, if your shell does not allow a pro- 
      gram to open a connection to that URL for reading. This 
      can occur if you are behind a firewall and the document 
      you want to link to is on the other side. 

      ... 

-linkのに対し、それがネットワーク経由でパッケージリストを取得できるように、ドキュメントを生成するとき、ネットワークが接続されているように、あなたを必要とし、-linkofflineはしていませんが、パッケージリストを自分に供給する必要があります:

-linkoffline extdocURL packagelistLoc 
      This option is a varition of -link; they both create links 
      to javadoc-generated documentation for external referenced 
      classes. Use the -linkoffline option when linking to a 
      document on the web when the Javadoc tool itself is 
      "offline" - that is, it cannot access the document through 
      a web connection. 

      ... 
2

@seeの後ろに置くことができるものはjavadoc tool documentationです。外部クラスまたはメソッドのドキュメントのURLを決して置かないでください。代わりに、クラス/メソッドの名前を入れて、-link optionを使用してjavadocに適切なURLを見つけさせる必要があります。

関連する問題